Skip to content

A simple power system model at daily resolution written in Python

Notifications You must be signed in to change notification settings

matteodefelice/yapos

Repository files navigation

Yet Another Power System Model (YAPOS)

What is YAPOS? YAPOS is an economic dispatch model implemented in Python using Pyomo. The problem is defined at daily time-scale and it aims to provide a simple, yet insightful, modelisation of national power systems.

Why another power system model? Although several sophisticated power system model already exist with open license (for example Dispa-SET, PyPSA), YAPOS provides an alternative to all the users that:

  1. Do not want or cannot use a commercial solver (e.g. GUROBI or CPLEX)
  2. Want something light to run (a simulation for 34 countries run in a couple of minutes)
  3. Need a tool able to run many simulations in batch in a tidy way

How to use YAPOS? YAPOS has been developed and designed aiming to build an impact model for all the people investigating the link between energy & meteorology. However, it can be used whenever you need a lightweight power system model able to reproduce the impact of meteorological factors.

Installation

YAPOS consists of a single Python file which requires the following modules: - pyomo - numpy - pandas - xarray with netcdf4

You can install manually the modules with pip or other package managers. If you use anaconda you can easily create an environment for YAPOS with the following command: conda env create -f environment.yml

Getting started

From you Python environment you can run a test simulation with the command: python main.py db/test/ test_run

The output of the simulation can be found in the folder db/test.

With YAPOS code you can also find a database of simulations already available. More information here.

Launching a simulation

To launch a simulation you need to execute the script main.py specifying two arguments: the path of the folder containing the input files and the name of the simulation. This name will be used as name of the NetCDF output.

Notes and caveats

  • The model uses Cbc solver as default solver, however the code might be easily adapted to use other solvers (e.g. GLPK)
  • The model interprets the input files in a “positional” fashion because our formulation converts the CSVs into information by position (using Pandas iloc). Then be careful when changing the inputs, all the dimensions (units, zones, etc.) MUST follow the same order in all the input files and the name of the simulation that will be used to name the NetCDF output file.

How to set up and launch a simulation

  1. Create a folder for each simulation
  2. Copy inside the folder the input files needed for the simulation
  • Generation units: gen.csv
  • Transmission lines: lin.csv
  • Demand time-series: dem.csv
  • Renewable time-series: ren.csv
  • Renewables (non-dispatchable) generation capacity: ren_pp.csv
  • Inflow time-series: inflow.csv
  • Availability time-series: avail.csv
  • Minimum storage levels: stomin.csv
  1. Run the model with Python

R package

