Skip to content

Commit

Permalink
Merge pull request #46 from jbae11/scenario_specification
Browse files Browse the repository at this point in the history
Scenario specification
  • Loading branch information
katyhuff authored Aug 2, 2017
2 parents c96e56a + acdcee4 commit d268eaa
Show file tree
Hide file tree
Showing 29 changed files with 35,169 additions and 4,327 deletions.
386 changes: 297 additions & 89 deletions 2017-bae-europe/eu_future/eu_future.ipynb

Large diffs are not rendered by default.

4,731 changes: 2,387 additions & 2,344 deletions 2017-bae-europe/eu_future/eu_future.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {
"collapsed": true
},
Expand All @@ -20,14 +20,15 @@
"import sqlite3 as lite\n",
"import os\n",
"import sys\n",
"import numpy as np\n",
"import collections\n",
"sys.path.insert(0, '../../scripts/')\n",
"sys.path.insert(0, '../github/transition-scenarios/scripts/')\n",
"jupyter_directory = os.getcwd()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand All @@ -45,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 6,
"metadata": {
"collapsed": false
},
Expand All @@ -54,6 +55,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"rm: cannot remove './Desktop/cylus.sqlite': No such file or directory\n",
" : \n",
" .CL:CC CC _Q _Q _Q_Q _Q _Q _Q \n",
" CC;CCCCCCCC:C; /_\\) /_\\)/_/\\\\) /_\\) /_\\) /_\\) \n",
Expand Down Expand Up @@ -83,24 +85,16 @@
" : \n",
"Experimental Warning: MatlSellPolicy is experimental and its API may be subject to change\n",
"Experimental Warning: the Mixer archetype is experimental\n",
"Experimental Warning: MatlSellPolicy is experimental and its API may be subject to change\n",
"Experimental Warning: the Mixer archetype is experimental\n",
"Experimental Warning: MatlSellPolicy is experimental and its API may be subject to change\n",
"Experimental Warning: the Mixer archetype is experimental\n",
"Experimental Warning: MatlSellPolicy is experimental and its API may be subject to change\n",
"Experimental Warning: the Mixer archetype is experimental\n",
"Experimental Warning: MatlSellPolicy is experimental and its API may be subject to change\n",
"Experimental Warning: the Mixer archetype is experimental\n",
"\n",
"Status: Cyclus run successful!\n",
"Output location: astrid.sqlite\n",
"Simulation ID: 6d9a46d6-8769-4a4d-a3ee-927f6f17d59a\n"
"Output location: cyclus.sqlite\n",
"Simulation ID: c68feb27-c186-44c9-b377-a4c98bc08bd0\n"
]
}
],
"source": [
"! rm astrid.sqlite\n",
"! cyclus -o astrid.sqlite 1970-2160_Just_ASTRID.xml"
"! rm ./Desktop/cylus.sqlite\n",
"! cyclus france_only.xml"
]
},
{
Expand All @@ -114,7 +108,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"metadata": {
"collapsed": false
},
Expand All @@ -125,52 +119,52 @@
"text": [
"Sink_Source_Inst has no values\n",
"Sink_Source_Inst has no values\n",
"SELECT time, sum(quantity), qualid FROM resources INNER JOIN transactions ON transactions.resourceid = resources.resourceid WHERE (receiverid = 28 OR receiverid = 34) and (commodity = \"reprocess_waste\") GROUP BY time\n",
"SELECT time, sum(quantity), qualid FROM resources INNER JOIN transactions ON transactions.resourceid = resources.resourceid WHERE (receiverid = 28 OR receiverid = 34) and (commodity = \"mox_reprocess_waste\") GROUP BY time\n",
"Finished!\n"
"done!\n"
]
}
],
"source": [
"# Wait for the complete message to move on\n",
"\n",
"con = lite.connect('astrid.sqlite')\n",
"with con:\n",
" cur = con.cursor()\n",
" init_year, init_month, duration, timestep = an.get_sim_time_duration(cur)\n",
"\n",
" # get fuel source and inventory\n",
" fuel_dict = an.where_comm(\n",
" cur, 'mox', ['mox_uox_fuel_fab', 'mox_mox_fuel_fab'])\n",
" fuel_dict['from_spent_uox'] = fuel_dict.pop('mox_uox_fuel_fab')\n",
" fuel_dict['from_spent_mox'] = fuel_dict.pop('mox_mox_fuel_fab')\n",
" an.stacked_bar_chart(fuel_dict, timestep,\n",
" 'Years', 'Mass[MTHM]',\n",
" 'Total Fuel Mass vs Time',\n",
" 'where_fuel',\n",
" init_year)\n",
"cur = an.get_cursor('cyclus.sqlite')\n",
"init_year, init_month, duration, timestep = an.get_timesteps(cur)\n",
"\n",
" # get pu demand\n",
" demand = collections.OrderedDict()\n",
" demand['pu_from_legacy'] = [i * .09 for i in fuel_dict['from_spent_uox']]\n",
" demand['pu_from_spent_mox'] = [i * .09 for i in fuel_dict['from_spent_mox']]\n",
" total_mox = ([x + y for x, y in zip(fuel_dict['from_spent_uox'], fuel_dict['from_spent_mox'])])\n",
" demand['pu_total'] = [i *.09 for i in total_mox]\n",
" demand['tailings'] = [i * .91 for i in total_mox]\n",
" an.multi_line_plot(demand, timestep,\n",
" 'Years', 'Mass[MTHM]',\n",
" 'Total Demand vs Time',\n",
" 'demand',\n",
" init_year)\n",
"\n",
" # get power / number timeseries\n",
" an.plot_power(cur)\n",
"\n",
" # get reprocessing waste\n",
" reprocess_waste = an.commodity_in_out_facility(cur, 'separations', ['reprocess_waste', 'mox_reprocess_waste'], True, False, False)\n",
" an.stacked_bar_chart(reprocess_waste, timestep, 'Years', 'Mass [MTHM]', 'Reprocess Waste vs Time', 'reprocess_waste', init_year)\n",
"# get power / number timeseries\n",
"an.plot_power(cur)\n",
"print('done!')\n"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"FR\n",
"LWR\n"
]
}
],
"source": [
"eu_future = '../eu_future/eu_future.sqlite'\n",
"eu_cur = an.get_cursor(eu_future)\n",
"eu_power = an.get_power_dict(eu_cur)\n",
"\n",
"print('Finished!')"
"france_fr_power = an.get_power_dict(cur)\n",
"dictionary ={}\n",
"dictionary['FR'] = france_fr_power['France_government']\n",
"zeros = [0]*(len(france_fr_power['France_government']) - len(eu_power['France_government']))\n",
"eu_power['France_government'] = np.append(eu_power['France_government'], zeros)\n",
"dictionary['LWR'] = eu_power['France_government']\n",
"for key in dictionary:\n",
" print(key)\n",
"an.stacked_bar_chart(dictionary, timestep, 'Years', 'Capacity [GWe]',\n",
" 'French Installed Capacity vs Time ', 'france_power', init_year)"
]
},
{
Expand Down
Loading

0 comments on commit d268eaa

Please sign in to comment.