Skip to content

Commit

Permalink
Sensitivity e nom max (#143)
Browse files Browse the repository at this point in the history
* Update .gitignore

* include e_nom_max sensitivity

* remove change in gitignore

* Update doc/release_notes.rst

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
  • Loading branch information
martavp and fneum authored Jul 6, 2021
1 parent b2872cc commit 3a6a1f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ scenario:
# B for biomass supply, I for industry, shipping and aviation
# solar+c0.5 reduces the capital cost of solar to 50\% of reference value
# solar+p3 multiplies the available installable potential by factor 3
# co2 stored+e2 multiplies the potential of CO2 sequestration by a factor 2
# dist{n} includes distribution grids with investment cost of n times cost in data/costs.csv
# for myopic/perfect foresight cb states the carbon budget in GtCO2 (cumulative
# emissions throughout the transition path in the timeframe determined by the
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Future release
* Distinguish costs for home battery storage and inverter from utility-scale battery costs.


* Include the option to alter the maximum energy capacity of a store via the ``carrier+factor`` in the ``{sector_opts}`` wildcard. This can be useful for sensitivity analyses. Example: ``co2 stored+e2`` multiplies the ``e_nom_max`` by factor 2. In this example, ``e_nom_max`` represents the CO2 sequestration potential in Europe.


PyPSA-Eur-Sec 0.5.0 (21st May 2021)
===================================
Expand Down
9 changes: 7 additions & 2 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1925,14 +1925,19 @@ def maybe_adjust_costs_and_potentials(n, opts):
suptechs = map(lambda c: c.split("-", 2)[0], carrier_list)
if oo[0].startswith(tuple(suptechs)):
carrier = oo[0]
attr_lookup = {"p": "p_nom_max", "c": "capital_cost"}
attr_lookup = {"p": "p_nom_max", "e": "e_nom_max", "c": "capital_cost"}
attr = attr_lookup[oo[1][0]]
factor = float(oo[1][1:])
#beware if factor is 0 and p_nom_max is np.inf, 0*np.inf is nan
if carrier == "AC": # lines do not have carrier
n.lines[attr] *= factor
else:
comps = {"Generator", "Link", "StorageUnit"} if attr == 'p_nom_max' else {"Generator", "Link", "StorageUnit", "Store"}
if attr == 'p_nom_max':
comps = {"Generator", "Link", "StorageUnit"}
elif attr = 'e_nom_max':
comps = {"Store"}
else:
comps = {"Generator", "Link", "StorageUnit", "Store"}
for c in n.iterate_components(comps):
if carrier=='solar':
sel = c.df.carrier.str.contains(carrier) & ~c.df.carrier.str.contains("solar rooftop")
Expand Down

0 comments on commit 3a6a1f9

Please sign in to comment.