A companion package written in R named yaposer is available in [its repository](https://github.com/matteodefelice/yaposer. The package helps the user to load, save, edit and visualisize simulation inputs and results.

Read this page for a tutorial

Formulation

YAPOS uses a linear formulation at daily resolution. There are seven continuous variables (and three slack variables) defined over four sets.

Name Description
g Generation units
l Tranmissions lines
n Simulation zones
t Time steps

Sets

Name Description
system_cost(t) System cost
prod(g,t) Electricity production for the unit g (MWh)
sl(g,t) Storage level for the unit g (MWh)
u(g,t) Commitment level for the unit g (0-1)
shd(n,t) Shed load in the zone n (MWh)
curt(n,t) Curtailed electricity in the zone n (MWh)
flw(l,t) Electricity flow on the line l (MWh)

Optimization variables

Name Description
water_slack(g,t) Slack for the storage balance constraint
storage_slack(g,t) Slack for the constraint on the minimum storage
curt_slack(n,t) Slack for the constraint on the maximum curtailable electricity

Slack variables

The optimization problem uses the following objective function:

Problem formulation

The formulation uses 13 different constraints:

  • Electricity balance
  • Minimum generation for the units
  • Maximum generation for the units
  • Maximum rate of ramping-up for hydropower
  • Maximum rate of ramping-down for hydropower
  • Minimum storage level
  • Maximum storage level
  • Storage balance
  • Maximum discharge for hydropower
  • Minimum power flow
  • Maximum power flow

Inputs

As explained before YAPOS needs seven input files.

Demand

File name is dem.csv and contains a time-series per zone of the electricity demand.

NL BE FR DE DK ES PT AT IT GB IE NO SE FI PL CH LT LV EE CZ HU RO SK SI BG HR RS GR
292,467 210,703 1,556,073 1,170,710 92,694 578,629 111,416 175,029 632,214 1,019,288 70,998 473,592 461,015 254,082 344,699 170,765 27,211 19,103 23,523 163,429 96,521 144,119 66,929 31,191 88,687 40,617 156,689 117,336
328,015 244,574 1,720,765 1,392,108 96,407 706,866 136,122 201,807 762,106 985,103 73,619 468,065 489,230 279,589 410,901 188,028 30,954 21,111 24,680 175,735 103,329 146,413 72,777 34,698 104,754 51,888 139,005 139,823
320,055 237,188 1,738,334 1,346,724 96,678 700,615 136,435 191,077 724,243 989,638 72,067 461,658 489,023 276,600 410,270 192,067 29,723 21,430 26,393 176,136 102,999 151,116 70,462 35,177 114,175 51,820 138,376 176,415

Daily demand

Dispatchable generation units

The file has the name gen.csv and contains a table with a row per each dispatchable generating unit (i.e. no variable generation units like wind and solar). Each row has the following fields:

  • Unit: unit name
  • bus: the index (from 0 to N) of the zone where the unit belongs. The zones are in the order specified in the demand files (and also non-dispatchable renewables)
  • Technology and Fuel: code of technology and fuel based on the Dispa-SET classification
  • cost: cost of electricity generation (EUR/MWh)
  • co2_per_mwh: CO2 emission per MWh
  • max: Maximum daily generation of the unit (MWh)
  • stomax: Maximum value of the storage (MWh)
  • min: Minimum daily generation of the unit (MWh)
  • stomin: Minimum value of the storage (MWh)

Here an example of the file db/envarclim/1990/gen.csv.

Unit bus Technology Fuel cost co2_per_mwh max stomax min stomin
NL_Nuclear energy 0 STUR NUC 3.00 0.00 11664 0 9914.4 0
NL_Biomass fleet 0 STUR BIO 7.03 0.00 9552 0 0.0 0
NL_CCGT fleet E class 0 COMC GAS 67.56 0.39 5016 0 0.0 0
NL_CCGT fleet F class 0 COMC GAS 48.46 0.21 271920 0 0.0 0
NL_CCGT fleet G_H class 0 COMC GAS 42.46 0.19 32592 0 0.0 0

Generation units

Transmission lines

The file has the name lin.csv and contains a table with a row per each line. Lines represents the cross-border transmission lines connecting two zones. Each line consists of the name of the line, the two connected zones (used an integer index as in the bus field in the generation units) and the maximum daily capacity (MWh).

Here an example.

line_name from to cap
AT-CH 7 15 28800
AT-CZ 7 19 21600
AT-DE 7 3 60600
AT-HU 7 20 19200
AT-IT 7 8 8160

Transmission lines

Non-dispatchable renewables

File name is ren.csv and contains a time-series per zone of the generation from non-dispatchable renewables. The amount of electricity specified will be generated unless curtailed.

NL BE FR DE DK ES PT AT IT GB IE NO SE FI PL CH LT LV EE CZ HU RO SK SI BG HR RS GR
364.5915 809.4046 56,825.94 35,074.05 1,628.081 65,255.38 19,048.11 50,669.79 95,950.04 81,039.15 17,369.79 2,856.063 2,237.205 21,637.26 3,507.974 16,527.42 85.69015 4.66644 512.4863 529.54921 241.91640 15,208.84 4.76892 6,806.731 7,335.966 3,583.866 15,789.94 14,540.14
1,112.9964 2,222.8731 75,758.28 41,792.52 3,647.348 189,418.18 69,115.35 39,984.85 78,987.01 83,679.17 29,914.14 2,159.383 2,171.705 19,190.73 4,722.587 16,111.85 183.68792 12.85972 228.7425 15.57294 5.13976 12,367.78 0.00105 6,798.595 7,076.671 5,043.588 15,712.45 10,972.16
20,557.8965 13,255.3820 121,752.65 156,950.97 18,819.484 173,161.98 35,485.29 38,935.60 80,576.96 92,316.59 6,672.33 4,867.778 3,931.454 20,510.49 2,121.124 15,844.14 235.01548 22.51376 419.9438 281.94999 87.65472 17,841.52 0.71658 6,803.398 8,005.176 9,512.651 15,433.87 17,284.09

Daily renewable generation

Renewables/ Non-dispatchable generation capacity

The file has the name ren_pp.csv and contains a table with a row per each non-dispatchable fuel/technology (variable generation units like wind and solar). Each row has the following fields:

NOTE This file is not actually used for the simulation but it might be useful to the modeller to understand the energy mix “contained” into the non-dispatchable electricity time-series

Here an example of the file db/envarclim/1990/ren_pp.csv.

Technology NL BE FR DE DK ES PT AT IT GB IE NO SE FI PL CH LT LV EE CZ HU RO SK SI BG HR RS GR
HROR NA 115 8843.9 3854.28 10 2740.59 2872.96 5521.47 10604.89 1835 237.00 1449.4 NA 3250 418.92 4022.77 127 1565 6 334.92 28 2632.44 1271.81 1113 630.11 457.17 2008.46 223
PHOT 1429 3087 6196.0 40021.00 851 6500.00 429.00 732.00 18920.00 9063 NA NA NA NA 108.00 NA 69 NA 1 2027.00 29 1225.00 530.00 263 1041.00 49.00 NA 2441
WTOF 357 712 NA 3283.00 1271 NA NA NA NA 5011 33.01 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
WTON 3284 1580 10324.0 41033.00 3808 22772.00 5046.00 2489.00 9416.00 9204 2740.00 873.0 5960 1082 5494.00 120.00 509 74 375 277.00 328 2938.00 3.00 3 701.00 489.00 NA 1875

Non-dispatchable generation capacity

Inflow

File name is inflow.csv and contains a time-series per unit of the available energy available (MWh) for hydropower generation each day. The file contains a column for all the units, then non-hydro units will have a constant zero value.

NL_Nuclear energy NL_Biomass fleet NL_CCGT fleet E class NL_CCGT fleet F class NL_CCGT fleet G_H class NL_CCGT fleet CHP NL_Coal fleet Supercritical BE_Nuclear energy BE_Biomass fleet BE_CCGT fleet F class BE_CCGT fleet G_H class BE_CCGT fleet CHP BE_CCGT fleet cogen FR_Hydro reservoir FR_Nuclear energy FR_Biomass fleet FR_OCGT fleet Standard FR_CCGT fleet E class FR_CCGT fleet F class FR_CCGT fleet G_H class FR_Coal fleet Subcritical FR_Coal fleet Supercritical FR_Oil fleet Standard FR_Oil fleet Supercritical DE_Nuclear energy DE_Biomass fleet DE_OCGT fleet Modern DE_OCGT fleet Standard DE_Lignite fleet Subcritical DE_Lignite fleet Supercritical DE_CCGT fleet E class DE_CCGT fleet CHP DE_CCGT fleet F class DE_CCGT fleet G_H class DE_CCGT fleet cogen DE_Coal fleet IGCC DE_Coal fleet Subcritical DE_Coal fleet Supercritical DE_Oil fleet Standard DE_Oil fleet Subcritical DK_Biomass fleet DK_CCGT fleet F class DK_CCGT fleet cogen DK_Coal fleet Subcritical DK_Coal fleet Supercritical DK_Oil fleet Subcritical ES_Hydro reservoir ES_Nuclear energy ES_Biomass fleet ES_OCGT fleet Standard ES_CCGT fleet F class ES_CCGT fleet G_H class ES_CCGT fleet cogen ES_Coal fleet Standard ES_Coal fleet Subcritical ES_Coal fleet Supercritical PT_Hydro reservoir PT_Biomass fleet PT_CCGT fleet F class PT_CCGT fleet G_H class PT_Coal fleet Supercritical AT_Hydro reservoir AT_Biomass fleet AT_CCGT fleet E class AT_CCGT fleet F class AT_CCGT fleet cogen AT_Coal fleet Subcritical AT_Coal fleet Supercritical IT_Hydro reservoir IT_Biomass fleet IT_OCGT fleet Modern IT_OCGT fleet Standard IT_CCGT fleet E class IT_CCGT fleet F class IT_CCGT fleet G_H class IT_CCGT fleet cogen IT_Coal fleet IGCC IT_Coal fleet Subcritical IT_Coal fleet Supercritical IT_Oil fleet Subcritical GB_Nuclear energy GB_Biomass fleet GB_OCGT fleet Modern GB_OCGT fleet Standard GB_CCGT fleet E class GB_CCGT fleet F class GB_CCGT fleet G_H class GB_Coal fleet Subcritical GB_Oil fleet Standard GB_Oil fleet Subcritical IE_Biomass fleet IE_OCGT fleet Modern IE_OCGT fleet Standard IE_Lignite fleet Subcritical IE_CCGT fleet F class IE_CCGT fleet G_H class IE_CCGT fleet cogen IE_Coal fleet Subcritical IE_Oil fleet Modern IE_Oil fleet Standard IE_Oil fleet Subcritical NO_Hydro-reservoir NO_OCGT fleet Modern NO_CCGT fleet F class SE_Hydro reservoir SE_Nuclear energy SE_Biomass fleet SE_CCGT fleet F class SE_Oil fleet Standard SE_Oil fleet Subcritical FI_Hydro reservoir FI_Nuclear energy FI_Biomass fleet FI_OCGT fleet Standard FI_Lignite fleet Subcritical FI_CCGT fleet E class FI_CCGT fleet F class FI_Coal fleet Subcritical FI_Oil fleet Standard FI_Oil fleet Subcritical PL_Biomass fleet PL_Lignite fleet Subcritical PL_Lignite fleet Supercritical PL_CCGT fleet E class PL_CCGT fleet F class PL_CCGT fleet G_H class PL_Coal fleet Subcritical PL_Coal fleet Supercritical PL_Oil fleet Subcritical CH_Hydro-reservoir CH_Nuclear energy LT_Biomass fleet LT_OCGT fleet Standard LT_CCGT fleet G_H class LT_CCGT fleet cogen LV_Biomass fleet LV_CCGT fleet E class LV_CCGT fleet F class LV_CCGT fleet G_H class EE_Biomass fleet EE_Lignite fleet Subcritical EE_Lignite fleet Supercritical EE_CCGT fleet cogen CZ_Nuclear energy CZ_Biomass fleet CZ_Lignite fleet Subcritical CZ_Lignite fleet Supercritical CZ_CCGT fleet F class CZ_Coal fleet Subcritical HU_Nuclear energy HU_Biomass fleet HU_OCGT fleet Modern HU_OCGT fleet Standard HU_Lignite fleet Subcritical HU_CCGT fleet E class HU_CCGT fleet F class HU_CCGT fleet cogen HU_Oil fleet Standard RO_Hydro reservoir RO_Nuclear energy RO_Biomass fleet RO_OCGT fleet Standard RO_Lignite fleet Subcritical RO_CCGT fleet F class RO_CCGT fleet G_H class RO_CCGT fleet cogen RO_Coal fleet Subcritical SK_Nuclear energy SK_Biomass fleet SK_Lignite fleet Subcritical SK_CCGT fleet E class SK_CCGT fleet F class SK_Coal fleet Subcritical SI_Nuclear energy SI_Biomass fleet SI_OCGT fleet Standard SI_Lignite fleet Subcritical SI_Lignite fleet Supercritical BG_Hydro reservoir BG_Nuclear energy BG_Biomass fleet BG_Lignite fleet Subcritical BG_CCGT fleet F class BG_CCGT fleet cogen BG_Coal fleet Subcritical HR_Hydro reservoir HR_Biomass fleet HR_CCGT fleet E class HR_CCGT fleet F class HR_CCGT fleet cogen HR_Coal fleet Subcritical HR_Oil fleet Subcritical HR_Oil fleet Supercritical RS_Hydro-reservoir RS_Lignite fleet Subcritical RS_CCGT fleet cogen RS_Oil fleet Subcritical GR_Hydro reservoir GR_Biomass fleet GR_OCGT fleet Standard GR_Lignite fleet Subcritical GR_Lignite fleet Supercritical GR_CCGT fleet CHP GR_CCGT fleet F class GR_CCGT fleet G_H class
0 0 0 0 0 0 0 0 0 0 0 0 0 67,769.97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 36,439.15 0 0 0 0 0 0 0 0 0 19,169.15 0 0 0 0 52,165.44 0 0 0 0 0 0 71,356.51 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 83,616.36 0 0 67,168.06 0 0 0 0 0 8,894.073 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 29,887.88 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8,110.243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6,997.661 0 0 0 0 0 0 6,153.959 0 0 0 0 0 0 0 4,876.976 0 0 0 12,388.37 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 69,383.09 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64,741.85 0 0 0 0 0 0 0 0 0 26,158.87 0 0 0 0 51,637.04 0 0 0 0 0 0 69,157.38 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 81,906.97 0 0 62,475.16 0 0 0 0 0 8,659.178 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 28,927.73 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8,142.714 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7,006.725 0 0 0 0 0 0 5,897.025 0 0 0 0 0 0 0 4,853.042 0 0 0 12,752.57 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 69,561.31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 73,320.63 0 0 0 0 0 0 0 0 0 30,801.67 0 0 0 0 48,500.65 0 0 0 0 0 0 68,114.69 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 81,879.06 0 0 59,911.98 0 0 0 0 0 8,414.936 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 28,330.87 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8,337.898 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7,043.821 0 0 0 0 0 0 5,868.561 0 0 0 0 0 0 0 4,766.998 0 0 0 12,782.05 0 0 0 0 0 0 0

Daily hydropower inflow

Availability

File avail.csv contains a time-series per zone of the availability factor, a value between 1 (100% available generation) and 0 (unit non available) for each unit.

NL_Nuclear energy NL_Biomass fleet NL_CCGT fleet E class NL_CCGT fleet F class NL_CCGT fleet G_H class NL_CCGT fleet CHP NL_Coal fleet Supercritical BE_Nuclear energy BE_Biomass fleet BE_CCGT fleet F class BE_CCGT fleet G_H class BE_CCGT fleet CHP BE_CCGT fleet cogen FR_Hydro reservoir FR_Nuclear energy FR_Biomass fleet FR_OCGT fleet Standard FR_CCGT fleet E class FR_CCGT fleet F class FR_CCGT fleet G_H class FR_Coal fleet Subcritical FR_Coal fleet Supercritical FR_Oil fleet Standard FR_Oil fleet Supercritical DE_Nuclear energy DE_Biomass fleet DE_OCGT fleet Modern DE_OCGT fleet Standard DE_Lignite fleet Subcritical DE_Lignite fleet Supercritical DE_CCGT fleet E class DE_CCGT fleet CHP DE_CCGT fleet F class DE_CCGT fleet G_H class DE_CCGT fleet cogen DE_Coal fleet IGCC DE_Coal fleet Subcritical DE_Coal fleet Supercritical DE_Oil fleet Standard DE_Oil fleet Subcritical DK_Biomass fleet DK_CCGT fleet F class DK_CCGT fleet cogen DK_Coal fleet Subcritical DK_Coal fleet Supercritical DK_Oil fleet Subcritical ES_Hydro reservoir ES_Nuclear energy ES_Biomass fleet ES_OCGT fleet Standard ES_CCGT fleet F class ES_CCGT fleet G_H class ES_CCGT fleet cogen ES_Coal fleet Standard ES_Coal fleet Subcritical ES_Coal fleet Supercritical PT_Hydro reservoir PT_Biomass fleet PT_CCGT fleet F class PT_CCGT fleet G_H class PT_Coal fleet Supercritical AT_Hydro reservoir AT_Biomass fleet AT_CCGT fleet E class AT_CCGT fleet F class AT_CCGT fleet cogen AT_Coal fleet Subcritical AT_Coal fleet Supercritical IT_Hydro reservoir IT_Biomass fleet IT_OCGT fleet Modern IT_OCGT fleet Standard IT_CCGT fleet E class IT_CCGT fleet F class IT_CCGT fleet G_H class IT_CCGT fleet cogen IT_Coal fleet IGCC IT_Coal fleet Subcritical IT_Coal fleet Supercritical IT_Oil fleet Subcritical GB_Nuclear energy GB_Biomass fleet GB_OCGT fleet Modern GB_OCGT fleet Standard GB_CCGT fleet E class GB_CCGT fleet F class GB_CCGT fleet G_H class GB_Coal fleet Subcritical GB_Oil fleet Standard GB_Oil fleet Subcritical IE_Biomass fleet IE_OCGT fleet Modern IE_OCGT fleet Standard IE_Lignite fleet Subcritical IE_CCGT fleet F class IE_CCGT fleet G_H class IE_CCGT fleet cogen IE_Coal fleet Subcritical IE_Oil fleet Modern IE_Oil fleet Standard IE_Oil fleet Subcritical NO_Hydro-reservoir NO_OCGT fleet Modern NO_CCGT fleet F class SE_Hydro reservoir SE_Nuclear energy SE_Biomass fleet SE_CCGT fleet F class SE_Oil fleet Standard SE_Oil fleet Subcritical FI_Hydro reservoir FI_Nuclear energy FI_Biomass fleet FI_OCGT fleet Standard FI_Lignite fleet Subcritical FI_CCGT fleet E class FI_CCGT fleet F class FI_Coal fleet Subcritical FI_Oil fleet Standard FI_Oil fleet Subcritical PL_Biomass fleet PL_Lignite fleet Subcritical PL_Lignite fleet Supercritical PL_CCGT fleet E class PL_CCGT fleet F class PL_CCGT fleet G_H class PL_Coal fleet Subcritical PL_Coal fleet Supercritical PL_Oil fleet Subcritical CH_Hydro-reservoir CH_Nuclear energy LT_Biomass fleet LT_OCGT fleet Standard LT_CCGT fleet G_H class LT_CCGT fleet cogen LV_Biomass fleet LV_CCGT fleet E class LV_CCGT fleet F class LV_CCGT fleet G_H class EE_Biomass fleet EE_Lignite fleet Subcritical EE_Lignite fleet Supercritical EE_CCGT fleet cogen CZ_Nuclear energy CZ_Biomass fleet CZ_Lignite fleet Subcritical CZ_Lignite fleet Supercritical CZ_CCGT fleet F class CZ_Coal fleet Subcritical HU_Nuclear energy HU_Biomass fleet HU_OCGT fleet Modern HU_OCGT fleet Standard HU_Lignite fleet Subcritical HU_CCGT fleet E class HU_CCGT fleet F class HU_CCGT fleet cogen HU_Oil fleet Standard RO_Hydro reservoir RO_Nuclear energy RO_Biomass fleet RO_OCGT fleet Standard RO_Lignite fleet Subcritical RO_CCGT fleet F class RO_CCGT fleet G_H class RO_CCGT fleet cogen RO_Coal fleet Subcritical SK_Nuclear energy SK_Biomass fleet SK_Lignite fleet Subcritical SK_CCGT fleet E class SK_CCGT fleet F class SK_Coal fleet Subcritical SI_Nuclear energy SI_Biomass fleet SI_OCGT fleet Standard SI_Lignite fleet Subcritical SI_Lignite fleet Supercritical BG_Hydro reservoir BG_Nuclear energy BG_Biomass fleet BG_Lignite fleet Subcritical BG_CCGT fleet F class BG_CCGT fleet cogen BG_Coal fleet Subcritical HR_Hydro reservoir HR_Biomass fleet HR_CCGT fleet E class HR_CCGT fleet F class HR_CCGT fleet cogen HR_Coal fleet Subcritical HR_Oil fleet Subcritical HR_Oil fleet Supercritical RS_Hydro-reservoir RS_Lignite fleet Subcritical RS_CCGT fleet cogen RS_Oil fleet Subcritical GR_Hydro reservoir GR_Biomass fleet GR_OCGT fleet Standard GR_Lignite fleet Subcritical GR_Lignite fleet Supercritical GR_CCGT fleet CHP GR_CCGT fleet F class GR_CCGT fleet G_H class
1 0.99 0.9194417 0.9194417 0.9194417 0.8274975 1 0.9708 0.31 0.9194417 0.9194417 0.8458863 0.8458863 0.55 0.918499 0.53 0.96 0.9194417 0.9194417 0.9194417 1 1 0.9 0.9 0.9796 0.68 0.96 0.96 0.9440069 0.9440069 0.9194417 0.8458863 0.9194417 0.9194417 0.8458863 1 1 1 0.9 0.9 0.32 0.9194417 0.8458863 1 1 0.9 0.86 0.8688 0.18 0.96 0.9194417 0.9194417 0.8458863 1 1 1 0.86 0.53 0.9194417 0.9194417 1 0.64 0.379 0.9194417 0.9194417 0.8458863 1 1 0.36 0.6 0.96 0.96 0.9194417 0.9194417 0.9194417 0.8458863 1 1 1 0.9 0.9863 0.43 0.96 0.96 0.9194417 0.9194417 0.9194417 1 0.9 0.9 0.3676 0.96 0.96 0.9440069 0.9194417 0.9194417 0.8458863 1 0.9 0.9 0.9 0.863 0.96 0.9194417 0.7913484 0.9904 0.6941 0.9194417 0.9 0.9 1 1 0.8 0.96 0.9440069 0.9194417 0.9194417 1 0.9 0.9 0.98 0.9440069 0.9440069 0.9194417 0.9194417 0.9194417 1 1 0.9 0.61 0.894 0.35 0.96 0.9194417 0.8458863 0.67 0.9194417 0.9194417 0.9194417 0.99 0.9440069 0.9440069 0.8458863 0.7631 0.62 0.9440069 0.9440069 0.9194417 1 0.9906 0.7 0.96 0.96 0.9440069 0.9194417 0.9194417 0.8458863 0.9 0.4099282 0.9999 0.47 0.96 0.9440069 0.9194417 0.9194417 0.8458863 1 0.9958 0.56 0.9440069 0.9194417 0.9194417 1 1 0.21 0.96 0.9440069 0.9440069 0.99 1 0.54 0.9440069 0.9194417 0.8458863 1 0.66 0.44 0.9194417 0.9194417 0.8458863 1 0.9 0.9 1 0.9440069 0.8458863 0.9 0.7287449 0.68 0.96 0.9440069 0.9440069 0.9194417 0.9194417 0.9194417
1 0.99 0.9194417 0.9194417 0.9194417 0.8274975 1 0.9708 0.31 0.9194417 0.9194417 0.8458863 0.8458863 0.55 0.918499 0.53 0.96 0.9194417 0.9194417 0.9194417 1 1 0.9 0.9 0.9796 0.68 0.96 0.96 0.9440069 0.9440069 0.9194417 0.8458863 0.9194417 0.9194417 0.8458863 1 1 1 0.9 0.9 0.32 0.9194417 0.8458863 1 1 0.9 0.86 0.8688 0.18 0.96 0.9194417 0.9194417 0.8458863 1 1 1 0.86 0.53 0.9194417 0.9194417 1 0.64 0.379 0.9194417 0.9194417 0.8458863 1 1 0.36 0.6 0.96 0.96 0.9194417 0.9194417 0.9194417 0.8458863 1 1 1 0.9 0.9863 0.43 0.96 0.96 0.9194417 0.9194417 0.9194417 1 0.9 0.9 0.3676 0.96 0.96 0.9440069 0.9194417 0.9194417 0.8458863 1 0.9 0.9 0.9 0.863 0.96 0.9194417 0.7913484 0.9904 0.6941 0.9194417 0.9 0.9 1 1 0.8 0.96 0.9440069 0.9194417 0.9194417 1 0.9 0.9 0.98 0.9440069 0.9440069 0.9194417 0.9194417 0.9194417 1 1 0.9 0.61 0.894 0.35 0.96 0.9194417 0.8458863 0.67 0.9194417 0.9194417 0.9194417 0.99 0.9440069 0.9440069 0.8458863 0.7631 0.62 0.9440069 0.9440069 0.9194417 1 0.9906 0.7 0.96 0.96 0.9440069 0.9194417 0.9194417 0.8458863 0.9 0.4099282 0.9999 0.47 0.96 0.9440069 0.9194417 0.9194417 0.8458863 1 0.9958 0.56 0.9440069 0.9194417 0.9194417 1 1 0.21 0.96 0.9440069 0.9440069 0.99 1 0.54 0.9440069 0.9194417 0.8458863 1 0.66 0.44 0.9194417 0.9194417 0.8458863 1 0.9 0.9 1 0.9440069 0.8458863 0.9 0.7287449 0.68 0.96 0.9440069 0.9440069 0.9194417 0.9194417 0.9194417
1 0.99 0.9194417 0.9194417 0.9194417 0.8274975 1 0.9708 0.31 0.9194417 0.9194417 0.8458863 0.8458863 0.55 0.918499 0.53 0.96 0.9194417 0.9194417 0.9194417 1 1 0.9 0.9 0.9796 0.68 0.96 0.96 0.9440069 0.9440069 0.9194417 0.8458863 0.9194417 0.9194417 0.8458863 1 1 1 0.9 0.9 0.32 0.9194417 0.8458863 1 1 0.9 0.86 0.8688 0.18 0.96 0.9194417 0.9194417 0.8458863 1 1 1 0.86 0.53 0.9194417 0.9194417 1 0.64 0.379 0.9194417 0.9194417 0.8458863 1 1 0.36 0.6 0.96 0.96 0.9194417 0.9194417 0.9194417 0.8458863 1 1 1 0.9 0.9863 0.43 0.96 0.96 0.9194417 0.9194417 0.9194417 1 0.9 0.9 0.3676 0.96 0.96 0.9440069 0.9194417 0.9194417 0.8458863 1 0.9 0.9 0.9 0.863 0.96 0.9194417 0.7913484 0.9904 0.6941 0.9194417 0.9 0.9 1 1 0.8 0.96 0.9440069 0.9194417 0.9194417 1 0.9 0.9 0.98 0.9440069 0.9440069 0.9194417 0.9194417 0.9194417 1 1 0.9 0.61 0.894 0.35 0.96 0.9194417 0.8458863 0.67 0.9194417 0.9194417 0.9194417 0.99 0.9440069 0.9440069 0.8458863 0.7631 0.62 0.9440069 0.9440069 0.9194417 1 0.9906 0.7 0.96 0.96 0.9440069 0.9194417 0.9194417 0.8458863 0.9 0.4099282 0.9999 0.47 0.96 0.9440069 0.9194417 0.9194417 0.8458863 1 0.9958 0.56 0.9440069 0.9194417 0.9194417 1 1 0.21 0.96 0.9440069 0.9440069 0.99 1 0.54 0.9440069 0.9194417 0.8458863 1 0.66 0.44 0.9194417 0.9194417 0.8458863 1 0.9 0.9 1 0.9440069 0.8458863 0.9 0.7287449 0.68 0.96 0.9440069 0.9440069 0.9194417 0.9194417 0.9194417

Daily unit availability

Minimum level of the storage

This file, named stomin.csv, contains a time-series per unit of the minimum level of the storage. The value will be between stomin and stomax specified in the list of generation units. As for the inflow the table has a column for each unit, with a constant zero for all the units without storage.

NL_Nuclear energy NL_Biomass fleet NL_CCGT fleet E class NL_CCGT fleet F class NL_CCGT fleet G_H class NL_CCGT fleet CHP NL_Coal fleet Supercritical BE_Nuclear energy BE_Biomass fleet BE_CCGT fleet F class BE_CCGT fleet G_H class BE_CCGT fleet CHP BE_CCGT fleet cogen FR_Hydro reservoir FR_Nuclear energy FR_Biomass fleet FR_OCGT fleet Standard FR_CCGT fleet E class FR_CCGT fleet F class FR_CCGT fleet G_H class FR_Coal fleet Subcritical FR_Coal fleet Supercritical FR_Oil fleet Standard FR_Oil fleet Supercritical DE_Nuclear energy DE_Biomass fleet DE_OCGT fleet Modern DE_OCGT fleet Standard DE_Lignite fleet Subcritical DE_Lignite fleet Supercritical DE_CCGT fleet E class DE_CCGT fleet CHP DE_CCGT fleet F class DE_CCGT fleet G_H class DE_CCGT fleet cogen DE_Coal fleet IGCC DE_Coal fleet Subcritical DE_Coal fleet Supercritical DE_Oil fleet Standard DE_Oil fleet Subcritical DK_Biomass fleet DK_CCGT fleet F class DK_CCGT fleet cogen DK_Coal fleet Subcritical DK_Coal fleet Supercritical DK_Oil fleet Subcritical ES_Hydro reservoir ES_Nuclear energy ES_Biomass fleet ES_OCGT fleet Standard ES_CCGT fleet F class ES_CCGT fleet G_H class ES_CCGT fleet cogen ES_Coal fleet Standard ES_Coal fleet Subcritical ES_Coal fleet Supercritical PT_Hydro reservoir PT_Biomass fleet PT_CCGT fleet F class PT_CCGT fleet G_H class PT_Coal fleet Supercritical AT_Hydro reservoir AT_Biomass fleet AT_CCGT fleet E class AT_CCGT fleet F class AT_CCGT fleet cogen AT_Coal fleet Subcritical AT_Coal fleet Supercritical IT_Hydro reservoir IT_Biomass fleet IT_OCGT fleet Modern IT_OCGT fleet Standard IT_CCGT fleet E class IT_CCGT fleet F class IT_CCGT fleet G_H class IT_CCGT fleet cogen IT_Coal fleet IGCC IT_Coal fleet Subcritical IT_Coal fleet Supercritical IT_Oil fleet Subcritical GB_Nuclear energy GB_Biomass fleet GB_OCGT fleet Modern GB_OCGT fleet Standard GB_CCGT fleet E class GB_CCGT fleet F class GB_CCGT fleet G_H class GB_Coal fleet Subcritical GB_Oil fleet Standard GB_Oil fleet Subcritical IE_Biomass fleet IE_OCGT fleet Modern IE_OCGT fleet Standard IE_Lignite fleet Subcritical IE_CCGT fleet F class IE_CCGT fleet G_H class IE_CCGT fleet cogen IE_Coal fleet Subcritical IE_Oil fleet Modern IE_Oil fleet Standard IE_Oil fleet Subcritical NO_Hydro-reservoir NO_OCGT fleet Modern NO_CCGT fleet F class SE_Hydro reservoir SE_Nuclear energy SE_Biomass fleet SE_CCGT fleet F class SE_Oil fleet Standard SE_Oil fleet Subcritical FI_Hydro reservoir FI_Nuclear energy FI_Biomass fleet FI_OCGT fleet Standard FI_Lignite fleet Subcritical FI_CCGT fleet E class FI_CCGT fleet F class FI_Coal fleet Subcritical FI_Oil fleet Standard FI_Oil fleet Subcritical PL_Biomass fleet PL_Lignite fleet Subcritical PL_Lignite fleet Supercritical PL_CCGT fleet E class PL_CCGT fleet F class PL_CCGT fleet G_H class PL_Coal fleet Subcritical PL_Coal fleet Supercritical PL_Oil fleet Subcritical CH_Hydro-reservoir CH_Nuclear energy LT_Biomass fleet LT_OCGT fleet Standard LT_CCGT fleet G_H class LT_CCGT fleet cogen LV_Biomass fleet LV_CCGT fleet E class LV_CCGT fleet F class LV_CCGT fleet G_H class EE_Biomass fleet EE_Lignite fleet Subcritical EE_Lignite fleet Supercritical EE_CCGT fleet cogen CZ_Nuclear energy CZ_Biomass fleet CZ_Lignite fleet Subcritical CZ_Lignite fleet Supercritical CZ_CCGT fleet F class CZ_Coal fleet Subcritical HU_Nuclear energy HU_Biomass fleet HU_OCGT fleet Modern HU_OCGT fleet Standard HU_Lignite fleet Subcritical HU_CCGT fleet E class HU_CCGT fleet F class HU_CCGT fleet cogen HU_Oil fleet Standard RO_Hydro reservoir RO_Nuclear energy RO_Biomass fleet RO_OCGT fleet Standard RO_Lignite fleet Subcritical RO_CCGT fleet F class RO_CCGT fleet G_H class RO_CCGT fleet cogen RO_Coal fleet Subcritical SK_Nuclear energy SK_Biomass fleet SK_Lignite fleet Subcritical SK_CCGT fleet E class SK_CCGT fleet F class SK_Coal fleet Subcritical SI_Nuclear energy SI_Biomass fleet SI_OCGT fleet Standard SI_Lignite fleet Subcritical SI_Lignite fleet Supercritical BG_Hydro reservoir BG_Nuclear energy BG_Biomass fleet BG_Lignite fleet Subcritical BG_CCGT fleet F class BG_CCGT fleet cogen BG_Coal fleet Subcritical HR_Hydro reservoir HR_Biomass fleet HR_CCGT fleet E class HR_CCGT fleet F class HR_CCGT fleet cogen HR_Coal fleet Subcritical HR_Oil fleet Subcritical HR_Oil fleet Supercritical RS_Hydro-reservoir RS_Lignite fleet Subcritical RS_CCGT fleet cogen RS_Oil fleet Subcritical GR_Hydro reservoir GR_Biomass fleet GR_OCGT fleet Standard GR_Lignite fleet Subcritical GR_Lignite fleet Supercritical GR_CCGT fleet CHP GR_CCGT fleet F class GR_CCGT fleet G_H class
0 0 0 0 0 0 0 0 0 0 0 0 0 1,012,019 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2,525,081 0 0 0 0 0 0 0 0 0 645,450 0 0 0 0 1,877,565 0 0 0 0 0 0 1,422,859 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18,440,832 0 0 9,210,462 0 0 0 0 0 763,169.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,066,876 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 323,851.6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 119,236.9 0 0 0 0 0 0 104,881.5 0 0 0 0 0 0 0 14,847.53 0 0 0 489,718.4 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1,012,019 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2,525,081 0 0 0 0 0 0 0 0 0 645,450 0 0 0 0 1,877,565 0 0 0 0 0 0 1,422,859 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18,440,832 0 0 9,210,462 0 0 0 0 0 763,169.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,066,876 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 323,851.6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 119,236.9 0 0 0 0 0 0 104,881.5 0 0 0 0 0 0 0 14,847.53 0 0 0 489,718.4 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1,012,019 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2,525,081 0 0 0 0 0 0 0 0 0 645,450 0 0 0 0 1,877,565 0 0 0 0 0 0 1,422,859 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18,440,832 0 0 9,210,462 0 0 0 0 0 763,169.5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4,066,876 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 323,851.6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 119,236.9 0 0 0 0 0 0 104,881.5 0 0 0 0 0 0 0 14,847.53 0 0 0 489,718.4 0 0 0 0 0 0 0

Daily minimum storage

Outputs

At the end of a YAPOS simulation, in the same folder of the input files the model will save a set of files containing the results for the simulation.

The main output file is in NetCDF format and its filename is set with the keyword specified when executing the simulation. In addition to the NetCDF file, the simulation saves also a set of CSV files in addition to a file named model.lp, containing the linear programming formulation (that can be used for example to rerun the same problem with another solver, e.g. GLPK).

NetCDF output

import xarray as xr
xr.open_dataset('/Users/matteodefelice/work/yaposer/inst/extdata/es-pt-fr.nc')
## <xarray.Dataset>
## Dimensions:            (day: 365, line: 2, unit: 26, zone: 3)
## Coordinates:
##   * day                (day) int64 0 1 2 3 4 5 6 ... 358 359 360 361 362 363 364
##   * unit               (unit) object 'FR_Hydro reservoir' ... 'PT_Coal fleet Supercritical'
##   * zone               (zone) object 'ES' 'PT' 'FR'
##   * line               (line) object 'ES-FR' 'ES-PT'
## Data variables:
##     production         (day, unit) float64 ...
##     availability       (day, unit) float64 ...
##     inflow             (day, unit) float64 ...
##     storage_min        (day, unit) float64 ...
##     demand             (day, zone) int64 ...
##     renewables         (day, zone) float64 ...
##     flow               (day, line) float64 ...
##     shed_load          (day, zone) float64 ...
##     curtailed          (day, zone) float64 ...
##     storage_level      (day, unit) float64 ...
##     water_slack        (day, unit) float64 ...
##     storage_slack      (day, unit) float64 ...
##     curtailment_slack  (day, zone) float64 ...
##     unit_bus           (unit) int64 ...
##     unit_Technology    (unit) object ...
##     unit_Fuel          (unit) object ...
##     unit_cost          (unit) float64 ...
##     unit_co2_per_mwh   (unit) float64 ...
##     unit_max           (unit) float64 ...
##     unit_stomax        (unit) int64 ...
##     unit_min           (unit) float64 ...
##     unit_stomin        (unit) int64 ...
##     line_from          (line) int64 ...
##     line_to            (line) int64 ...
##     line_cap           (line) int64 ...
## Attributes:
##     created:          20/05/2020 21:44:19
##     hostname:         New-MacBook-Pro-2.local
##     model_folder:     db/test/
##     simulation_name:  test_run

CSV/TXT output

YAPOS model writes the following files at end the of the simulation:

  • prod.csv: daily generation for each generation unit
  • flow.csv: electricity flow for each transmission line, positive signs indicate a flow from the first zone to the second one specified in the line name (e.g. CH-IT)
  • shed.csv: shed load for each zone
  • curt.csv: curtailed electricity for each simulated zone
  • ws.csv: value of the water slack variable for each generation unit. This is the slack variable for the storage balance constraint
  • ss.sv: value of the storage slack variable for each generation unit. This is the slack variable for the minimum storage constraint
  • cs.sv: value of the curtailment slack variable for each zone. This is the slack variable for the maximum curtailment constraint
  • sl.csv: calculated storage level for all the generation units (included the units without any storage)
  • dual*.txt: a set of text files with the dual values for all the constraints. The data is written to file directly from the model.dual Pyomo objects.

Available simulations

About

A simple power system model at daily resolution written in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages