Configuration

PyPSA Africa 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 defaultconfig.

Note

Credits to PyPSA-Eur developers for the initial drafting of the configuration documentation here reported

Top-level configuration

version: 0.0.2
tutorial: false

logging:
  level: INFO
  format: "%(levelname)s:%(name)s:%(message)s"

# Can be replaced by country ["NG", "BJ"] or user specific region, more at https://pypsa-meets-africa.readthedocs.io/en/latest/configuration.html#top-level-configuration
  build_cutout: false
  # If "build_cutout" : true, then environmental data is extracted according to `snapshots` date range and `countries`
  # requires cds API key https://cds.climate.copernicus.eu/api-how-to
  # More information https://atlite.readthedocs.io/en/latest/introduction.html#datasets

# definition of the Coordinate Reference Systems
crs:
  geo_crs: EPSG:4326  # general geographic projection, not used for metric measures. "EPSG:4326" is the standard used by OSM and google maps

Unit

Values

Description

version

0.x.x

Version of PyPSA-Eur

tutorial

bool

{true, false}

Switch to retrieve the tutorial data set instead of the full data set.

logging

– level

Any of {‘INFO’, ‘WARNING’, ‘ERROR’}

Restrict console outputs to all infos, warning or errors only

– format

Custom format for log messages. See LogRecord attributes.

summary_dir

e.g. ‘results’

Directory into which results are written.

countries

Subset of {‘ZW’, ‘KZ’, ‘PS’, ‘LY’, ‘MO’, ‘TJ’, ‘AM’, ‘SE’, ‘UY’, ‘LV’, ‘CO’, ‘ER’, ‘MG’, ‘GE’, ‘RO’, ‘AO’, ‘GN’, ‘PE’, ‘SI’, ‘DZ’, ‘BZ’, ‘NA’, ‘AL’, ‘CA’, ‘FR’, ‘BR’, ‘ES’, ‘ZA’, ‘IS’, ‘IE’, ‘PK’, ‘NO’, ‘LK’, ‘GQ’, ‘IR’, ‘SR’, ‘LS’, ‘AU’, ‘IN’, ‘CH’, ‘CM’, ‘ZM’, ‘OM’, ‘BJ’, ‘TH’, ‘UZ’, ‘GH’, ‘MM’, ‘ID’, ‘RW’, ‘KH’, ‘GF’, ‘PY’, ‘UG’, ‘PL’, ‘MX’, ‘NI’, ‘HN’, ‘IT’, ‘QA’, ‘TR’, ‘SO’, ‘BY’, ‘MD’, ‘LI’, ‘DK’, ‘NZ’, ‘KE’, ‘GM’, ‘SK’, ‘NG’, ‘GB’, ‘BD’, ‘SD’, ‘DE’, ‘LU’, ‘KG’, ‘NL’, ‘AF’, ‘KP’, ‘CL’, ‘IQ’, ‘BO’, ‘CY’, ‘KR’, ‘ME’, ‘VN’, ‘SY’, ‘AE’, ‘BT’, ‘SA’, ‘CD’, ‘NC’, ‘SM’, ‘GL’, ‘DJ’, ‘JO’, ‘TZ’, ‘BE’, ‘GT’, ‘LR’, ‘HK’, ‘EC’, ‘GA’, ‘RS’, ‘CI’, ‘NP’, ‘EE’, ‘CR’, ‘GW’, ‘SN’, ‘CZ’, ‘HU’, ‘EG’, ‘AZ’, ‘YE’, ‘PG’, ‘IL’, ‘BF’, ‘KW’, ‘ET’, ‘US’, ‘PH’, ‘SV’, ‘NE’, ‘PT’, ‘ML’, ‘TD’, ‘BA’, ‘CG’, ‘BN’, ‘BG’, ‘UA’, ‘FI’, ‘VE’, ‘SS’, ‘BW’, ‘TW’, ‘PA’, ‘MC’, ‘LB’, ‘MR’, ‘MY’, ‘EH’, ‘JP’, ‘LT’, ‘RU’, ‘CF’, ‘AR’, ‘MK’, ‘SG’, ‘AT’, ‘BH’, ‘MW’, ‘TM’, ‘MT’, ‘SZ’, ‘MA’, ‘HR’, ‘AD’, ‘TG’, ‘TN’, ‘BI’, ‘SL’, ‘CN’, ‘MN’, ‘LA’, ‘GR’, ‘MZ’}

World countries defined by their Two-letter country codes (ISO 3166-1) which should be included in the energy system model.

focus_weights

Keys should be two-digit country codes (e.g. DE) and values should range between 0 and 1

Ratio of total clusters for particular countries. the remaining weight is distributed according to mean load. An example: focus_weights: DE: 0.6 FR: 0.2.

enable

– prepare_links_p_nom

bool

{true, false}

Switch to retrieve current HVDC projects from Wikipedia

– retrieve_databundle

bool

{true, false}

Switch to retrieve databundle from zenodo via the rule retrieve_databundle or whether to keep a custom databundle located in the corresponding folder.

– build_cutout

bool

{true, false}

Switch to enable the building of cutouts via the rule build_cutout.

– retrieve_cutout

bool

{true, false}

Switch to enable the retrieval of cutouts from zenodo with retrieve_cutout.

– build_natura_raster

bool

{true, false}

Switch to enable the creation of the raster natura.tiff via the rule build_natura_raster.

– retrieve_natura_raster

bool

{true, false}

Switch to enable the retrieval of natura.tiff from zenodo with retrieve_natura_raster.

– custom_busmap

bool

{true, false}

Switch to enable the use of custom busmaps in rule cluster_network. If activated the rule looks for provided busmaps at data/custom_busmap_elec_s{simpl}_{clusters}.csv which should have the same format as resources/busmap_elec_s{simpl}_{clusters}.csv, i.e. the index should contain the buses of networks/elec_s{simpl}.nc.

scenario

It is common conduct to analyse 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/elec_s{simpl}_{clusters}_ec_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:

img/scenarios.png
scenario:
  simpl: ['']
  ll: ['copt']
  clusters: [55]
  opts: [Co2L-3H]

Unit

Values

Description

simpl

cf. The {simpl} wildcard

List of {simpl} wildcards to run.

clusters

cf. The {clusters} wildcard

List of {clusters} wildcards to run.

ll

cf. The {ll} wildcard

List of {ll} wildcards to run.

opts

cf. The {opts} wildcard

List of {opts} wildcards to run.

snapshots

Specifies the temporal range to build an energy system model for as arguments to pandas.date_range

snapshots:
  start: "2013-01-01"
  end: "2014-01-01"
  inclusive: "left" # end is not inclusive

Unit

Values

Description

start

str or datetime-like; e.g. YYYY-MM-DD

Left bound of date range

end

str or datetime-like; e.g. YYYY-MM-DD

Right bound of date range

closed

One of {None, ‘left’, ‘right’}

Make the time interval closed to the left, right, or both sides None.

electricity

electricity:
  voltages: [220., 300., 380.]
  co2limit: 7.75e+7  # European default, 0.05 * 3.1e9*0.5, needs to be adjusted for Africa
  co2base: 1.487e+9  # European default, adjustment to Africa necessary
  agg_p_nom_limits: data/agg_p_nom_minmax.csv

Unit

Values

Description

voltages

kV

Any subset of {220., 300., 380.}

Voltage levels to consider when

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 {opts} wildcard.

agg_p_nom_limits

file

path

Reference to .csv file specifying per carrier generator nominal capacity constraints for individual countries if 'CCL' is in {opts} wildcard. Defaults to data/agg_p_nom_minmax.csv.

hvdc_as_lines

true or false

A flag specifying if the HVDC should be modeled as Lines or as Links components

operational_reserve

– activate

true or false

– epsilon_load

float, share of total load, between 0-1

– epsilon_vres

float, share of total renewable supply, between 0-1

– contingency

MW

float, fixed contigency over optimization timeframe i.e. 5000 MW

extendable_carriers

– Generator

Any subset of {‘OCGT’,’CCGT’}

Places extendable conventional power plants (OCGT and/or CCGT) where gas power plants are located today without capacity limits.

– 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 Store.

max_hours

– battery

h

float

Maximum state of charge capacity of the battery in terms of hours at full output capacity p_nom. Cf. PyPSA documentation.

– H2

h

float

Maximum state of charge capacity of the hydrogen storage in terms of hours at full output capacity p_nom. Cf. PyPSA documentation.

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 resources/powerplants.csv.

renewable_capacities_from_OPSD

[solar, onwind, offwind]

List of carriers (offwind-ac and offwind-dc are included in offwind) whose capacities ‘p_nom’ are aligned to the OPSD renewable power plant list

estimate_renewable_capacities_from_capacitiy_stats

– Fueltype [ppm], e.g. Wind

list of fueltypes strings in PyPSA-Eur, e.g. [onwind, offwind-ac, offwind-dc]

converts ppm Fueltype to PyPSA-EUR Fueltype

estimate_renewable_capacities

– stats

‘irena’ or False

Defines which database to use, currently only “irena” is available. False enables greenfield expansion, ‘irena’ uses IRENA stats to add expansion limits

– year

Any year beetween 2000 and 2020

Reference year, available years for IRENA stats are 2000 to 2020

– p_nom_min

float

scales the minimum expansion acquired from stats, i.e. 110% of <years>’s capacities => p_nom_min: 1.1

– p_nom_max

float or False

sets the expansion constraint, False to deactivate this option and use estimated renewable potentials determine by the workflow, float scales the p_nom_min factor accordingly

– technology_mapping

Maps the technologies defined in ppm.data.Capacity_stats with the carriers in PyPSA-Earth/Africa

– – Offshore

{‘offwind-ac’, ‘offwind-dc’}

– – Onshore

{‘onwind’}

– – PV

{‘solar’}

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.

atlite:
  nprocesses: 4
  cutouts:
    # geographical bounds automatically determined from countries input
    africa-2013-era5:
      module: era5
      dx: 0.3  # cutout resolution
      dy: 0.3  # cutout resolution
      # Below customization options are dealt in an automated way depending on
      # the snapshots and the selected countries. See 'build_cutout.py'
      # time: ["2013-01-01", "2014-01-01"]  # specify different weather year (~40 years available)
      # x: [-12., 35.]  # manual set cutout range
      # y: [33., 72]    # manual set cutout range

Unit

Values

Description

nprocesses

int

Number of parallel processes in cutout preparation

cutouts

– {name}

Convention is to name cutouts like <region>-<year>-<source> (e.g. europe-2013-era5).

Name of the cutout netcdf file. The user may specify multiple cutouts under configuration atlite: cutouts:. Reference is used in configuration renewable: {technology}: cutout:. The cutout base may be used to automatically calculate temporal and spatial bounds of the network.

– – 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

renewable:
  onwind:
    cutout: africa-2013-era5
    resource:
      method: wind
      turbine: Vestas_V112_3MW
    capacity_per_sqkm: 3 # conservative, ScholzPhd Tab 4.3.1: 10MW/km^2
    # correction_factor: 0.93
    copernicus:
      # Scholz, Y. (2012). Renewable energy based electricity supply at low costs:
      #  development of the REMix model and application for Europe. ( p.42 / p.28)
      # CLC grid codes:
      # 11X/12X - Various forest types
      # 20  - Shrubs
      # 30  - Herbaceus vegetation
      # 40  - Cropland
      # 50  - Urban
      # 60  - Bare / Sparse vegetation
      # 80  - Permanent water bodies
      # 100 - Moss and lichen
      # 200 - Open sea
      grid_codes: [20, 30, 40, 60, 100, 111, 112, 113, 114, 115, 116, 121, 122, 123, 124, 125, 126]
      distance: 1000
      distance_grid_codes: [50]
    natura: true
    potential: simple # or conservative
    clip_p_max_pu: 1.e-2
    extendable: true

Unit

Values

Description

cutout

Should be a folder listed in the configuration atlite: cutouts: (e.g. ‘europe-2013-era5’) or reference an existing folder in the directory cutouts. Source module must be ERA5.

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.

copernicus

– grid_codes

Any subset of the Copernicus Land Cover code list

Specifies areas based on CLC which generally eligible for AC-connected offshore wind turbine placement.

– distance

m

int

(Optional) Distance to reserve as uneligible area around ‘distance_grid_codes’ for the renewable technology.

– distance_grid_codes

(Optional with ‘distance’) Any subset of the Copernicus Land Cover code list

Specifies from which a distance of ‘distance’ metres is unavailable as a buffer area.

natura

bool

{true, false}

Switch to exclude Natura 2000 natural protection areas. Area is excluded if true.

potential

One of {‘simple’, ‘conservative’}

Method to compute the maximal installable potential for a node; confer Rule build_renewable_profiles

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.

keep_all_available_areas

bool

{‘true’, ‘false’}

Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed.

offwind-ac

  offwind-ac:
    cutout: africa-2013-era5
    resource:
      method: wind
      turbine: NREL_ReferenceTurbine_5MW_offshore
    capacity_per_sqkm: 2
    correction_factor: 0.8855
    # proxy for wake losses
    # from 10.1016/j.energy.2018.08.153
    # until done more rigorously in #153
    copernicus:
      grid_codes: [80, 200]
    natura: true
    max_depth: 50
    max_shore_distance: 30000
    potential: simple # or conservative
    clip_p_max_pu: 1.e-2
    extendable: true

Unit

Values

Description

cutout

Should be a folder listed in the configuration atlite: cutouts: (e.g. ‘europe-2013-era5’) or reference an existing folder in the directory cutouts. Source module must be ERA5.

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.

copernicus

– grid_codes

Any subset of the Copernicus Land Cover code list

Specifies areas based on CLC which generally eligible for AC-connected offshore wind turbine placement.

– distance

m

int

(Optional) Distance to reserve as uneligible area around ‘distance_grid_codes’ for the renewable technology.

– distance_grid_codes

(Optional with ‘distance’) Any subset of the Copernicus Land Cover code list

Specifies from which a distance of ‘distance’ metres is unavailable as a buffer area.

natura

bool

{true, false}

Switch to exclude Natura 2000 natural protection areas. Area is excluded if true.

max_depth

m

float

Maximum sea water depth at which wind turbines can be build. Maritime areas with deeper waters are excluded in the process of calculating the AC-connected offshore wind potential.

min_shore_distance

m

float

Minimum distance to the shore below which wind turbines cannot be build. Such areas close to the shore are excluded in the process of calculating the AC-connected offshore wind potential.

potential

One of {‘simple’, ‘conservative’}

Method to compute the maximal installable potential for a node; confer Rule build_renewable_profiles

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.

keep_all_available_areas

bool

{‘true’, ‘false’}

Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed.

offwind-dc

  offwind-dc:
    cutout: africa-2013-era5
    resource:
      method: wind
      turbine: NREL_ReferenceTurbine_5MW_offshore
    # ScholzPhd Tab 4.3.1: 10MW/km^2
    capacity_per_sqkm: 3
    correction_factor: 0.8855
    # proxy for wake losses
    # from 10.1016/j.energy.2018.08.153
    # until done more rigorously in #153
    copernicus:
      grid_codes: [80, 200]
    natura: true
    max_depth: 50
    min_shore_distance: 30000
    potential: simple # or conservative
    clip_p_max_pu: 1.e-2
    extendable: true

Unit

Values

Description

cutout

Should be a folder listed in the configuration atlite: cutouts: (e.g. ‘europe-2013-era5’) or reference an existing folder in the directory cutouts. Source module must be ERA5.

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.

copernicus

– grid_codes

Any subset of the Copernicus Land Cover code list

Specifies areas based on CLC which generally eligible for AC-connected offshore wind turbine placement.

– distance

m

int

(Optional) Distance to reserve as uneligible area around ‘distance_grid_codes’ for the renewable technology.

– distance_grid_codes

(Optional with ‘distance’) Any subset of the Copernicus Land Cover code list

Specifies from which a distance of ‘distance’ metres is unavailable as a buffer area.

natura

bool

{true, false}

Switch to exclude Natura 2000 natural protection areas. Area is excluded if true.

max_depth

m

float

Maximum sea water depth at which wind turbines can be build. Maritime areas with deeper waters are excluded in the process of calculating the AC-connected offshore wind potential.

min_shore_distance

m

float

Minimum distance to the shore below which wind turbines cannot be build. Such areas close to the shore are excluded in the process of calculating the AC-connected offshore wind potential.

potential

One of {‘simple’, ‘conservative’}

Method to compute the maximal installable potential for a node; confer Rule build_renewable_profiles

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.

keep_all_available_areas

bool

{‘true’, ‘false’}

Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed.

solar

  solar:
    cutout: africa-2013-era5
    resource:
      method: pv
      panel: CSi
      orientation: latitude_optimal # will lead into optimal design
        # slope: 0.  # slope: 0 represent a flat panel
        # azimuth: 180.  # azimuth: 180 south orientation
    capacity_per_sqkm: 4.6 # From 1.7 to 4.6 addresses issue #361
    # Determined by comparing uncorrected area-weighted full-load hours to those
    # published in Supplementary Data to
    # Pietzcker, Robert Carl, et al. "Using the sun to decarbonize the power
    # sector: The economic potential of photovoltaics and concentrating solar
    # power." Applied Energy 135 (2014): 704-720.
    correction_factor: 0.854337
    copernicus:
      grid_codes: [20, 30, 40, 50, 60, 90, 100]
    natura: true
    potential: simple # or conservative
    clip_p_max_pu: 1.e-2
    extendable: true

Unit

Values

Description

cutout

Should be a folder listed in the configuration atlite: cutouts: (e.g. ‘europe-2013-era5’) or reference an existing folder in the directory cutouts. Source module can be ERA5 or SARAH-2.

Specifies the directory where the relevant weather data ist stored that is specified at atlite/cutouts configuration. Both sarah and era5 work.

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

use either {latitude_optimal} or options such {slope: 0, azimuth: 180}

– – latitude_optimal

Atlite function which returns for every raster the optimal slope and azimuth

– – 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. Value relates to socio-technical acceptable density.

correction_factor

float

A correction factor for the capacity factor (availability) time series.

copernicus

– grid_codes

Any subset of the Copernicus Land Cover code list

Specifies areas based on CLC which generally eligible for AC-connected offshore wind turbine placement.

– distance

m

int

(Optional) Distance to reserve as uneligible area around ‘distance_grid_codes’ for the renewable technology.

– distance_grid_codes

(Optional with ‘distance’) Any subset of the Copernicus Land Cover code list

Specifies from which a distance of ‘distance’ metres is unavailable as a buffer area.

natura

bool

{true, false}

Switch to exclude Natura 2000 natural protection areas. Area is excluded if true.

potential

One of {‘simple’, ‘conservative’}

Method to compute the maximal installable potential for a node; confer Rule build_renewable_profiles

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.

keep_all_available_areas

bool

{‘true’, ‘false’}

Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed.

hydro

  hydro:
    cutout: africa-2013-era5
    resource:
      method: hydro
      hydrobasins: data/hydrobasins/hybas_world_lev06_v1c.shp
      flowspeed: 1.0  # m/s
      # weight_with_height: false
      # show_progress: true
      normalization: hydro_capacities # 'hydro_capacities' to normalize country production by using hydro_capacities, 'eia' to normalize by eia data, false for no normalization
    carriers: [ror, PHS, hydro]
    PHS_max_hours: 6
    hydro_max_hours: "energy_capacity_totals_by_country"  # not active
    clip_min_inflow: 1.0
    extendable: true
    normalization_multiplier: 1.1  # multiplier applied after the normalization of the hydro production

# TODO: Needs to be adjusted for Africa

Unit

Values

Description

cutout

Must be ‘europe-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 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.

clip_min_inflow

MW

float

To avoid too small values in the inflow time series, values below this threshold are set to zero.

normalization_multiplier

float

Multiplier factor of the normalization process (default 1.0)

lines

  split_overpassing_lines: true  # When True, lines overpassing buses are splitted and connected to the bueses
  overpassing_lines_tolerance: 1  # [m] (default 1) Tolerance to identify lines overpassing buses

base_network:
  min_voltage_substation_offshore: 35000  # [V] minimum voltage of the offshore substations
  min_voltage_rebase_voltage: 35000  # [V] minimum voltage in base network

load_options:
  ssp: "ssp2-2.6" # shared socio-economic pathway (GDP and population growth) scenario to consider
  weather_year: 2013  # Load scenarios available with different weather year (different renewable potentials)
  prediction_year: 2030  # Load scenarios available with different prediction year (GDP, population)
  scale: 1  # scales all load time-series, i.e. 2 = doubles load

electricity:
  voltages: [220., 300., 380.]
  co2limit: 7.75e+7  # European default, 0.05 * 3.1e9*0.5, needs to be adjusted for Africa
  co2base: 1.487e+9  # European default, adjustment to Africa necessary
  agg_p_nom_limits: data/agg_p_nom_minmax.csv
  hvdc_as_lines: true # should HVDC lines be modeled as `Line` or as `Link` component?

  operational_reserve: # like https://genxproject.github.io/GenX/dev/core/#Reserves
    activate: false
    epsilon_load: 0.02 # share of total load
    epsilon_vres: 0.02 # share of total renewable supply
    contingency: 0 # fixed capacity in MW

  max_hours:
    battery: 6
    H2: 168

  extendable_carriers:
    Generator: [solar, onwind, offwind-ac, offwind-dc, OCGT]
    StorageUnit: []  # battery, H2
    Store: [battery, H2]
    Link: []  # H2 pipeline

  powerplants_filter: (DateOut >= 2022 or DateOut != DateOut)
  custom_powerplants: false

  conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
  renewable_carriers: [solar, onwind, offwind-ac, offwind-dc, hydro]

  estimate_renewable_capacities:
    stats: "irena"  # False, = greenfield expansion, 'irena' uses IRENA stats to add expansion limits
    year: 2020  # Reference year, available years for IRENA stats are 2000 to 2020
    p_nom_min: 1  # any float, scales the minimum expansion acquired from stats, i.e. 110% of <years>'s capacities => p_nom_min: 1.1
    p_nom_max: false  # sets the expansion constraint, False to deactivate this option and use estimated renewable potentials determine by the workflow, float scales the p_nom_min factor accordingly
    technology_mapping:
      # Wind is the Fueltype in ppm.data.Capacity_stats, onwind, offwind-{ac,dc} the carrier in PyPSA-Earth
      Offshore: [offwind-ac, offwind-dc]
      Onshore: [onwind]
      PV: [solar]

lines:
  types:
    220.: "Al/St 240/40 2-bundle 220.0"
    300.: "Al/St 240/40 3-bundle 300.0"
    380.: "Al/St 240/40 4-bundle 380.0"
  dc_type: "DC_custom_linetype"
  s_max_pu: 0.7
  s_nom_max: .inf
  length_factor: 1.25
  under_construction: "zero" # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity

Unit

Values

Description

types

Values should specify a line type in PyPSA in case AC lines or a custom linetype in case of DC lines modeled as Lines. 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) to approximate \(N-1\) security and reserve capacity for reactive power flows

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.

transformers

Unit

Values

Description

x

p.u.

float

Series reactance (per unit, using s_nom as base power of the transformer. Overwritten if type is specified.

s_nom

MVA

float

Limit of apparent power which can pass through branch. Overwritten if type is specified.

type

A transformer type in PyPSA.

Specifies transformer types to assume for the transformers of the ENTSO-E grid extraction.

load

    epsilon_load: 0.02 # share of total load
    epsilon_vres: 0.02 # share of total renewable supply
    contingency: 0 # fixed capacity in MW

  max_hours:
    battery: 6
    H2: 168

  extendable_carriers:
    Generator: [solar, onwind, offwind-ac, offwind-dc, OCGT]
    StorageUnit: []  # battery, H2
    Store: [battery, H2]
    Link: []  # H2 pipeline

  powerplants_filter: (DateOut >= 2022 or DateOut != DateOut)
  custom_powerplants: false

  conventional_carriers: [nuclear, oil, OCGT, CCGT, coal, lignite, geothermal, biomass]
  renewable_carriers: [solar, onwind, offwind-ac, offwind-dc, hydro]

  estimate_renewable_capacities:
    stats: "irena"  # False, = greenfield expansion, 'irena' uses IRENA stats to add expansion limits
    year: 2020  # Reference year, available years for IRENA stats are 2000 to 2020
    p_nom_min: 1  # any float, scales the minimum expansion acquired from stats, i.e. 110% of <years>'s capacities => p_nom_min: 1.1
    p_nom_max: false  # sets the expansion constraint, False to deactivate this option and use estimated renewable potentials determine by the workflow, float scales the p_nom_min factor accordingly
    technology_mapping:
      # Wind is the Fueltype in ppm.data.Capacity_stats, onwind, offwind-{ac,dc} the carrier in PyPSA-Earth
      Offshore: [offwind-ac, offwind-dc]
      Onshore: [onwind]
      PV: [solar]

lines:
  types:
    220.: "Al/St 240/40 2-bundle 220.0"
    300.: "Al/St 240/40 3-bundle 300.0"
    380.: "Al/St 240/40 4-bundle 380.0"
  dc_type: "DC_custom_linetype"
  s_max_pu: 0.7
  s_nom_max: .inf
  length_factor: 1.25
  under_construction: "zero" # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity

links:
  p_max_pu: 1.0
  p_nom_max: .inf
  include_tyndp: true
  under_construction: "zero" # 'zero': set capacity to zero, 'remove': remove, 'keep': with full capacity

transformers:
  x: 0.1
  s_nom: 2000.
  type: ""

atlite:
  nprocesses: 4
  cutouts:
    # geographical bounds automatically determined from countries input
    africa-2013-era5:
      module: era5
      dx: 0.3  # cutout resolution
      dy: 0.3  # cutout resolution
      # Below customization options are dealt in an automated way depending on
      # the snapshots and the selected countries. See 'build_cutout.py'
      # time: ["2013-01-01", "2014-01-01"]  # specify different weather year (~40 years available)
      # x: [-12., 35.]  # manual set cutout range
      # y: [33., 72]    # manual set cutout range


renewable:
  onwind:
    cutout: africa-2013-era5
    resource:
      method: wind
      turbine: Vestas_V112_3MW
    capacity_per_sqkm: 3 # conservative, ScholzPhd Tab 4.3.1: 10MW/km^2
    # correction_factor: 0.93
    copernicus:

Unit

Values

Description

url

string

Link to open power system data time series data.

power_statistics

bool

{true, false}

Whether to load the electricity consumption data of the ENTSOE power statistics (only for files from 2019 and before) or from the ENTSOE transparency data (only has load data from 2015 onwards).

interpolate_limit

hours

integer

Maximum gap size (consecutive nans) which interpolated linearly.

time_shift_for_large_gaps

string

string

Periods which are used for copying time-slices in order to fill large gaps of nans. Have to be valid pandas period strings.

manual_adjustments

bool

{true, false}

Whether to adjust the load data manually according to the function in manual_adjustment().

scaling_factor

float

Global correction factor for the load time series.

costs

Unit

Values

Description

year

YYYY; e.g. ‘2030’

Year for which to retrieve cost assumptions of data/costs.csv.

discountrate

float

Default discount rate if not specified for a technology in data/costs.csv.

USD2013_to_EUR2013

float

Exchange rate from USD \(_{2013}\) to EUR \(_{2013}\) from ECB

capital_cost

EUR/MW

Keys should be in the ‘technology’ column of data/costs.csv. Values can be any float.

For the given technologies, assumptions about their capital investment costs are set to the corresponding value. Optional; overwrites cost assumptions from data/costs.csv.

marginal_cost

EUR/MWh

Keys should be in the ‘technology’ column of data/costs.csv. Values can be any float.

For the given technologies, assumptions about their marginal operating costs are set to the corresponding value. Optional; overwrites cost assumptions from data/costs.csv.

emission_prices

Specify exogenous prices for emission types listed in network.carriers to marginal costs.

– 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 Ep in the {opts} wildcard only in the rule prepare_network`.

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

solving:
  options:
    formulation: kirchhoff
    load_shedding: true
    noisy_costs: true
    min_iterations: 4
    max_iterations: 6
    clip_p_max_pu: 0.01
    skip_iterations: true
    track_iterations: false
    #nhours: 10

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 (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.

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 network.lines['s_nom_opt_X'] (where X labels the iteration)

solver

  solver:
    name: gurobi
    threads: 4
    method: 2 # barrier (=ipm)
    crossover: 0
    BarConvTol: 1.e-5
    FeasibilityTol: 1.e-6
    AggFill: 0
    PreDual: 0
    GURO_PAR_BARDENSETHRESH: 200

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

Parameter list for Gurobi and CPLEX

Solver specific parameter settings.

plotting

plotting:
  map:
    figsize: [7, 7]
    boundaries: [-10.2, 29, 35, 72]
    p_nom:
      bus_size_factor: 5.e+4
      linewidth_factor: 3.e+3

  costs_max: 800
  costs_threshold: 1

  energy_max: 15000.
  energy_min: -10000.
  energy_threshold: 50.

  vre_techs: ["onwind", "offwind-ac", "offwind-dc", "solar", "ror"]
  conv_techs: ["OCGT", "CCGT", "nuclear", "coal", "oil"]
  storage_techs: ["hydro+PHS", "battery", "H2"]
  load_carriers: ["AC load"]
  AC_carriers: ["AC line", "AC transformer"]
  link_carriers: ["DC line", "Converter AC-DC"]
  tech_colors:
    "onwind": "#235ebc"
    "onshore wind": "#235ebc"
    "offwind": "#6895dd"
    "offwind-ac": "#6895dd"
    "offshore wind": "#6895dd"
    "offshore wind ac": "#6895dd"
    "offwind-dc": "#74c6f2"
    "offshore wind dc": "#74c6f2"
    "hydro": "#08ad97"
    "hydro+PHS": "#08ad97"
    "PHS": "#08ad97"
    "hydro reservoir": "#08ad97"
    "hydroelectricity": "#08ad97"
    "ror": "#4adbc8"
    "run of river": "#4adbc8"
    "solar": "#f9d002"
    "solar PV": "#f9d002"
    "solar thermal": "#ffef60"
    "biomass": "#0c6013"
    "solid biomass": "#06540d"
    "biogas": "#23932d"
    "waste": "#68896b"
    "geothermal": "#ba91b1"
    "OCGT": "#d35050"
    "gas": "#d35050"
    "natural gas": "#d35050"
    "CCGT": "#b20101"
    "nuclear": "#ff9000"
    "coal": "#707070"
    "lignite": "#9e5a01"
    "oil": "#262626"
    "H2": "#ea048a"
    "hydrogen storage": "#ea048a"
    "battery": "#b8ea04"
    "Electric load": "#f9d002"
    "electricity": "#f9d002"
    "lines": "#70af1d"
    "transmission lines": "#70af1d"
    "AC-AC": "#70af1d"
    "AC line": "#70af1d"
    "links": "#8a1caf"
    "HVDC links": "#8a1caf"
    "DC-DC": "#8a1caf"
    "DC link": "#8a1caf"
    "load": "#FF0000"
  nice_names:
    OCGT: "Open-Cycle Gas"
    CCGT: "Combined-Cycle Gas"
    offwind-ac: "Offshore Wind (AC)"
    offwind-dc: "Offshore Wind (DC)"
    onwind: "Onshore Wind"
    solar: "Solar"
    PHS: "Pumped Hydro Storage"
    hydro: "Reservoir & Dam"
    battery: "Battery Storage"
    H2: "Hydrogen Storage"
    lines: "Transmission Lines"
    ror: "Run of River"

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 carrier to a colour (HEX colour code).

nice_names

str -> str

Mapping from network carrier to a more readable name.