diff --git a/config/config.default.yaml b/config/config.default.yaml index d1d13065..ab5bb043 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -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 diff --git a/doc/configtables/solving.csv b/doc/configtables/solving.csv index 4cfb9065..d2e22c28 100644 --- a/doc/configtables/solving.csv +++ b/doc/configtables/solving.csv @@ -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." diff --git a/doc/release_notes.rst b/doc/release_notes.rst index eb29ce4b..c38888a0 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -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) ===================================== diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 42ffe6be..a2391ea2 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -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: