From 3a6a1f90abb049f393e90af4e623d095d80c8e12 Mon Sep 17 00:00:00 2001 From: martavp <30744159+martavp@users.noreply.github.com> Date: Tue, 6 Jul 2021 17:12:39 +0200 Subject: [PATCH] Sensitivity e nom max (#143) * Update .gitignore * include e_nom_max sensitivity * remove change in gitignore * Update doc/release_notes.rst Co-authored-by: Fabian Neumann --- config.default.yaml | 1 + doc/release_notes.rst | 2 ++ scripts/prepare_sector_network.py | 9 +++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config.default.yaml b/config.default.yaml index 5f1fa1b8..457c3660 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -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 diff --git a/doc/release_notes.rst b/doc/release_notes.rst index bd99ce16..88d09bcb 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -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) =================================== diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index fa485e6a..82e15e60 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -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")