From 03170f4aaf50e78929c9db56e5a84cab1ce48619 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 26 Nov 2020 17:25:14 +0100 Subject: [PATCH] add option for p_nom_max factors in {opts} wildcard (#207) * prepare: add option for potential reduction sweeps * prepare: fix attr lookup for potential/cost reduction sweeps * prepare: fix attr naming cost -> capital_cost * add release notes --- doc/configtables/opts.csv | 2 +- doc/release_notes.rst | 5 ++++- scripts/prepare_network.py | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/configtables/opts.csv b/doc/configtables/opts.csv index e43528fe..55a9c471 100644 --- a/doc/configtables/opts.csv +++ b/doc/configtables/opts.csv @@ -7,4 +7,4 @@ Trigger, Description, Definition, Status ``ATK``, "Require each node to be autarkic. Example: ``ATK`` removes all lines and links. ``ATKc`` removes all cross-border lines and links.", ``prepare_network``, In active use ``BAU``, Add a per-``carrier`` minimal overall capacity; i.e. at least ``40GW`` of ``OCGT`` in Europe; configured in ``electricity: BAU_mincapacities``, ``solve_network``: `add_opts_constraints() `_, Untested ``SAFE``, Add a capacity reserve margin of a certain fraction above the peak demand to which renewable generators and storage do *not* contribute. Ignores network., ``solve_network`` `add_opts_constraints() `_, Untested -``carrier+factor``, "Alter the capital cost of a carrier by a factor. Example: ``solar+0.5`` reduces the capital cost of solar to 50\% of original values.", ``prepare_network``, In active use \ No newline at end of file +``carrier+{c|p}factor``, "Alter the capital cost (``c``) or installable potential (``p``) of a carrier by a factor. Example: ``solar+c0.5`` reduces the capital cost of solar to 50\% of original values.", ``prepare_network``, In active use \ No newline at end of file diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 90c04f08..e5a773c5 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -17,7 +17,10 @@ Upcoming Release cross-border transfer capacities. Moreover, line and link capacities can be capped in the ``config.yaml`` at ``lines: s_nom_max:`` and ``links: p_nom_max`` (`#166 `_). -* Added an option to alter the capital cost of carriers by a factor via ``carrier+factor`` in the ``{opts}`` wildcard. This can be useful for exploring uncertain cost parameters. Example: ``solar+0.5`` reduces the capital cost of solar to 50% of original values (`#167 `_). +* Added an option to alter the capital cost (``c``) or installable potentials (``p``) of carriers by a factor via ``carrier+{c,p}factor`` in the ``{opts}`` wildcard. + This can be useful for exploring uncertain cost parameters. + Example: ``solar+c0.5`` reduces the capital cost of solar to 50% of original values + (`#167 `_ and `#207 `_). * Add compatibility for pyomo 5.7.0 in :mod:`cluster_network` and :mod:`simplify_network`. diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index ba6bb9e2..fe88f457 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -205,14 +205,17 @@ if __name__ == "__main__": suptechs = map(lambda c: c.split("-", 2)[0], n.carriers.index) if oo[0].startswith(tuple(suptechs)): carrier = oo[0] - cost_factor = float(oo[1]) + # handles only p_nom_max as stores and lines have no potentials + attr_lookup = {"p": "p_nom_max", "c": "capital_cost"} + attr = attr_lookup[oo[1][0]] + factor = float(oo[1][1:]) if carrier == "AC": # lines do not have carrier - n.lines.capital_cost *= cost_factor + n.lines[attr] *= factor else: - comps = {"Generator", "Link", "StorageUnit"} + comps = {"Generator", "Link", "StorageUnit", "Store"} for c in n.iterate_components(comps): sel = c.df.carrier.str.contains(carrier) - c.df.loc[sel,"capital_cost"] *= cost_factor + c.df.loc[sel,attr] *= factor if 'Ep' in opts: add_emission_prices(n)