Commit 1e3ce703 authored by Fabian Neumann's avatar Fabian Neumann

minor clarifications and updates in T5

parent c50c7922
......@@ -234,7 +234,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78c4d2b9b0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee975a630>"
]
},
"execution_count": 10,
......@@ -440,7 +440,7 @@
" Number of bounded subproblems: 0\n",
" Number of created subproblems: 0\n",
" Error rc: 0\n",
" Time: 3.998594045639038\n",
" Time: 3.898280382156372\n",
"# ----------------------------------------------------------\n",
"# Solution Information\n",
"# ----------------------------------------------------------\n",
......@@ -638,7 +638,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78c04b8b38>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee4f55c18>"
]
},
"execution_count": 19,
......@@ -774,7 +774,7 @@
" Number of bounded subproblems: 0\n",
" Number of created subproblems: 0\n",
" Error rc: 0\n",
" Time: 8.340548753738403\n",
" Time: 7.731746435165405\n",
"# ----------------------------------------------------------\n",
"# Solution Information\n",
"# ----------------------------------------------------------\n",
......@@ -939,7 +939,7 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78c16755c0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee6148748>"
]
},
"execution_count": 26,
......@@ -1002,7 +1002,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 28,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1079,7 +1079,7 @@
"2012-01-01 04:00:00 0.0 0.641201"
]
},
"execution_count": 29,
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1091,7 +1091,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 29,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1101,10 +1101,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78c1675860>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee623d2e8>"
]
},
"execution_count": 30,
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
},
......@@ -1127,7 +1127,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 30,
"metadata": {
"slideshow": {
"slide_type": "skip"
......@@ -1151,7 +1151,7 @@
" dtype='datetime64[ns]', name='name', length=744, freq=None)"
]
},
"execution_count": 31,
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1162,7 +1162,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 31,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1175,7 +1175,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 32,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1193,7 +1193,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 33,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1222,7 +1222,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 34,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1279,7 +1279,7 @@
" Number of bounded subproblems: 0\n",
" Number of created subproblems: 0\n",
" Error rc: 0\n",
" Time: 8.114485740661621\n",
" Time: 8.02032470703125\n",
"# ----------------------------------------------------------\n",
"# Solution Information\n",
"# ----------------------------------------------------------\n",
......@@ -1294,7 +1294,7 @@
"('ok', 'optimal')"
]
},
"execution_count": 35,
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1316,7 +1316,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 35,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1329,7 +1329,7 @@
"525.895790860553"
]
},
"execution_count": 36,
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1341,7 +1341,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 36,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1356,7 +1356,7 @@
"Name: p_nom_opt, dtype: float64"
]
},
"execution_count": 37,
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1369,7 +1369,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 37,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1391,7 +1391,7 @@
"Name: p_nom_opt, dtype: float64"
]
},
"execution_count": 38,
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1404,7 +1404,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 38,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1421,7 +1421,7 @@
"Name: e_nom_opt, dtype: float64"
]
},
"execution_count": 39,
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1434,7 +1434,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 39,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1444,10 +1444,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78bfd405f8>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee4855e48>"
]
},
"execution_count": 40,
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
},
......@@ -1470,7 +1470,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 40,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1480,10 +1480,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78bfdfab00>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee49060f0>"
]
},
"execution_count": 41,
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
},
......@@ -1520,7 +1520,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 41,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1539,7 +1539,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 42,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -1562,7 +1562,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 43,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1591,7 +1591,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 44,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1601,10 +1601,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78bff63358>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee4a5e240>"
]
},
"execution_count": 45,
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
},
......@@ -1628,7 +1628,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 45,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1638,10 +1638,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78bffd6860>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee4af0198>"
]
},
"execution_count": 46,
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
},
......@@ -1665,7 +1665,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 46,
"metadata": {
"slideshow": {
"slide_type": "subslide"
......@@ -1675,10 +1675,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7f78c0dee4e0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f6ee4b2fa90>"
]
},
"execution_count": 47,
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
},
......
......@@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"metadata": {
"slideshow": {
"slide_type": "skip"
......@@ -57,7 +57,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -123,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 3,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -133,10 +133,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fba94945160>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f09f5771fd0>"
]
},
"execution_count": 6,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
},
......@@ -197,7 +197,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -240,7 +240,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"metadata": {
"scrolled": true,
"slideshow": {
......@@ -289,7 +289,7 @@
" Number of bounded subproblems: 0\n",
" Number of created subproblems: 0\n",
" Error rc: 0\n",
" Time: 0.18898773193359375\n",
" Time: 0.1875760555267334\n",
"# ----------------------------------------------------------\n",
"# Solution Information\n",
"# ----------------------------------------------------------\n",
......@@ -304,7 +304,7 @@
"('ok', 'optimal')"
]
},
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
......@@ -326,7 +326,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -339,7 +339,7 @@
"14706.193806194"
]
},
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
......@@ -361,7 +361,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -377,7 +377,7 @@
"Name: p_nom_opt, dtype: float64"
]
},
"execution_count": 10,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
......@@ -411,7 +411,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 8,
"metadata": {
"scrolled": true,
"slideshow": {
......@@ -422,10 +422,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fba91c55860>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f09f2a4c0b8>"
]
},
"execution_count": 11,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
......@@ -459,7 +459,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"metadata": {
"scrolled": true,
"slideshow": {
......@@ -470,10 +470,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fba91c85e10>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f09f2a33d30>"
]
},
"execution_count": 12,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
......@@ -507,7 +507,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 10,
"metadata": {
"scrolled": true,
"slideshow": {
......@@ -518,10 +518,10 @@
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fba92018128>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f09f2aa7550>"
]
},
"execution_count": 13,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
......@@ -567,7 +567,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 11,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -583,7 +583,7 @@
"dtype: float64"
]
},
"execution_count": 20,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
......@@ -608,7 +608,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 12,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -624,7 +624,7 @@
"dtype: float64"
]
},
"execution_count": 21,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
......@@ -638,7 +638,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 13,
"metadata": {
"slideshow": {
"slide_type": "fragment"
......@@ -654,7 +654,7 @@
"dtype: int64"
]
},
"execution_count": 23,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -63,8 +63,6 @@
"\n",
"* The marginal costs are illustrative, not accurate.\n",
"\n",
"* Only the first day of 2011 is in the github dataset, which is not representative. The full year of 2011 can be downloaded [here](http://www.pypsa.org/examples/scigrid-with-load-gen-trafos-2011.zip).\n",
"\n",
"* The ENTSO-E total load for Germany may not be scaled correctly; it is scaled up uniformly by factor 1.12 (a simplification of the methodology in Schumacher, Hirth (2015), which suggests monthly factors).\n",
"\n",
"* Biomass from the EEG Stammdaten are not read in at the moment.\n",
......@@ -109,7 +107,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Some general settings (You may have to adjust this path to where you downloaded the network data!):"
"Some general settings:"
]
},
{
......@@ -209,6 +207,7 @@
"source": [
"network.lines[\"s_nom_original\"] = network.lines.s_nom\n",
"\n",
"# extendable, but no reduction of line capacities\n",
"network.lines.s_nom_extendable = True\n",
"network.lines.s_nom_min = network.lines.s_nom\n",
"\n",
......@@ -236,7 +235,7 @@
"metadata": {},
"source": [
"***\n",
"## (a) Describe the nework as well as its regional and temporal characteristics."
"## (a) Describe the network as well as its regional and temporal characteristics."
]
},
{
......@@ -260,7 +259,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### (a)-(ii) | Plot the total generation capacities grouped by generation technology. Why is the share of capacity for renewables higher than the share of electricity produced?"
"### (a)-(ii) | Plot the total generation capacities grouped by generation technology. Why is the share of capacity for renewables higher than the share of electricity produced?\n",
"> **Hint:** Use the pandas functions `groupby`."
]
},
{
......@@ -269,8 +269,7 @@
"metadata": {},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,1)\n",
"fig.set_size_inches(16,6)\n",
"fig, ax = plt.subplots(figsize=(16,6))\n",
"\n",
"# TASK\n",
"???"
......@@ -290,10 +289,9 @@
"outputs": [],
"source": [
"fig, axes = plt.subplots(nrows=n_rows, ncols=n_cols,\n",
" figsize=(size*n_cols,size*n_rows),\n",
" subplot_kw={\"projection\":ccrs.PlateCarree()})\n",
"\n",
"fig.set_size_inches(size*n_cols,size*n_rows)\n",
"\n",
"for i,timestep in enumerate(timesteps):\n",
" i_row = i // n_cols\n",
" i_col = i % n_cols\n",
......@@ -340,16 +338,14 @@
" n_rows_g = n_graphs_g // n_cols_g\n",
"else:\n",
" n_rows_g = n_graphs_g // n_cols_g + 1\n",
"\n",
" \n",
"fig, axes = plt.subplots(nrows=n_rows_g, ncols=n_cols_g,\n",
" figsize=(width_factor*n_cols_g,height_factor*n_rows_g),\n",
" subplot_kw={\"projection\":ccrs.PlateCarree()})\n",
"\n",
"width_factor = 4\n",
"height_factor = 4\n",
"\n",
"fig.set_size_inches(width_factor*n_cols_g,height_factor*n_rows_g)\n",
"\n",
"for i,tech in enumerate(techs):\n",
" i_row = i // n_cols_g\n",
" i_col = i % n_cols_g\n",
......@@ -434,6 +430,12 @@
"# TASK\n",
"p_by_carrier = ???\n",
"\n",
"#reorder\n",
"cols = ['Nuclear', 'Run of River', 'Brown Coal', 'Hard Coal', 'Gas',\n",
" 'Storage Hydro', 'Waste', 'Wind Offshore', 'Wind Onshore', 'Solar']\n",
"p_by_carrier = p_by_carrier[cols]\n",
"p_by_carrier_gw = p_by_carrier / 1e3 # convert MW to GW\n",
"\n",
"colors = {\"Brown Coal\" : \"sienna\",\n",
" \"Hard Coal\" : \"dimgrey\",\n",
" \"Nuclear\" : \"deeppink\",\n",
......@@ -445,23 +447,20 @@
" \"Waste\" : \"forestgreen\",\n",
" \"Storage Hydro\" : \"darkmagenta\"\n",
" }\n",
"#reorder\n",
"cols = ['Nuclear', 'Run of River', 'Brown Coal', 'Hard Coal', 'Gas',\n",
" 'Storage Hydro', 'Waste', 'Wind Offshore', 'Wind Onshore', 'Solar']\n",
"p_by_carrier = p_by_carrier[cols]\n",
"\n",
"fig,ax = plt.subplots(1,1)\n",
"fig, ax = plt.subplots(figsize=(16,8))\n",
"\n",
"fig.set_size_inches(16,8)\n",
"p_by_carrier.plot(\n",
" kind=\"area\",\n",
" ax=ax,\n",
" linewidth=0,\n",
" color=[colors[col] for col in p_by_carrier.columns]\n",
")\n",
"\n",
"(p_by_carrier/1e3).plot(kind=\"area\",ax=ax,linewidth=0,color=[colors[col] for col in p_by_carrier.columns])\n",
"\n",
"ax.legend(ncol=5,loc=\"upper left\")\n",
"ax.legend(ncol=5, loc=\"upper left\")\n",
"\n",
"ax.set_ylabel(\"GW\")\n",
"\n",
"ax.set_xlabel(\"\")\n",
"\n",
"ax.set_ylim(0,100);"
]
},
......@@ -480,19 +479,17 @@
},
"outputs": [],
"source": [
"fig,ax = plt.subplots(1,1)\n",
"fig.set_size_inches(12,6)\n",
"fig, ax = plt.subplots(figsize=(12,6))\n",
"\n",
"# TASK\n",
"p_storage = ???\n",
"state_of_chage = ???\n",
"\n",
"p_storage.plot(label=\"Pumped hydro dispatch\",ax=ax,linewidth=3)\n",
"state_of_charge.plot(label=\"State of charge\",ax=ax,linewidth=3)\n",
"p_storage.plot(label=\"Pumped hydro dispatch\", ax=ax)\n",
"state_of_charge.plot(label=\"State of charge\", ax=ax)\n",
"\n",
"ax.legend()\n",
"ax.set_ylabel(\"MWh\")\n",
"ax.set_xlabel(\"\")"
"ax.set_ylabel(\"MWh\")"
]
},
{
......@@ -511,10 +508,9 @@
"outputs": [],
"source": [
"fig, axes = plt.subplots(nrows=n_rows, ncols=n_cols,\n",
" figsize=(size*n_cols,size*n_rows),\n",
" subplot_kw={\"projection\":ccrs.PlateCarree()})\n",
"\n",
"fig.set_size_inches(size*n_cols,size*n_rows)\n",
"\n",
"for i,timestep in enumerate(timesteps):\n",
" i_row = i // n_cols\n",
" i_col = i % n_cols\n",
......@@ -548,10 +544,9 @@
"outputs": [],
"source": [
"fig, axes = plt.subplots(nrows=n_rows, ncols=n_cols,\n",
" figsize=(size*n_cols,size*n_rows),\n",
" subplot_kw={\"projection\":ccrs.PlateCarree()})\n",
"\n",
"fig.set_size_inches(size*n_cols,size*n_rows)\n",
"\n",
"for i,timestep in enumerate(timesteps):\n",
" i_row = i // n_cols\n",
" i_col = i % n_cols\n",
......@@ -624,7 +619,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"> **Hint:** Set the cost associated with transmission expansion to zero and rerun LOPF."
"> **Hint:** For testing what would happen if there were unlimited transmission capacity, set the cost associated with transmission expansion to zero and rerun LOPF."
]
},
{
......@@ -636,17 +631,12 @@
"carriers = [\"Wind Onshore\", \"Wind Offshore\", \"Solar\"]\n",
"\n",
"n_graphs_g = len(carriers)\n",
"\n",
"n_cols_g = 3\n",
"\n",
"n_rows_g = 1\n",
"\n",
" \n",
"fig, axes = plt.subplots(nrows=n_rows_g, ncols=n_cols_g)\n",
"\n",
"size_g = 6\n",
"\n",
"fig.set_size_inches(size_g*n_cols_g,size_g*n_rows_g)\n",
" \n",
"fig, axes = plt.subplots(nrows=n_rows_g, ncols=n_cols_g,\n",
" figsize=(size_g*n_cols_g,size_g*n_rows_g))\n",
"\n",
"for i,carrier in enumerate(carriers):\n",
" i_col = i % n_cols_g\n",
......@@ -773,10 +763,9 @@
"outputs": [],
"source": [
"fig, axes = plt.subplots(nrows=n_rows, ncols=n_cols,\n",
" figsize=(size*n_cols,size*n_rows),\n",
" subplot_kw={\"projection\":ccrs.PlateCarree()})\n",
"\n",