diff --git a/doc/release_notes.rst b/doc/release_notes.rst index e35d3cf6..af9a58f6 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -26,6 +26,8 @@ Upcoming Release * Bugfix in :mod:`build_renewable_profile` where offshore wind profiles could no longer be created [`#249 `_]. * Implements changes to ``n.snapshot_weightings`` in upcoming PyPSA version (cf. `PyPSA/PyPSA/#227 `_) [`#259 `_]. * Bugfix: Lower expansion limit of extendable carriers is now set to the existing capacity, i.e. ``p_nom_min = p_nom`` (0 before). Simultaneously, the upper limit (``p_nom_max``) is now the maximum of the installed capacity (``p_nom``) and the previous estimate based on land availability (``p_nom_max``) [`#260 `_]. +* Bugfix: Solving an operations network now includes optimized store capacities as well. Before only lines, links, generators and storage units were considered. +* Bugfix: With ``load_shedding: true`` in the solving options of ``config.yaml`` load shedding generators are only added at the AC buses, excluding buses for H2 and battery stores. PyPSA-Eur 0.3.0 (7th December 2020) ================================== diff --git a/scripts/solve_network.py b/scripts/solve_network.py index f8146b43..d874d335 100755 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -101,8 +101,9 @@ def prepare_network(n, solve_opts): if solve_opts.get('load_shedding'): n.add("Carrier", "Load") - n.madd("Generator", n.buses.index, " load", - bus=n.buses.index, + buses_i = n.buses.query("carrier == 'AC'").index + n.madd("Generator", buses_i, " load", + bus=buses_i, carrier='load', sign=1e-3, # Adjust sign to measure p and p_nom in kW instead of MW marginal_cost=1e2, # Eur/kWh diff --git a/scripts/solve_operations_network.py b/scripts/solve_operations_network.py index b698c2f1..9f97754a 100644 --- a/scripts/solve_operations_network.py +++ b/scripts/solve_operations_network.py @@ -81,10 +81,15 @@ def set_parameters_from_optimized(n, n_optim): n_optim.generators['p_nom_opt'].reindex(gen_extend_i, fill_value=0.) n.generators.loc[gen_extend_i, 'p_nom_extendable'] = False - stor_extend_i = n.storage_units.index[n.storage_units.p_nom_extendable] - n.storage_units.loc[stor_extend_i, 'p_nom'] = \ - n_optim.storage_units['p_nom_opt'].reindex(stor_extend_i, fill_value=0.) - n.storage_units.loc[stor_extend_i, 'p_nom_extendable'] = False + stor_units_extend_i = n.storage_units.index[n.storage_units.p_nom_extendable] + n.storage_units.loc[stor_units_extend_i, 'p_nom'] = \ + n_optim.storage_units['p_nom_opt'].reindex(stor_units_extend_i, fill_value=0.) + n.storage_units.loc[stor_units_extend_i, 'p_nom_extendable'] = False + + stor_extend_i = n.stores.index[n.stores.e_nom_extendable] + n.stores.loc[stor_extend_i, 'e_nom'] = \ + n_optim.stores['e_nom_opt'].reindex(stor_extend_i, fill_value=0.) + n.stores.loc[stor_extend_i, 'e_nom_extendable'] = False return n