Configuration
PyPSA-RSA has several configuration options which are documented in this section and are collected in a config.yaml file located in the root directory.
Users should copy the provided default configuration (config.default.yaml) and amend their own modifications and assumptions in the user-specific
configuration file (config.yaml); confer installation instructions at Set Up the Default Configuration.
Top-level configuration
PyPSA-RSA imports the configuration options originally developed in PyPSA-Eur and here reported and adapted.
The options here described are collected in a config.yaml file located in the root directory.
Users should copy the provided default configuration (config.default.yaml) and amend
their own modifications and assumptions in the user-specific configuration file (config.yaml);
confer installation instructions at Set Up the Default Configuration.
Note
Credits to PyPSA-Eur and PyPSA-meets-Earth developers for the initial drafting of the configuration documentation here reported
Top-level configuration
scenario
It is common conduct to analysis of energy system optimisation models for multiple scenarios for a variety of reasons, e.g. assessing their sensitivity towards changing the temporal and/or geographical resolution or investigating how investment changes as more ambitious greenhouse-gas emission reduction targets are applied.
The scenario section is an extraordinary section of the config file
that is strongly connected to the Wildcards and is designed to
facilitate running multiple scenarios through a single command
snakemake -j 1 solve_all_networks
For each wildcard, a list of values is provided. The rule solve_all_networks will trigger the rules for creating results/networks/solved_{model_file}_{regions}_{resarea}_l{ll}_{opts}.nc for all combinations of the provided wildcard values as defined by Python’s itertools.product(…) function that snakemake’s expand(…) function uses.
An exemplary dependency graph (starting from the simplification rules) then looks like this:
Unit |
Values |
Description |
|
|---|---|---|---|
resarea |
– |
List of |
|
regions |
– |
List of |
|
model_file |
– |
List of |
|
ll |
– |
List of |
|
opts |
– |
List of |
snapshots- now specified in model_file.xlsx
Specifies the temporal range to build an energy system model for as arguments to pandas.date_range
electricity
Unit |
Values |
Description |
|
|---|---|---|---|
voltages |
kV |
Any subset of {220., 300., 380.} |
Voltage levels to consider |
gaslimit |
MWhth |
float or false |
Global gas usage limit |
co2limit |
\(t_{CO_2-eq}/a\) |
float |
Cap on total annual system carbon dioxide emissions |
co2base |
\(t_{CO_2-eq}/a\) |
float |
Reference value of total annual system carbon dioxide emissions if relative emission reduction target is specified in |
agg_p_nom_limits |
file |
path |
Reference to |
operational_reserve |
Settings for reserve requirements following like GenX |
||
– activate |
bool |
true or false |
Whether to take operational reserve requirements into account during optimisation |
– epsilon_load |
– |
float |
share of total load |
– epsilon_vres |
– |
float |
share of total renewable supply |
– contingency |
MW |
float |
fixed reserve capacity |
max_hours |
|||
– battery |
h |
float |
Maximum state of charge capacity of the battery in terms of hours at full output capacity |
– H2 |
h |
float |
Maximum state of charge capacity of the hydrogen storage in terms of hours at full output capacity |
extendable_carriers |
|||
– Generator |
– |
Any extendable carrier |
Defines existing or non-existing conventional and renewable power plants to be extendable during the optimization. Conventional generators can only be built/expanded where already existent today. If a listed conventional carrier is not included in the |
– StorageUnit |
– |
Any subset of {‘battery’,’H2’} |
Adds extendable storage units (battery and/or hydrogen) at every node/bus after clustering without capacity limits and with zero initial capacity. |
– Store |
– |
Any subset of {‘battery’,’H2’} |
Adds extendable storage units (battery and/or hydrogen) at every node/bus after clustering without capacity limits and with zero initial capacity. |
– Link |
– |
Any subset of {‘H2 pipeline’} |
Adds extendable links (H2 pipelines only) at every connection where there are lines or HVDC links without capacity limits and with zero initial capacity. Hydrogen pipelines require hydrogen storage to be modelled as |
powerplants_filter |
– |
use pandas.query strings here, e.g. Country not in [‘Germany’] |
Filter query for the default powerplant database. |
custom_powerplants |
– |
use pandas.query strings here, e.g. Country in [‘Germany’] |
Filter query for the custom powerplant database. |
conventional_carriers |
– |
Any subset of {nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass} |
List of conventional power plants to include in the model from |
renewable_carriers |
– |
Any subset of {solar, onwind, offwind-ac, offwind-dc, hydro} |
List of renewable generators to include in the model. |
estimate_renewable_capacities |
|||
– enable |
bool |
Activate routine to estimate renewable capacities |
|
– from_opsd |
– |
bool |
Add capacities from OPSD data |
– year |
– |
bool |
Renewable capacities are based on existing capacities reported by IRENA for the specified year |
– expansion_limit |
– |
float or false |
Artificially limit maximum capacities to factor * (IRENA capacities), i.e. 110% of <years>’s capacities => expansion_limit: 1.1 false: Use estimated renewable potentials determine by the workflow |
– technology_mapping |
Mapping between powerplantmatching and PyPSA-Eur technology names |
Warning
Carriers in conventional_carriers must not also be in extendable_carriers.
atlite
Define and specify the atlite.Cutout used for calculating renewable potentials and time-series. All options except for features are directly used as cutout parameters.
Unit |
Values |
Description |
|
|---|---|---|---|
nprocesses |
– |
int |
Number of parallel processes in cutout preparation |
cutouts |
|||
– {name} |
– |
Convention is to name cutouts like |
Name of the cutout netcdf file. The user may specify multiple cutouts under configuration |
– – module |
– |
Subset of {‘era5’,’sarah’} |
Source of the reanalysis weather dataset (e.g. ERA5 or SARAH-2) |
– – x |
° |
Float interval within [-180, 180] |
Range of longitudes to download weather data for. If not defined, it defaults to the spatial bounds of all bus shapes. |
– – y |
° |
Float interval within [-90, 90] |
Range of latitudes to download weather data for. If not defined, it defaults to the spatial bounds of all bus shapes. |
– – time |
Time interval within [‘1979’, ‘2018’] (with valid pandas date time strings) |
Time span to download weather data for. If not defined, it defaults to the time interval spanned by the snapshots. |
|
– – features |
String or list of strings with valid cutout features (‘inlfux’, ‘wind’). |
When freshly building a cutout, retrieve data only for those features. If not defined, it defaults to all available features. |
renewable
onwind
Unit |
Values |
Description |
|
|---|---|---|---|
cutout |
– |
Should be a folder listed in the configuration |
Specifies the directory where the relevant weather data ist stored. |
resource |
|||
– method |
– |
Must be ‘wind’ |
A superordinate technology type. |
– turbine |
– |
One of turbine types included in atlite |
Specifies the turbine type and its characteristic power curve. |
capacity_per_sqkm |
\(MW/km^2\) |
float |
Allowable density of wind turbine placement. |
corine |
|||
– grid_codes |
– |
Any subset of the CORINE Land Cover code list |
Specifies areas according to CORINE Land Cover codes which are generally eligible for wind turbine placement. |
– distance |
m |
float |
Distance to keep from areas specified in |
– distance_grid_codes |
– |
Any subset of the CORINE Land Cover code list |
Specifies areas according to CORINE Land Cover codes to which wind turbines must maintain a distance specified in the setting |
natura |
bool |
{true, false} |
Switch to exclude Natura 2000 natural protection areas. Area is excluded if |
potential |
– |
One of {‘simple’, ‘conservative’} |
Method to compute the maximal installable potential for a node; confer renewableprofiles |
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. |
solar
Unit |
Values |
Description |
|
|---|---|---|---|
cutout |
– |
Should be a folder listed in the configuration |
Specifies the directory where the relevant weather data ist stored that is specified at |
resource |
|||
– method |
– |
Must be ‘pv’ |
A superordinate technology type. |
– panel |
– |
One of {‘Csi’, ‘CdTe’, ‘KANENA’} as defined in atlite |
Specifies the solar panel technology and its characteristic attributes. |
– orientation |
|||
– – slope |
° |
Realistically any angle in [0., 90.] |
Specifies the tilt angle (or slope) of the solar panel. A slope of zero corresponds to the face of the panel aiming directly overhead. A positive tilt angle steers the panel towards the equator. |
– – azimuth |
° |
Any angle in [0., 360.] |
Specifies the azimuth orientation of the solar panel. South corresponds to 180.°. |
capacity_per_sqkm |
\(MW/km^2\) |
float |
Allowable density of solar panel placement. |
correction_factor |
– |
float |
A correction factor for the capacity factor (availability) time series. |
corine |
– |
Any subset of the CORINE Land Cover code list |
Specifies areas according to CORINE Land Cover codes which are generally eligible for solar panel placement. |
natura |
bool |
{true, false} |
Switch to exclude Natura 2000 natural protection areas. Area is excluded if |
potential |
– |
One of {‘simple’, ‘conservative’} |
Method to compute the maximal installable potential for a node; confer renewableprofiles |
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. |
hydro
Unit |
Values |
Description |
|
|---|---|---|---|
cutout |
– |
Must be ‘RSA-2013-era5’ |
Specifies the directory where the relevant weather data ist stored. |
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 |
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 |
clip_min_inflow |
MW |
float |
To avoid too small values in the inflow time series, values below this threshold are set to zero. |
lines
Unit |
Values |
Description |
|
|---|---|---|---|
types |
– |
Values should specify a line type in PyPSA. Keys should specify the corresponding voltage level (e.g. 220., 300. and 380. kV) |
Specifies line types to assume for the different voltage levels of the ENTSO-E grid extraction. Should normally handle voltage levels 220, 300, and 380 kV |
s_max_pu |
– |
Value in [0.,1.] |
Correction factor for line capacities ( |
s_nom_max |
MW |
float |
Global upper limit for the maximum capacity of each extendable line. |
length_factor |
– |
float |
Correction factor to account for the fact that buses are not connected by lines through air-line distance. |
under_construction |
– |
One of {‘zero’: set capacity to zero, ‘remove’: remove completely, ‘keep’: keep with full capacity} |
Specifies how to handle lines which are currently under construction. |
links
Unit |
Values |
Description |
|
|---|---|---|---|
p_max_pu |
– |
Value in [0.,1.] |
Correction factor for link capacities |
p_nom_max |
MW |
float |
Global upper limit for the maximum capacity of each extendable DC link. |
include_tyndp |
bool |
{‘true’, ‘false’} |
Specifies whether to add HVDC link projects from the TYNDP 2018 which are at least in permitting. |
under_construction |
– |
One of {‘zero’: set capacity to zero, ‘remove’: remove completely, ‘keep’: keep with full capacity} |
Specifies how to handle lines which are currently under construction. |
costs
Unit |
Values |
Description |
|
|---|---|---|---|
year |
– |
YYYY; e.g. ‘2030’ |
Year for which to retrieve cost assumptions of |
version |
– |
vX.X.X; e.g. ‘v0.1.0’ |
Version of |
rooftop_share |
– |
float |
Share of rooftop PV when calculating capital cost of solar (joint rooftop and utility-scale PV). |
fill_values |
– |
float |
Default values if not specified for a technology in |
capital_cost |
EUR/MW |
Keys should be in the ‘technology’ column of |
For the given technologies, assumptions about their capital investment costs are set to the corresponding value. Optional; overwrites cost assumptions from |
marginal_cost |
EUR/MWh |
Keys should be in the ‘technology’ column of |
For the given technologies, assumptions about their marginal operating costs are set to the corresponding value. Optional; overwrites cost assumptions from |
emission_prices |
Specify exogenous prices for emission types listed in |
||
– co2 |
EUR/t |
float |
Exogenous price of carbon-dioxide added to the marginal costs of fossil-fuelled generators according to their carbon intensity. Added through the keyword |
Note
To change cost assumptions in more detail (i.e. other than marginal_cost and capital_cost), consider modifying cost assumptions directly in data/costs.csv as this is not yet supported through the config file.
You can also build multiple different cost databases. Make a renamed copy of data/costs.csv (e.g. data/costs-optimistic.csv) and set the variable COSTS=data/costs-optimistic.csv in the Snakefile.
solving
options
Unit |
Values |
Description |
|
|---|---|---|---|
formulation |
– |
Any of {‘angles’, ‘kirchhoff’, ‘cycles’, ‘ptdf’} |
Specifies which variant of linearized power flow formulations to use in the optimisation problem. Recommended is ‘kirchhoff’. Explained in this article. |
load_shedding |
bool |
{‘true’,’false’} |
Add generators with a prohibitively high marginal cost to simulate load shedding and avoid problem infeasibilities. |
noisy_costs |
bool |
{‘true’,’false’} |
Add random noise to marginal cost of generators by \(\mathcal{U}(0.009,0,011)\) and capital cost of lines and links by \(\mathcal{U}(0.09,0,11)\). |
min_iterations |
– |
int |
Minimum number of solving iterations in between which resistance and reactence ( |
max_iterations |
– |
int |
Maximum number of solving iterations in between which resistance and reactence ( |
nhours |
– |
int |
Specifies the \(n\) first snapshots to take into account. Must be less than the total number of snapshots. Rather recommended only for debugging. |
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. |
skip_iterations |
bool |
{‘true’,’false’} |
Skip iterating, do not update impedances of branches. |
track_iterations |
bool |
{‘true’,’false’} |
Flag whether to store the intermediate branch capacities and objective function values are recorded for each iteration in |
solver
Unit |
Values |
Description |
|
|---|---|---|---|
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. |
opts |
– |
Solver specific parameter settings. |
plotting
Unit |
Values |
Description |
|
|---|---|---|---|
map |
|||
– figsize |
– |
[width, height]; e.g. [7,7] |
Figure size in inches. |
– boundaries |
° |
[x1,x2,y1,y2] |
Boundaries of the map plots in degrees latitude (y) and longitude (x) |
– p_nom |
|||
– – bus_size_factor |
– |
float |
Factor by which values determining bus sizes are scaled to fit well in the plot. |
– – linewidth_factor |
– |
float |
Factor by which values determining bus sizes are scaled to fit well in the plot. |
costs_max |
bn Euro |
float |
Upper y-axis limit in cost bar plots. |
costs_threshold |
bn Euro |
float |
Threshold below which technologies will not be shown in cost bar plots. |
energy_max |
TWh |
float |
Upper y-axis limit in energy bar plots. |
energy_min |
TWh |
float |
Lower y-axis limit in energy bar plots. |
energy_threshold |
TWh |
float |
Threshold below which technologies will not be shown in energy bar plots. |
tech_colors |
– |
carrier -> HEX colour code |
Mapping from network |
nice_names |
– |
str -> str |
Mapping from network |