aggregate curtailment into single curtailment generator per bus (#1177)

* add curtailment generator mode

* add documentation
This commit is contained in:
Fabian Neumann 2024-07-24 10:54:15 +02:00 committed by GitHub
parent f11f8d8613
commit d142d5a50b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 26 additions and 2 deletions

View File

@ -786,6 +786,7 @@ solving:
options:
clip_p_max_pu: 1.e-2
load_shedding: false
curtailment_mode: false
noisy_costs: true
skip_iterations: true
rolling_horizon: false
@ -830,7 +831,7 @@ solving:
solver_options:
highs-default:
# refer to https://ergo-code.github.io/HiGHS/dev/options/definitions/
threads: 4
threads: 1
solver: "ipm"
run_crossover: "off"
small_matrix_value: 1e-6
@ -841,7 +842,7 @@ solving:
parallel: "on"
random_seed: 123
gurobi-default:
threads: 4
threads: 8
method: 2 # barrier
crossover: 0
BarConvTol: 1.e-6

View File

@ -2,6 +2,7 @@
options,,,
-- clip_p_max_pu,p.u.,float,To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero.
-- load_shedding,bool/float,"{'true','false', float}","Add generators with very high marginal cost to simulate load shedding and avoid problem infeasibilities. If load shedding is a float, it denotes the marginal cost in EUR/kWh."
-- curtailment_mode,bool/float,"{'true','false'}","Fixes the dispatch profiles of generators with time-varying p_max_pu by setting ``p_min_pu = p_max_pu`` and adds an auxiliary curtailment generator (with negative sign to absorb excess power) at every AC bus. This can speed up the solving process as the curtailment decision is aggregated into a single generator per region. Defaults to ``false``."
-- noisy_costs,bool,"{'true','false'}","Add random noise to marginal cost of generators by :math:`\mathcal{U}(0.009,0,011)` and capital cost of lines and links by :math:`\mathcal{U}(0.09,0,11)`."
-- skip_iterations,bool,"{'true','false'}","Skip iterating, do not update impedances of branches. Defaults to true."
-- rolling_horizon,bool,"{'true','false'}","Switch for rule :mod:`solve_operations_network` whether to optimize the network in a rolling horizon manner, where the snapshot range is split into slices of size `horizon` which are solved consecutively. This setting has currently no effect on sector-coupled networks."

1 Unit Values Description
2 options
3 -- clip_p_max_pu p.u. float To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero.
4 -- load_shedding bool/float {'true','false', float} Add generators with very high marginal cost to simulate load shedding and avoid problem infeasibilities. If load shedding is a float, it denotes the marginal cost in EUR/kWh.
5 -- curtailment_mode bool/float {'true','false'} Fixes the dispatch profiles of generators with time-varying p_max_pu by setting ``p_min_pu = p_max_pu`` and adds an auxiliary curtailment generator (with negative sign to absorb excess power) at every AC bus. This can speed up the solving process as the curtailment decision is aggregated into a single generator per region. Defaults to ``false``.
6 -- noisy_costs bool {'true','false'} Add random noise to marginal cost of generators by :math:`\mathcal{U}(0.009,0,011)` and capital cost of lines and links by :math:`\mathcal{U}(0.09,0,11)`.
7 -- skip_iterations bool {'true','false'} Skip iterating, do not update impedances of branches. Defaults to true.
8 -- rolling_horizon bool {'true','false'} Switch for rule :mod:`solve_operations_network` whether to optimize the network in a rolling horizon manner, where the snapshot range is split into slices of size `horizon` which are solved consecutively. This setting has currently no effect on sector-coupled networks.

View File

@ -41,6 +41,12 @@ Upcoming Release
* Enable parallelism in :mod:`determine_availability_matrix_MD_UA.py` and remove plots. This requires the use of temporary files.
* Added option ``solving: curtailment_mode``` which fixes the dispatch profiles
of generators with time-varying p_max_pu by setting ``p_min_pu = p_max_pu``
and adds an auxiliary curtailment generator with negative sign (to absorb
excess power) at every AC bus. This can speed up the solving process as the
curtailment decision is aggregated into a single generator per region.
PyPSA-Eur 0.11.0 (25th May 2024)
=====================================

View File

@ -471,6 +471,22 @@ def prepare_network(
p_nom=1e9, # kW
)
if solve_opts.get("curtailment_mode"):
n.add("Carrier", "curtailment", color="#fedfed", nice_name="Curtailment")
n.generators_t.p_min_pu = n.generators_t.p_max_pu
buses_i = n.buses.query("carrier == 'AC'").index
n.madd(
"Generator",
buses_i,
suffix=" curtailment",
bus=buses_i,
p_min_pu=-1,
p_max_pu=0,
marginal_cost=-0.1,
carrier="curtailment",
p_nom=1e6,
)
if solve_opts.get("noisy_costs"):
for t in n.iterate_components():
# if 'capital_cost' in t.df: