diff --git a/config.default.yaml b/config.default.yaml index b039c047..375bcda6 100755 --- a/config.default.yaml +++ b/config.default.yaml @@ -179,7 +179,7 @@ costs: hydro: 0. H2: 0. battery: 0. - emission_prices: # only used with the option Ep + emission_prices: # in currency per tonne emission, only used with the option Ep co2: 0. solving: diff --git a/config.tutorial.yaml b/config.tutorial.yaml index f199424d..f77ad2bd 100755 --- a/config.tutorial.yaml +++ b/config.tutorial.yaml @@ -156,7 +156,7 @@ costs: offwind: 0.015 H2: 0. battery: 0. - emission_prices: # only used with the option Ep + emission_prices: # in currency per tonne emission, only used with the option Ep co2: 0. solving: diff --git a/doc/release_notes.rst b/doc/release_notes.rst index a30aa02b..b5855691 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -21,6 +21,8 @@ Upcoming Release * Added Google Cloud Platform tutorial (for Windows users). +* Corrected setting of exogenous emission price (in config -> cost -> emission price). This was not weighted by the efficiency and effective emission of the generators. Fixed in `#171 `_. + PyPSA-Eur 0.2.0 (8th June 2020) ================================== diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index 994b9d6b..67d134f4 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -7,7 +7,7 @@ Prepare PyPSA network for solving according to :ref:`opts` and :ref:`ll`, such as - adding an annual **limit** of carbon-dioxide emissions, -- adding an exogenous **price** of carbon-dioxide emissions (or other kinds), +- adding an exogenous **price** per tonne emissions of carbon-dioxide (or other kinds), - setting an **N-1 security margin** factor for transmission line capacities, - specifying a limit on the **cost** of transmission expansion, - specifying a limit on the **volume** of transmission expansion, and @@ -85,8 +85,10 @@ def add_emission_prices(n, emission_prices=None, exclude_co2=False): if exclude_co2: emission_prices.pop('co2') ep = (pd.Series(emission_prices).rename(lambda x: x+'_emissions') * n.carriers.filter(like='_emissions')).sum(axis=1) - n.generators['marginal_cost'] += n.generators.carrier.map(ep) - n.storage_units['marginal_cost'] += n.storage_units.carrier.map(ep) + gen_ep = n.generators.carrier.map(ep) / n.generators.efficiency + n.generators['marginal_cost'] += gen_ep + su_ep = n.storage_units.carrier.map(ep) / n.storage_units.efficiency_dispatch + n.storage_units['marginal_cost'] += su_ep def set_line_s_max_pu(n): # set n-1 security margin to 0.5 for 37 clusters and to 0.7 from 200 clusters