From 6731d75c212f80c40c5c4e7ddc40f48e2c16db81 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 26 Sep 2019 12:01:32 +0200 Subject: [PATCH 1/2] updates after Paul's comments --- tutorial/README.rst | 1 + tutorial/westeros/westeros_baseline.ipynb | 12 ++++++-- .../westeros/westeros_emissions_taxes.ipynb | 25 ++++++++++------ .../westeros/westeros_firm_capacity.ipynb | 15 ++++++++-- .../westeros_flexible_generation.ipynb | 4 +-- tutorial/westeros/westeros_seasonality.ipynb | 29 ++++++++++++------- 6 files changed, 60 insertions(+), 26 deletions(-) diff --git a/tutorial/README.rst b/tutorial/README.rst index 4d012bcdd..3c9ce7cba 100644 --- a/tutorial/README.rst +++ b/tutorial/README.rst @@ -67,6 +67,7 @@ uses it to illustrate a range of framework features. 3. `Limit emissions using a tax `_ instead of a bound. 4. `Represent both coal and wind electricity `_, using a “firm capacity” formulation: each generation technology can supply some firm capacity, but the variable, renewable technology (wind) supplies less than coal. 5. Represent coal and wind electricity using a different, `“flexibility requirement” formulation `_, wherein wind *requires* and coal *supplies* flexibility. +6. `Variablity in energy supply and demand `_, by adding two sub-annual time steps (winter and summer). Austrian energy system ---------------------- diff --git a/tutorial/westeros/westeros_baseline.ipynb b/tutorial/westeros/westeros_baseline.ipynb index 2f077d7fc..fb17badaa 100644 --- a/tutorial/westeros/westeros_baseline.ipynb +++ b/tutorial/westeros/westeros_baseline.ipynb @@ -77,7 +77,7 @@ "source": [ "## MESSAGEix: the mathematical paradigm\n", "\n", - "At its core, *MESSAGEix* is an optimization model:\n", + "At its core, *MESSAGEix* is an optimization problem:\n", "\n", "> $\\min \\quad ~c^T \\cdot x$ \n", "> $~s.t. \\quad A \\cdot x \\leq b$\n", @@ -347,6 +347,8 @@ }, "source": [ "The `COMMODITY_BALANCE_GT` and `COMMODITY_BALANCE_LT` equations ensure that `demand` for each `commodity` is met at each `level` in the energy system.\n", + "The equation is copied below in this tutorial notebook, but every model equation is available for reference in\n", + "the [Mathematical formulation](https://message.iiasa.ac.at/en/stable/model/MESSAGE/model_core.html#) section of the MESSAGEix documentation.\n", "\n", "$\\sum_{\\substack{n^L,t,m \\\\ y^V \\leq y}} \\text{output}_{n^L,t,y^V,y,m,n,c,l} \\cdot \\text{ACT}_{n^L,t,y^V,y,m}$\n", "$- \\sum_{\\substack{n^L,t,m, \\\\ y^V \\leq y}} \\text{input}_{n^L,t,y^V,y,m,n,c,l} \\cdot \\text{ACT}_{n^L,t,m,y}$ \n", @@ -501,7 +503,9 @@ "- receives *input* in the form of the \"electricity\" *commodity* at the \"final [energy]\" *level*, and\n", "- *outputs* the commodity \"light\" at the \"useful [energy]\" level.\n", "\n", - "The `value` in the input and output parameter is used to represent the effiecieny of a technology (efficiency = output/input). For example, input of 1.0 and output of 1.0 for a technology shows that the efficiency of that technology is 100% in converting input commodity to output commodity." + "The `value` in the input and output parameter is used to represent the effiecieny of a technology (efficiency = output/input).\n", + "For example, input of 1.0 and output of 1.0 for a technology shows that the efficiency of that technology is 100% in converting\n", + "the input commodity to the output commodity." ] }, { @@ -1325,7 +1329,9 @@ "source": [ "### Electricity Price\n", "\n", - "And how much does the electricity cost? These prices are in fact **shadow prices** taken from the **dual variables** of the model solution. They reflect the marginal cost of electricity generation (i.e., the additional cost of the system for supplying one more unit of electricity), which is in fact the marginal cost of the most expensive generator. \n", + "And how much does the electricity cost? These prices are in fact **shadow prices** taken from the **dual variables** of the model solution.\n", + "They reflect the marginal cost of electricity generation (i.e., the additional cost of the system for supplying one more unit of\n", + "electricity), which is in fact the marginal cost of the most expensive operating generator. \n", "\n", "Note the price drop when the most expensive technology is no longer in the system." ] diff --git a/tutorial/westeros/westeros_emissions_taxes.ipynb b/tutorial/westeros/westeros_emissions_taxes.ipynb index c2a1fac03..38cab3358 100644 --- a/tutorial/westeros/westeros_emissions_taxes.ipynb +++ b/tutorial/westeros/westeros_emissions_taxes.ipynb @@ -85,7 +85,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "When setting a cumlulative bound, the undiscounted price of emission is the same in different model years (see the marginals of equation `EMISSION_CONSTRAINT`). However, considering the year-to-year discount factor, we observe an ascending trend in emission prices shown in `PRICE_EMISSION` above. This means the emission price in later years is higher as the value of money in the future is lower compared to today. " + "When setting a cumlulative bound, the undiscounted price of emission is the same in different model years (see the marginals of\n", + "equation `EMISSION_CONSTRAINT`). However, considering the year-to-year discount factor, we observe an ascending trend in\n", + "emission prices shown in `PRICE_EMISSION` above. This means the emission price in later years is higher as the value of money in\n", + "the future is lower compared to today. " ] }, { @@ -94,9 +97,11 @@ "source": [ "## Make a new scenario with emission bounds by year\n", "\n", - "In the previous example, we imposed a bound on emissions over the entire model horizon by using the `type_year` as 'cumulative' in the parameter `bound_emission`. Now, we will create a similar scenario, but the emission constraint will be defined per year.\n", + "In the previous example, we imposed a bound on emissions over the entire model horizon by using the `type_year` as 'cumulative'\n", + "in the parameter `bound_emission`. Now, we will create a similar scenario, but the emission constraint will be defined per year.\n", "\n", - "For the sake of comparison, the per-year emission values will be chosen exactly in line with the optimal emission trajectory obtained from the solution of the previous scenario." + "For the sake of comparison, the per-year emission values will be chosen exactly in line with the optimal emission trajectory\n", + "obtained from the solution of the previous scenario." ] }, { @@ -174,7 +179,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Comparing the emission prices between the two scenarios at this stage, we see that the values are not identical. The reason is that when we introduce emission bounds per year, the price of emission in each year reflects the cost occuring when reducing one more unit of emission in that year. However, in the scenario with a cumulative bound over the entire model horizon, the price of emission reflects the cost of the system in reducing one more unit of emission over the entire model horizon." + "Comparing the emission prices between the two scenarios at this stage, we see that the values are not identical.\n", + "The reason is that when we introduce emission bounds per year, the price of emission in each year reflects the cost occuring\n", + "when reducing one more unit of emission in that year.\n", + "However, in the scenario with a cumulative bound over the entire model horizon, the price of emission reflects the cost of the\n", + "system in reducing one more unit of emission over the entire model horizon." ] }, { @@ -234,10 +243,8 @@ }, { "cell_type": "code", - "execution_count": 16, - "metadata": { - "collapsed": true - }, + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ "scen_tax.commit(comment='setting taxes on emissions')" @@ -265,7 +272,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Question\n", + "# Exercises\n", "- How does these prices compare to the scenario with a cumulative emission bound (`scen_bd`)?\n", "- Try setting the emission tax again by using emission prices obtained from the scenario with yearly bounds on emissions (`scen_bd_by_year`). What is the difference in emissions (i.e., variable `EMISS`)?" ] diff --git a/tutorial/westeros/westeros_firm_capacity.ipynb b/tutorial/westeros/westeros_firm_capacity.ipynb index 889176df7..d9b482d81 100644 --- a/tutorial/westeros/westeros_firm_capacity.ipynb +++ b/tutorial/westeros/westeros_firm_capacity.ipynb @@ -67,7 +67,13 @@ "source": [ "## Improving the Representation of Electricity Sector\n", "### Peak load factor\n", - "The input demand for electricity (notice: not the demand for useful light but for electricity) in the model shows the average electricity demand in the given time (which in our example is a year). However, power systems need enough installed capacity not only to cover the average electricity demand but also to meet the peak demand, i.e., maximum load throughout that time. This feature can be specified in the model using parameter `peak_load_factor`. For example, if annual average load is 5 GWa peak load amy be 10GW, hence, the peak load factor is equal to 2." + "The input demand for electricity (notice: not the demand for useful light but for electricity) in the model shows the average\n", + "electricity demand in the given time (which in our example is a year).\n", + "However, power systems need enough installed capacity not only to cover the average electricity demand but also to meet the peak\n", + "demand, i.e., maximum load throughout that time.\n", + "This feature can be specified in the model using parameter `peak_load_factor`.\n", + "For example, if annual average load is 5 GW, the peak load may be twice as high, at 10 GW; hence, the peak load factor is equal\n", + "to 2." ] }, { @@ -94,7 +100,12 @@ "metadata": {}, "source": [ "## Reliability of Power System\n", - "In roder to meet demand reliably, the power system needs to maintain dispatchable or so called firm capacity at any time. Some technologies like coal power plants can fully contribute to the required firm capacity, i.e., 1 MW installed capacity of these technologies provide 1 MW firm capacity. However, some other technologies such as variable renewables such as wind are not fully reliable when the power system needs them. As such, the capacity value of wind power plant is considered to be lower than 1. In this example, we assume that 10% of electricity supply by wind is 80% reliable, while he remaining 90% installed capacity can only contribute by 5% to the required firm capcity. As such, we divide wind power into two parts with two different ratings (r1 and r2) and we define this through parameter `rating_bin`.\n" + "In order to meet demand reliably, the power system needs to maintain dispatchable or so-called firm capacity at any time.\n", + "Some technologies like coal power plants can fully contribute to the required firm capacity, i.e.,\n", + "1 MW installed capacity of these technologies provide 1 MW firm capacity.\n", + "However, some other technologies such as variable renewables like wind are not fully reliable when the power system needs them.\n", + "As such, the capacity value of wind power plant is considered to be lower than 1.\n", + "In this example, we assume that 10% of electricity supply by wind is 80% reliable, while the remaining 90% installed capacity can only contribute by 5% to the required firm capacity. As such, we divide wind power into two parts with two different ratings (r1 and r2) and we define this through parameter `rating_bin`.\n" ] }, { diff --git a/tutorial/westeros/westeros_flexible_generation.ipynb b/tutorial/westeros/westeros_flexible_generation.ipynb index fa69afe4b..128c46812 100644 --- a/tutorial/westeros/westeros_flexible_generation.ipynb +++ b/tutorial/westeros/westeros_flexible_generation.ipynb @@ -70,7 +70,7 @@ "source": [ "## Add a carbon tax\n", "\n", - "Then, we add a carbon tax to motivate the use of low-carbon technologies in the system. We do this similar to the process explained in the [tutorial for adding emission tax](https://github.com/iiasa/message_ix/blob/master/tutorial/westeros/westeros_emissions_taxes.ipynb)" + "Then, we add a carbon tax to motivate the use of low-carbon technologies in the system. We do this similar to the process explained in the tutorial for adding emissions taxes (`westeros_emission_taxes.ipynb`)." ] }, { @@ -101,7 +101,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "collapsed": true }, diff --git a/tutorial/westeros/westeros_seasonality.ipynb b/tutorial/westeros/westeros_seasonality.ipynb index be93f1acd..ecd72f59e 100644 --- a/tutorial/westeros/westeros_seasonality.ipynb +++ b/tutorial/westeros/westeros_seasonality.ipynb @@ -5,14 +5,19 @@ "metadata": {}, "source": [ "# \"*Winter is coming!*\": Modeling of variability in energy supply and demand\n", - "Time-dependent variations in demand and supply are common characteristics of an electricity system, and Westeros is not an exception. This tutorial helps to learn how to add sub-annual time steps to a MESSAGEix model and investigate the impact of the variability in supply and demand. This tutorial is structured as follows:\n", + "Time-dependent variations in demand and supply are common characteristics of an electricity system, and Westeros is not an\n", + "exception. This tutorial helps to learn how to add sub-annual time steps to a MESSAGEix model and investigate the impact of the\n", + "variability in supply and demand. It is structured as follows:\n", "1. A short note on seasonality\n", "2. Adding sub-annual time steps\n", "3. Analyzing the results\n", "\n", "### Requirements for running this tutorial\n", "- You have MESSAGEix framework installed and working\n", - "- You have run Westeros baseline scenario and solved it successfully" + "- You have run Westeros baseline scenario and solved it successfully\n", + "\n", + "This tutorial was developed by Behnam Zakeri ([@behnam-zakeri](https://github.com/behnam-zakeri)) for the course Energy\n", + "Economics and Modeling held at the International Summer School in Energy Technology, St. Petersburg Polytechnique University in August 2018." ] }, { @@ -189,7 +194,8 @@ "|-----------|----------| -----------|\n", "| duration_time\t| time\t|duration of sub-annual time slices (relative to 1)| \n", "\n", - "In our example, winter and summer are each half of the year." + "In our example, winter and summer are defined as each half of the year. However, the duration of time steps can be\n", + "different in a MESSAGEix model, e.g., winter 0.4 and summer 0.6. But the sum of the duration times must be equal to 1." ] }, { @@ -213,7 +219,10 @@ "In this stage, we introduce a function that helps us to modify the parameters after adding new time steps. This function called \"yearly_to_season\" does the following:\n", "- removing old values, where the \"time\" index was \"year\"\n", "- populating data for new \"time\" indexes\n", - "- using the ratios defined by the user to convert yearly values to seasonal ones" + "- using the ratios defined by the user to convert yearly values to seasonal ones\n", + "\n", + "This is a common code pattern when modelling using MESSAGEix:\n", + "writing re-usable code that helps modify existing parameter data to reflect some desired change in the reference energy system." ] }, { @@ -279,7 +288,7 @@ "metadata": {}, "source": [ "### Modifying \"input\" and \"output\"\n", - "However, not all parameters that have subannual time steps need to divide their values for each time step. For example, \"output\" parameter shows the output efficiency, commodities and level of a technology. Hence, as far as the efficiency of a technology remains unchanged in different seasons, the value of \"output\" remains fixed. As such, we only need to add the sub-annual time steps but with the same value as for the yearly one." + "However, not all parameters that have subannual time steps need to divide their annual values for each time step. For example, \"output\" parameter shows the output efficiency, commodities and the level of a technology. Hence, as far as the efficiency of a technology remains unchanged in different seasons, the value of \"output\" will be the same. As such, we only need to add the sub-annual time steps but with the same value as for the yearly one." ] }, { @@ -324,7 +333,7 @@ "metadata": {}, "source": [ "### Modifying capacity factor\n", - "We discussed about the variation in the capacity factor of wind power in each month. By averaging the values for the respective months, we reach a capacity factor of 0.46 for winter and 0.25 for summer in Westeros. For simplicity, the capacity factor of wind was 1 in the baseline scenario.\n" + "We discussed about the variation in the capacity factor of wind power in each month. By averaging the values for the respective months, we reach a capacity factor of 0.46 for winter and 0.25 for summer in Westeros.\n" ] }, { @@ -334,11 +343,11 @@ "outputs": [], "source": [ "# Modifying capacity factor\n", - "# Retrieving average yearly capacity factor of wind in the model\n", - "cf_wind = scen.par('capacity_factor', {'technology': 'wind_ppl'})['value'].mean()\n", + "# Let's check the yearly capacity factor of wind in the baseline scenario\n", + "scen.par('capacity_factor', {'technology': 'wind_ppl'})['value'].mean()\n", "\n", - "# Passing seasonal capacity factors as shares of the yearly value\n", - "cf_data = {'winter': 0.46/cf_wind, 'summer': 0.25/cf_wind} \n", + "# Passing seasonal capacity factors\n", + "cf_data = {'winter': 0.46, 'summer': 0.25} \n", "cf_filters = {'technology': 'wind_ppl'}\n", "yearly_to_season(scen, 'capacity_factor', cf_data, cf_filters)\n", "\n", From 7583903463a05ada34797211c2793d445cdb9c24 Mon Sep 17 00:00:00 2001 From: FRICKO Oliver Date: Tue, 1 Oct 2019 10:17:33 +0200 Subject: [PATCH 2/2] added part1/3 for renewable tutorial --- .../westeros/westeros_firm_capacity.ipynb | 180 +++++++++++++----- 1 file changed, 134 insertions(+), 46 deletions(-) diff --git a/tutorial/westeros/westeros_firm_capacity.ipynb b/tutorial/westeros/westeros_firm_capacity.ipynb index d9b482d81..3176d641c 100644 --- a/tutorial/westeros/westeros_firm_capacity.ipynb +++ b/tutorial/westeros/westeros_firm_capacity.ipynb @@ -4,11 +4,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Westeros Tutorial Part IV - Firm Capacity\n", + "# Westeros Tutorial\n", + "## Adding representation of renewables - Part 1: Introducing `firm capacity`\n", "\n", - "In the previous part, we showed how to introduce emissions into a stylized energy system model, and what happens if you put a constraint on total CO2 emissions.\n", + "This tutorial, which demonstrates how to apply various model features to provide a more realistic representation of renewable energy integration in the energy system, is comprised of three parts. In the first part we will show you how to ensure that in a model setup which does not use sub-annual timesteps and therefore does not depict peak load, we still account for `firm capacity`, i.e. sufficient backup capacity from electricity generation plants to maintain reliability through reasonable load and contingency events.\n", "\n", - "In this tutorial notebook, we will illustrate how to add other constraints, in particular the requirement to have sufficient dispatchable (firm) capacity." + "Further information can be found in https://doi.org/10.1016/j.esr.2013.01.001 (*Sullivan et al., 2013*)" ] }, { @@ -18,7 +19,7 @@ "outputs": [], "source": [ "import pandas as pd\n", - "import ixmp\n", + "import ixmp as ix\n", "import message_ix\n", "\n", "from message_ix.utils import make_df\n", @@ -32,7 +33,14 @@ "metadata": {}, "outputs": [], "source": [ - "mp = ixmp.Platform(dbtype='HSQLDB')" + "mp = ix.Platform(dbtype='HSQLDB')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load the existing scenario '*emission_bound*' and clone to a new scenario '*firm_capacity*' to which we will apply the `firm_capacity` constraint" ] }, { @@ -41,7 +49,17 @@ "metadata": {}, "outputs": [], "source": [ - "base = message_ix.Scenario(mp, model='Westeros Electrified', scenario='emission_bound')" + "model = 'Westeros Electrified'\n", + "base = message_ix.Scenario(mp, model=model, scenario='emission_bound')\n", + "scen = base.clone(model, 'firm_capacity', 'illustration of firm-capacity formulation', keep_solution=False)\n", + "scen.check_out()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Retrieve parameters to perform subsequent addition of parameters" ] }, { @@ -50,11 +68,6 @@ "metadata": {}, "outputs": [], "source": [ - "model = 'Westeros Electrified'\n", - "scen = base.clone(model, 'firm_capacity','illustration of firm-capacity formulation',\n", - " keep_solution=False)\n", - "scen.check_out()\n", - "\n", "year_df = scen.vintage_and_active_years()\n", "vintage_years, act_years = year_df['year_vtg'], year_df['year_act']\n", "model_horizon = scen.set('year')\n", @@ -65,15 +78,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Improving the Representation of Electricity Sector\n", - "### Peak load factor\n", - "The input demand for electricity (notice: not the demand for useful light but for electricity) in the model shows the average\n", - "electricity demand in the given time (which in our example is a year).\n", - "However, power systems need enough installed capacity not only to cover the average electricity demand but also to meet the peak\n", - "demand, i.e., maximum load throughout that time.\n", - "This feature can be specified in the model using parameter `peak_load_factor`.\n", - "For example, if annual average load is 5 GW, the peak load may be twice as high, at 10 GW; hence, the peak load factor is equal\n", - "to 2." + "## `peak_load_factor` - Describing the Electricity Sector\n", + "For systems across the U.S., load duration curves are similar from one location to another. Based on load data it was calculated that the peak load is, on average, 1.7 times the average load (a load factor of 59%). Coupled with a standard reserve margin of 15–20% of peak load, that means firm capacity requirements for the U.S. should be roughly twice average load. (*Sullivan et al., 2013*)\n", + "Therefore, a `peak_load_factor` of 2 is introduced for the `level`:`secondary` and `commodity`:`electricity`, which is the level/commodity where powerplant generation is accounted." ] }, { @@ -90,8 +97,7 @@ " 'year': model_horizon,\n", " 'time' : 'year',\n", " 'value' : 2,\n", - " 'unit' : '-'})\n", - "\n", + " 'unit' : '???'})\n", "scen.add_par('peak_load_factor', peak_load_factor)" ] }, @@ -99,13 +105,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Reliability of Power System\n", - "In order to meet demand reliably, the power system needs to maintain dispatchable or so-called firm capacity at any time.\n", - "Some technologies like coal power plants can fully contribute to the required firm capacity, i.e.,\n", - "1 MW installed capacity of these technologies provide 1 MW firm capacity.\n", - "However, some other technologies such as variable renewables like wind are not fully reliable when the power system needs them.\n", - "As such, the capacity value of wind power plant is considered to be lower than 1.\n", - "In this example, we assume that 10% of electricity supply by wind is 80% reliable, while the remaining 90% installed capacity can only contribute by 5% to the required firm capacity. As such, we divide wind power into two parts with two different ratings (r1 and r2) and we define this through parameter `rating_bin`.\n" + "## `rating_bin` and `reliability_factor` - Describing the powerplant reliability\n", + "### Ensuring enough firm capacity\n", + "Toward meeting the firm capacity requirement, conventional generating technologies contribute their nameplate generation capacity. \n", + "\n", + "This therefore implies that for conventional powerplants i.e., for `coal_ppl`, a `reliability_factor` of 1, defined for the `rating_bin`:`firm`, which is predefined as part of the model formulation.\n", + "\n", + "In order to account for the integration challenge at higher shares of variable renewables, their contribution to the capacity requirements i.e., their capacity value, declines as the market share of the technology increases. We therefore assume, that up to a share of 20% of total electricity supply, the capacity of `wind_ppl` adds by 80% to the firm capacity of the power system, defined as `rating_bin`:`r1`. The remaining 80% installed capacity, however only 5% contribute to the firm capcity , defined as `rating_bin`:`r2`. " ] }, { @@ -118,7 +124,7 @@ " 'node': country,\n", " 'commodity': 'electricity',\n", " 'level' : 'secondary', \n", - " 'unit': '-',\n", + " 'unit': '???',\n", " 'time': 'year',\n", " 'year_act': model_horizon})" ] @@ -129,24 +135,23 @@ "metadata": {}, "outputs": [], "source": [ - "# adding wind ratings to the respective set \n", + "# add the ratings as a set \n", "scen.add_set('rating', ['r1', 'r2'])\n", "\n", - "# adding rating bins for wind power plant\n", - "rating_bin = make_df(base_reliability, technology= 'wind_ppl', value = 0.1, rating= 'r1')\n", + "# for Wind PPL\n", + "rating_bin = make_df(base_reliability, technology= 'wind_ppl', value = 0.2, rating= 'r1')\n", "scen.add_par('rating_bin', rating_bin)\n", "\n", - "rating_bin = make_df(base_reliability, technology= 'wind_ppl', value = 0.9, rating= 'r2')\n", - "scen.add_par('rating_bin', rating_bin)\n", - "\n", - "# adding reliability factor for each rating of wind power plant\n", "reliability_factor = make_df(base_reliability, technology= 'wind_ppl', value = 0.8, rating= 'r1')\n", "scen.add_par('reliability_factor', reliability_factor)\n", "\n", + "rating_bin = make_df(base_reliability, technology= 'wind_ppl', value = 0.8, rating= 'r2')\n", + "scen.add_par('rating_bin', rating_bin)\n", + "\n", "reliability_factor = make_df(base_reliability, technology= 'wind_ppl', value = 0.05, rating= 'r2')\n", "scen.add_par('reliability_factor', reliability_factor)\n", "\n", - "# considering coal power plant as firm capacity (adding a reliability factor of 1)\n", + "# for Coal PPL\n", "reliability_factor = make_df(base_reliability, technology= 'coal_ppl', value = 1, rating= 'firm')\n", "scen.add_par('reliability_factor', reliability_factor)" ] @@ -155,7 +160,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Commit and Solve" + "### Commit and solve" ] }, { @@ -190,7 +195,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Plotting" + "# Plotting Results" ] }, { @@ -200,7 +205,40 @@ "outputs": [], "source": [ "from tools import Plots\n", - "p = Plots(scen, country, firstyear=700)" + "p = Plots(scen, country, firstyear=700) # scenario: 'firm_capacity' (emission_bound scenario with firm capacity)\n", + "b = Plots(base, country, firstyear=700) # scenario: 'emission_bound' (without firm capacity)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Activity\n", + "***\n", + "When comparing the results of the original scenario without the reliability factor ('*emission_bound*') and the results of our newly modified scenario ('*firm_capacity*'), for the same carbon price we can observe that the activity of the `wind_ppl` and the `coal_ppl` is identical, which is what we hoped to achieve." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Scenario: '*emission_bound*'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.plot_activity(baseyear=True, subset=['coal_ppl', 'wind_ppl'])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Scenario: '*firm_capacity*'" ] }, { @@ -212,6 +250,38 @@ "p.plot_activity(baseyear=True, subset=['coal_ppl', 'wind_ppl'])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Capacity\n", + "***\n", + "The difference between the two scenarios can be seen when comparing the capacity. Whereas in the '*emission_bound*' scenario, coal capacity is quickly phased out, the `firm_capacity` scenario shows, that there is a substantial amount of capacity required from the `coal_ppl` in order for the `wind_ppl` to achieve such high market share levels." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Scenario: '*emission_bound*'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "b.plot_capacity(baseyear=True, subset=['coal_ppl', 'wind_ppl'])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Scenario: '*firm_capacity*'" + ] + }, { "cell_type": "code", "execution_count": null, @@ -221,20 +291,36 @@ "p.plot_capacity(baseyear=True, subset=['coal_ppl', 'wind_ppl'])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prices\n", + "***\n", + "This has a substantial impact on the electricity price, which is reflected in the prices for lighting." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Scenario: '*emission_bound*'" + ] + }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "p.plot_prices(subset=['light'], baseyear=True)" + "b.plot_prices(subset=['light'], baseyear=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Close the connection to the database" + "### Scenario: '*firm_capacity*'" ] }, { @@ -243,7 +329,7 @@ "metadata": {}, "outputs": [], "source": [ - "mp.close_db()" + "p.plot_prices(subset=['light'], baseyear=True)" ] }, { @@ -251,7 +337,9 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "mp.close_db()" + ] } ], "metadata": { @@ -270,7 +358,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.0" + "version": "3.7.3" } }, "nbformat": 4,