From 657dd08b53fdbe954f9c9bfb041b447760e86643 Mon Sep 17 00:00:00 2001 From: virio-andreyana Date: Wed, 2 Aug 2023 11:11:41 +0200 Subject: [PATCH] edit configtables and accept Fneum suggestion --- config/config.default.yaml | 1 + doc/configtables/conventional.csv | 6 ++---- doc/configtables/hydro.csv | 3 ++- doc/configtables/solving.csv | 6 +++--- doc/configtables/toplevel.csv | 6 +++--- scripts/add_electricity.py | 4 +--- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 402a0918..28eb0f0b 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -218,6 +218,7 @@ renewable: PHS_max_hours: 6 hydro_max_hours: "energy_capacity_totals_by_country" # one of energy_capacity_totals_by_country, estimate_by_large_installations or a float flatten_dispatch: false + flatten_dispatch_buffer: 0.2 clip_min_inflow: 1.0 # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#conventional diff --git a/doc/configtables/conventional.csv b/doc/configtables/conventional.csv index 0fee041d..12902f53 100644 --- a/doc/configtables/conventional.csv +++ b/doc/configtables/conventional.csv @@ -1,7 +1,5 @@ ,Unit,Values,Description -{name},--,string,For any carrier/technology overwrite attributes as listed below. --- {attribute},--,string or float,"For any attribute, can specify a float or reference to a file path to a CSV file giving floats for each country (2-letter code)." unit_commitment ,bool,"{true, false}","Allow the overwrite of ramp_limit_up, ramp_limit_start_up, ramp_limit_shut_down, p_min_pu, min_up_time, min_down_time, and start_up_cost of conventional generators. Refer to the CSV file „unit_commitment.csv“." dynamic_fuel_price ,bool,"{true, false}","Consider the monthly fluctuating fuel prices for each conventional generator. Refer to the CSV file ""data/validation/monthly_fuel_price.csv""." -nuclear ,,, --- p_max_pu,--,string or float ,Specify a float or reference to a file path to a CSV file the maximum dispatch for nuclear power plants in each country (2-letter code) +{name},--,string,For any carrier/technology overwrite attributes as listed below. +-- {attribute},--,string or float,"For any attribute, can specify a float or reference to a file path to a CSV file giving floats for each country (2-letter code)." diff --git a/doc/configtables/hydro.csv b/doc/configtables/hydro.csv index 353036a1..4544d110 100644 --- a/doc/configtables/hydro.csv +++ b/doc/configtables/hydro.csv @@ -3,5 +3,6 @@ cutout,--,Must be 'europe-2013-era5',Specifies the directory where the relevant carriers,--,"Any subset of {'ror', 'PHS', 'hydro'}","Specifies the types of hydro power plants to build per-unit availability time series for. 'ror' stands for run-of-river plants, 'PHS' represents pumped-hydro storage, and 'hydro' stands for hydroelectric dams." PHS_max_hours,h,float,Maximum state of charge capacity of the pumped-hydro storage (PHS) in terms of hours at full output capacity ``p_nom``. Cf. `PyPSA documentation `_. hydro_max_hours,h,"Any of {float, 'energy_capacity_totals_by_country', 'estimate_by_large_installations'}",Maximum state of charge capacity of the pumped-hydro storage (PHS) in terms of hours at full output capacity ``p_nom`` or heuristically determined. Cf. `PyPSA documentation `_. -flatten_dispatch,bool or float,"{true, false, float}","Enables the flattening of the hydro-dispatch. If bool is specified, it represents the buffer value where the maximum hydro dispatch is equal to the average capacity factor plus the buffer with a maximum value of 1. If true is specified, the buffer value is 0.2. Otherwise, the maximum hydro dispatch remains equal to 1." +flatten_dispatch,bool,"{true, false}",Consider an upper limit for the hydro dispatch. The limit is given by the average capacity factor plus the buffer given in ``flatten_dispatch_buffer`` +flatten_dispatch_buffer,--,float,"If ``flatten_dispatch`` is true, specify the value added above the average capacity factor." clip_min_inflow,MW,float,"To avoid too small values in the inflow time series, values below this threshold are set to zero." diff --git a/doc/configtables/solving.csv b/doc/configtables/solving.csv index d1806083..45d50d84 100644 --- a/doc/configtables/solving.csv +++ b/doc/configtables/solving.csv @@ -4,14 +4,14 @@ options,,, -- 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." -- 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'}", +-- rolling_horizon,bool,"{'true','false'}","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." -- seed,--,int,Random seed for increased deterministic behaviour. -- track_iterations,bool,"{'true','false'}",Flag whether to store the intermediate branch capacities and objective function values are recorded for each iteration in ``network.lines['s_nom_opt_X']`` (where ``X`` labels the iteration) -- min_iterations,--,int,Minimum number of solving iterations in between which resistance and reactence (``x/r``) are updated for branches according to ``s_nom_opt`` of the previous run. -- max_iterations,--,int,Maximum number of solving iterations in between which resistance and reactence (``x/r``) are updated for branches according to ``s_nom_opt`` of the previous run. -- transmission_losses,int,[0-9],"Add piecewise linear approximation of transmission losses based on n tangents. Defaults to 0, which means losses are ignored." --- linearized_unit_commitment,bool,"{'true','false'}", --- horizon,--,int, +-- linearized_unit_commitment,bool,"{'true','false'}",Whether to optimise using the linearized unit commitment formulation. +-- horizon,--,int,Number of snapshots to consider in each iteration. Defaults to 100. solver,,, -- name,--,"One of {'gurobi', 'cplex', 'cbc', 'glpk', 'ipopt'}; potentially more possible",Solver to use for optimisation problems in the workflow; e.g. clustering and linear optimal power flow. -- options,--,Key listed under ``solver_options``.,Link to specific parameter settings. diff --git a/doc/configtables/toplevel.csv b/doc/configtables/toplevel.csv index 71b43075..67954389 100644 --- a/doc/configtables/toplevel.csv +++ b/doc/configtables/toplevel.csv @@ -6,7 +6,7 @@ logging,,, -- format,--,,Custom format for log messages. See `LogRecord `_ attributes. private,,, -- keys,,, --- -- entsoe_api,--,,Specify the ENTSO-E API key. See the guidelines to get `ENTSO-E API key `_ +-- -- entsoe_api,--,,Optionally specify the ENTSO-E API key. See the guidelines to get `ENTSO-E API key `_ remote,,, --- ssh,--,,Specify the SSH of a remote cluster to be synchronized. --- path,--,,Specify the file path within the remote cluster to be synchronized. +-- ssh,--,,Optionally specify the SSH of a remote cluster to be synchronized. +-- path,--,,Optionally specify the file path within the remote cluster to be synchronized. diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index 82e9fc94..716d6dcc 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -619,9 +619,7 @@ def attach_hydro(n, costs, ppl, profile_hydro, hydro_capacities, carriers, **par flatten_dispatch = params.get("flatten_dispatch", False) if flatten_dispatch: - buffer = ( - flatten_dispatch if isinstance(flatten_dispatch, (int, float)) else 0.2 - ) + buffer = params.get("flatten_dispatch_buffer", 0.2) average_capacity_factor = inflow_t[hydro.index].mean() / hydro["p_nom"] p_max_pu = (average_capacity_factor + buffer).clip(upper=1) else: