Model Data
Input Data Load
POMATWO.load_data — Method
load_data(data::Dict)Reads a collection of model input files specified by a dictionary and returns a fully populated Parameters struct for use in the market simulation.
Arguments
data::Dict{Symbol, String}: A dictionary mapping required and optional parameter names to file paths.
Required keys
The following keys must be included in data:
:plants- Plant specification file.:nodes- Node topology file.:zones- Zone definition file.:demand- Nodal or zonal demand input.:types- Technology or plant type definitions.
Optional keys
These keys can optionally be included to enable extended model functionality:
- Network:
:lines- AC transmission line definitions.:dclines- DC line definitions (requires:linesto be included).
- Availability and plant characteristics:
:avail- Plant availability.:avail_planttype_nodal- Availability by plant type and node.:avail_planttype_zonal- Availability by plant type and zone.:min_generation- Minimum generation constraints.
- Market and operation:
:ntc- Net Transfer Capacities between zones.:fixed_exchange- Fixed exchange schedules.:prs_demand- Prosumer demand profiles.:fuel_prices- Time-dependent fuel prices.:inflow- Storage inflow data (e.g. hydro).:historical_generation- Historical generation for calibration.
Some model features (e.g. redispatch or zonal availability mapping) depend on optional keys. Omitting them may disable those capabilities. The functionallity of optional file inputs and keys is currently not included in automated testing.
Example
data = Dict(
:plants => joinpath(datapath, "plants.csv"),
:nodes => joinpath(datapath, "nodes.csv"),
:zones => joinpath(datapath, "zones.csv"),
:lines => joinpath(datapath, "lines.csv"),
:dclines => joinpath(datapath, "dclines.csv"),
:demand => joinpath(datapath, "nodal_load.csv"),
:types => joinpath(datapath, "planttypes.csv"),
)
params = load_data(data)sourceModel Input Data Structure
The data that is read in using the load_data function. It has to be provided via separate csv files. In the following section, the structure of those files is described. Generally the column headers have to be identical to what is described as Column in the tables below. Table rows are created to add a data entry and should follow thy Type convention also specified below.
Input tables may reference each other via unique identifiers ('index'). It is crucial that these indices are consistent and unique across all files. For example, plant_type in File Structure :plants must match an index in :types File Structure :types, and node in File Structure :plants must match an index in File Structure :nodes.
File Structure :plants
Describes information about power plants and their attributes. Each row represents a different plant with the following columns:
| Column | Type | Description |
|---|---|---|
index | String | Unique identifier for the plant. |
plant_type | String | Type of power plant (e.g., wind, coal, etc.). |
node | String | Identifier for the network node to which the plant is connected. |
g_max | Integer | Maximum generation capacity of the plant (in MW). |
eta | Integer | Efficiency factor or binary flag for participation (typically 0 or 1). |
storage_capacity | Integer | Maximum storage capacity (in MWh), 0 if not applicable. |
lat | Float | Latitude of the plant's location. |
lon | Float | Longitude of the plant's location. |
storage_power | Float | Power limit of the storage system (in MW), may be NaN if not applicable. |
The plant_type column must match an index in File Structure :types. The node column must match an index in File Structure :nodes.
Example
| index | plant_type | node | g_max | eta | storage_capacity | lat | lon | storage_power |
|-------|------------|------|-------|-----|------------------|-----------|------------|----------------|
| p1 | wind | n1 | 140 | 1 | 0 | 49.978037 | 9.066645 | |
| p2 | coal | n2 | 300 | 1 | 0 | 51.489714 | 10.413338 | |Plants without storage systems have storage_capacity = 0 and storage_power = NaN. The eta column may represent conversion efficiency or a binary indicator, depending on the modeling context.
File Structure :types
Planttypes are described as follows:
| Column | Type | Description |
|---|---|---|
index | String | Name of the plant type (e.g., coal, wind). |
dispatchable | Integer | Indicates if the plant type is dispatchable (1) or not (0). |
storage | Integer | Indicates if the plant type has storage capability (1) or not (0). |
fuel_price | Integer | Fuel cost (arbitrary units or €/MWh). |
co2content | Integer | CO₂ emissions per unit of energy. |
prosumer | Integer | Indicates if the plant type supports prosumer behavior (1) or not (0). |
color | String | Hex color code used for visualization. |
The index column here is referenced by the plant_type column in File Structure :plants.
Example
| index | dispatchable | storage | fuel_price |
|----------|--------------|---------|------------|
| coal | 1 | 0 | 25 |
| wind | 1 | 0 | 7 |File Structure :avail, :avail_planttype_nodal, :avail_planttype_zonal
Availabilities for each time step can be defined. If no availabilities are defined the default of 1.0 is assumed. The values are used to scale the maximum generation or operational capacity of a plant or unit for each time step. The model will automatically assign the provided availibility with the highest level of detail according to the following hierachy:
| availibility type | description | hierarchy level |
|---|---|---|
:avail | Availability of a specific production unit | 1 |
:avail_planttype_nodal | Availability of a given plant_type at a specific node | 2 |
:avail_planttype_zonal | Availability of a given planttype at a specific zone | 3 |
| default | automatically assigned default value if no availibility is provided via data input files (defaults to 1) | 4 |
:avail
Availability of a specific production unit, specified by the column name.
| Column | Type | Description |
|---|---|---|
p1 | Float64 | factor between 0.0 and 1.0 |
p2 | Float64 | factor between 0.0 and 1.0 |
... | Float64 | factor between 0.0 and 1.0 |
Example
| p1 | p2 |
|--------|--------|
| 0.1 | 0.2 |
| 0.8 | 0.9 |
| 0.7 | 0.8 |
| 0 | 0 |Each column name must reference a production unit via the index defined in the index column of File Structure :plants
:avail_planttype_nodal
Availability of a respective node, specified by the column name.
| Column | Type | Description |
|---|---|---|
plant_type | String | specification of plant type |
n2 | Float64 | factor between 0.0 and 1.0 |
... | Float64 | factor between 0.0 and 1.0 |
Example :availplanttypenodal
| plant_type | n1 | n2 |
|--------|--------|--------|
| solar | 0.1 | 0.2 |
| solar | 0.8 | 0.9 |
| solar | 0.7 | 0.8 |
| solar | 0 | 0 |The plant type defined in the plant_type column must be defined in File Structure :types. Each column name after the plant_type column must reference a node via the index defined in the index column of File Structure :nodes.
:avail_planttype_zonal
Availability of a specified planttype at a given market zone.
| Column | Type | Description |
|---|---|---|
zone | String | specification of plant type |
type 1 | Float64 | factor between 0.0 and 1.0 |
type 2 | Float64 | factor between 0.0 and 1.0 |
... | Float64 | factor between 0.0 and 1.0 |
Example :availplanttypezonal
|zone | solar | wind |
|--------|--------|--------|
| DE | 0.1 | 0.4 |
| DE | 0.8 | 0.6 |
| DE | 0.7 | 0.8 |
| DE | 0 | 0.6 |The zone defined in the zone column must be defined in File Structure :zones. Each column name after the zone column must reference a plant type via the index defined in the index column of File Structure :types.
File Structure :demand
Contains the time series of load demand at each node.
| Column | Type | Description |
|---|---|---|
n1 | Integer | Load demand in MW at node n1 for each time step. (Example shown; actual structure may include multiple nodes.) |
n2 | Integer | Load demand in MW at node n2 for each time step. (Example shown; actual structure may include multiple nodes.) |
... | Integer | Load demand in MW at node nx for each time step. (Example shown; actual structure may include multiple nodes.) |
Example
| n1 |
|-----|
| 60 |
| 100 |
| 120 |
| 180 |
Each column name must reference a node via the index defined in the index column of File Structure :nodes
File Structure :zones
Specifies the geographic or administrative zones involved in the model.
| Column | Type | Description |
|---|---|---|
index | String | Identifier for the zone (e.g., DE). |
Index used in :avail_planttype_zonal and File Structure :nodes
Example
| index |
|--------|
| DE |File Structure :nodes
Defines all nodes in the network along with their geographic and zone information.
| Column | Type | Description |
|---|---|---|
index | String | Node identifier. |
zone | String | Zone the node belongs to. |
name | String | Human-readable node name. |
lat | Float | Latitude coordinate. |
lon | Float | Longitude coordinate. |
slack | Integer | Indicator for slack bus (1 if slack, otherwise 0). |
index used in File Structure :plants, :avail_planttype_nodal, File Structure :nodes and File Structure :lines. The zone defined in the zone column must be defined in File Structure :zones.
Example
| index | zone | name | lat | lon | slack |
|--------|------|----------------------|------------|------------|-------|
| n1 | DE | MUHLBACH | 47.907355 | 7.555917 | 1 |
| n2 | DE | Y-Otterbach | 49.487800 | 7.722690 | 0 |
| n3 | DE | Salzburg Elixhausen | 47.868229 | 13.076006 | 0 |File Structure :lines
Describes the properties of AC transmission lines between nodes.
| Column | Type | Description |
|---|---|---|
NE_name | String | Line name. |
node_i | String | From-node ID. |
node_j | String | To-node ID. |
voltage | Integer | Nominal voltage level (kV). |
r | Float | Line resistance (Ohms). |
x | Float | Line reactance (Ohms). |
b | Integer | Line susceptance (unitless). |
I_nom | Integer | Nominal current rating. |
capacity | Integer | Transmission capacity (MW). |
index | String | Line identifier (typically same as NE_name). |
lat_i | Float | Latitude of from-node. |
lon_i | Float | Longitude of from-node. |
lat_j | Float | Latitude of to-node. |
lon_j | Float | Longitude of to-node. |
node_i_name | String | Name of from-node. |
node_j_name | String | Name of to-node. |
The node ID defined in the node_i and node_j column must be defined in File Structure :nodes.
Example
| NE_name | node_i | node_j | voltage | r | x | b | I_nom | capacity | index | lat_i | lon_i | lat_j | lon_j | node_i_name | node_j_name |
|---------|--------|--------|---------|--------|---------|---|--------|----------|--------|-----------|-----------|-----------|-----------|--------------|--------------|
| l1 | n1 | n2 | 220 | 4.0937 | 18.349 | 1 | 790 | 30 | l1 | 47.907355 | 7.555917 | 49.487800 | 7.722690 | Eula | Roehrsdorf |
| l2 | n2 | n3 | 220 | 7.5895 | 31.888 | 1 | 790 | 100 | l2 | 49.487800 | 7.722690 | 47.868229 | 13.076006 | Roehrsdorf | Weida |
| l3 | n1 | n3 | 220 | 7.5895 | 31.888 | 1 | 790 | 100 | l3 | 47.907355 | 7.555917 | 547.868229| 13.076006 | Weida | Eula |File Structure :dclines
Describes the properties of DC transmission lines between nodes.
| Column | Type | Description |
|---|---|---|
index | String | Line identifier. |
node_i | String | From-node ID. |
node_j | String | To-node ID. |
lat_i | String | Latitude of from-node. |
lon_i | String | Longitude of from-node. |
lat_j | String | Latitude of to-node. |
lon_j | String | Longitude of to-node. |
capacity | String | Capacity of the DC line. |
The node ID defined in the node_i and node_j column must be defined in File Structure :nodes.
Example
| index | node_i | node_j | lat_i | lon_i | lat_j | lon_j | capacity |
|---------|--------|--------|--------|--------|--------|--------|----------|Prosumers: File Structure generation
Prosumer generators are described analogously to plants File Structure :plants.
The column node must be defined in File Structure :nodes. The index is used in Prosumers: File Structure :prs_demand.
Prosumers: File Structure :prs_demand
Contains the time series demand for prosumer nodes.
| Column | Type | Description |
|---|---|---|
prs_n1 | Integer | Electricity demand (in MW) for the prosumer at node n1 for each time step. (Additional prosumer columns may be present in the full dataset.) |
The column name must be defined in Prosumers: File Structure generation.
Example
| prs_n1 |
|--------|
| 20 |
| 10 |
| 30 |
| 0 |Parameters
Based on the given input data, a Parameters struct is created.
POMATWO.Parameters — Type
ParametersContainer structure for all static and time-varying input data used in a power system model.
This struct encapsulates metadata, technical parameters, profiles, and mappings for generation units, nodes, transmission infrastructure, demand, and other components relevant to electricity system modeling. It is typically used as a central configuration object passed to optimization or simulation routines.
Fields
Sets
sets::Sets: Collection of index sets (e.g., nodes, plants, zones) used across the model.
Power plant parameters
gmax::Dict{String,Float64}: Maximum generation capacity per plant.eta::Dict{String,Float64}: Efficiency of each plant.gmax_storage::Dict{String,Float64}: Maximum generation capacity from storage units.storage::Dict{String,Float64}: Energy storage capacity.mc::Dict{String,Profile}: Marginal costs as time series profiles per plant.avail::Dict{String,Profile}: Availability factor per plant over time.avail_planttype_nodal::Dict{Tuple{String,String},Profile}: Time-dependent availability by (node, plant type).avail_planttype_zonal::Dict{Tuple{String,String},Profile}: Time-dependent availability by (zone, plant type).plant_type::Dict{String,String}: Mapping from plant name to plant type.
Plant type metadata
plant_type2color::Dict{String,String}: Color coding for each plant type (for plotting).dispatchable::Vector{String}: List of dispatchable plant types.nondispatchable::Vector{String}: List of non-dispatchable plant types.storage_types::Vector{String}: List of storage technologies.fuel_price::Dict{String,Profile}: Time-varying fuel price per plant type.co2content::Dict{String,Float64}: CO₂ emissions per MWh of each plant type.historical_generation::Dict{String,Profile}: Historical generation profiles.min_generation::Dict{String,Profile}: Minimum generation profiles.
Node parameters
slack::Vector{String}: Names of slack buses (reference nodes).node2zone::Dict{String,String}: Mapping from node to zone.node_coords::Dict{String,Vector{Float64}}: Coordinates of nodes (e.g., for plotting or distance-based calculations).
AC line parameters
acline_capacity::Dict{String,Float64}: Thermal capacity of each AC line.resistance::Dict{String,Float64}: Resistance per AC line.reactance::Dict{String,Float64}: Reactance per AC line.bvector::Dict{String,Float64}: Susceptance of each AC line.circuits::Dict{String,Int64}: Number of circuits per line.voltage::Dict{String,Float64}: Voltage level of each line.line_start::Dict{String,String}: Start node of each AC line.line_end::Dict{String,String}: End node of each AC line.b::Dict{Tuple{String,String},Float64}: Line susceptance between node pairs.h::Dict{Tuple{String,String},Float64}: Network matrix entries used in power flow approximations.ptdf::Dict{Tuple{String,String},Float64}: Power Transfer Distribution Factors between (line, node) pairs.
DC line parameters
dcline_capacity::Dict{String,Float64}: Transfer capacity of each DC line.dc_start::Dict{String,String}: Start node of each DC line.dc_end::Dict{String,String}: End node of each DC line.
Demand parameters
nodal_load::Dict{String,Profile}: Time series of nodal demand.zonal_load::Dict{String,Profile}: Time series of zonal demand.inflow::Dict{String,Profile}: Time-dependent inflows to storage (e.g., hydro).fixed_exchange::Dict{String,Profile}: Fixed cross-border or interzonal exchanges (e.g., from contracts or historical data).
Zone parameters
ntc::Dict{Tuple{String,String},Float64}: Net transfer capacity between zones.
Prosumer parameters
prosumer_types::Vector{String}: List of prosumer types modeled.prs_demand::Dict{String,Profile}: Time series of demand from prosumers.nodal_load_no_prs::Dict{String,Profile}: Nodal demand excluding prosumer influence.
Mapping data
nodes_in_zone::Dict{String,Vector{String}}: List of nodes per zone.plants_in_zone::Dict{String,Vector{String}}: Plants located in each zone.storages_in_zone::Dict{String,Vector{String}}: Storage units in each zone.plants_in_node::Dict{String,Vector{String}}: Plants located at each node.storages_in_node::Dict{String,Vector{String}}: Storage units at each node.plant2node::Dict{String,String}: Node location of each plant.plant2zone::Dict{String,String}: Zone location of each plant.importing_ntcs::Dict{String,Vector{String}}: NTCs importing into a given zone.exporting_ntcs::Dict{String,Vector{String}}: NTCs exporting from a given zone.
Plotting parameters
colors::Dict{String,String}: Color mapping for zones, nodes, or technologies (used in visualization).