Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Simple EOPS example

In this example, we consider a simple EOPS (One-area Power-market Simulator) system consisting of a single reservoir, one power plant, and a busbar. The purpose is to illustrate the basic input requirements of the model. We will define the system using a JSON file, but the setup can also be done directly in Python, as demonstrated in the notebook live-ltm.

Loading...

The following sections begin by outlining the required attributes of an EOPS model. For each attribute, we first explain the required input, then show how it is configured in the JSON file for the example system. Note that many attributes support additional input parameters not covered here. We then briefly describe how to define connections and how scenarios functions in this example. Finally, we run the simulation and plot the results.

Global settings

The global settings must include the following input:

  • name: Object name

  • output_path: Output and runtime directory where LTM will read and write data

  • model_type: Specifies the simulator type. Options are "EOPS" (One-area Power-market Simulator) and "EMPS" (Multi-area Power-market Simulator). In this example, we use “EOPS”.

  • simulation_type: Can be set to either "serial" or "parallel".

    • In serial mode, each scenario starts from the final state of the previous one. This approach was historically used to simulate long time periods when computational power was limited.

    • In parallel mode, all scenarios begin from the same initial state, making them fully independent. (See notebook serial_vs_parallel for more)

  • timesteps_per_week: Defines the temporal resolution of the simulation. For example, a value of 7 corresponds to daily time steps.

  • intraweek_timesteps: Alternative to timesteps_per_week.
    Allows for explicit definition of intraweek segments using calendar timestamps and associated timestep indices. This enables non-uniform timestep configurations within a week (e.g., grouping weekdays and weekends separately). For details see, see the API documentation under “Timesteps per week”.

  • simulation_period: Simulation period represented by ON/OFF state (1 or 0) for each time step defined in timestamps. The simulation begins at the first timestamp, which must have an ON state (1), and runs continuously until the first OFF state (0) is encountered. Any states following the first OFF will be ignored, the simulation does not resume once stopped.

  • historical_type: Defines the calender system used to set the historical period. Options are "civillian" (civil calendar), "ISO" (ISO week calendar) or "EFI" (standardized calendar used in energy forecasting and modeling). This is implemented to prevent inconsistencies or alignment issues.

  • historical_period: Defines the time span over which historical data is collected. This period must span at least 8 years and meet the following criteria:

    • Start and end on 1. jan if historical_type is “civillian”.

    • Start and end on week W01 if historical_type is “ISO”.

    • Start on ISO week W01 and end on week N*52, where N is number of years, if historical_type is “EFI”.

    It is not strictly required to use timestamp formats that match the selected historical_type, as long as the conditions above are satisfied. For example, if historical_type is “civillian”, one may use 1980-W01-2 (second day of ISO week 1), which corresponds to 1980-01-01T00:00:00Z.Vice versa, if historical_type is “ISO”, one may use 1979-12-31T00:00:00Z, which corresponds to 1980-W01-1. However, for consistency and to avoid confusion, it is recommended to use timestamp formats that match the chosen historical_type.

    Note on historical data: Historical data refers to past energy or water inflow series. You are free to use your preferred timestamp type for historical data, as long as it covers the entire historical_period. A state defined at a timestamp remains in effect until a new value is provided. After the final value in the dataset, the system remains in a constant state. Therefore, the only strict requirement is that the first data point occurs at, or before, the start of the historical_period. While data can extend beyond the defined historical period, such values are ignored by the model.

Below is an example of how global settings can be configured in a JSON-file.

"global_settings": {
    "name": "eops_test",
    "output_path": "testout_EOPS/",
    "generate_output_dir": true, 
    "model_type": "EOPS",
    "simulation_type": "parallel",
    "simulation_period": {
        "timestamps": [
            "2024-W01",
            "2026-W01"
        ]
    },
    "historical_type": "ISO",
    "historical_period": {
        "timestamps": [
            "1979-W01",
            "1988-W01"
        ]
    },
    "timesteps_per_week": 7
},

Market steps

Market steps of type ts-spot must be defined for both purchase and sale for EOPS simulations. These define how much energy the system is allowed to buy from or sell to the spot market.

Each market step must include the following input:

  • name: Object name

  • capacity: A dictionary with:

    • timestamps: Time points at which capacity values are defined.

    • scenarios: Capacity values (in MW) corresponding to each timestamp.

Convention:

  • Exported energy (sales) is represented with negative values

  • Imported energy (purchases) is represented with positive values

Additional attributes can be assigned to a market step, all of which can be seen in the list of API attributes. If exogenous prices are used (as shown in exogeneous_prices_market_steps-notebook),the sign convention still applies to the capacity, not the price. Prices are always given as positive values, and the direction of the transaction is determined by the sign of the capacity.

In the example below, the market is set to be constant across time, with:

  • A maximum export of 20 MW (sale)

  • A maximum import of 10 MW (purchase)

"market_steps": [
            {
                "name": "ts_spot_sale",
                "capacity": {
                    "timestamps": [
                        "2024-W01"
                    ],
                    "scenarios": [
                        [
                            -20.0
                        ]
                    ]
                }
            },
            {
                "name": "ts_spot_purchase",
                "capacity": {
                    "timestamps": [
                        "2024-W01"
                    ],
                    "scenarios": [
                        [
                            10.0
                        ]
                    ]
                }
            }
        ],

Reservoirs

A reservoir must include the following input:

  • name: Object name

  • initial_volume: The reservoir’s storage volume at the beginning of the simulation, in Mm³.

  • max_discharge: The maximum outflow rate from the reservoir, in MW.

  • average_regulated_inflow: The average inflow under regulation, in m³/s.

  • reference_curve: Ideal reservoir trajectory, expressed as percentage filling.

    • timestamp: Time points at which the ideal filling is defined.

    • scenario: Filling level, in percent.

  • regulated_inflow: A time series representing the shape of the regulated inflow. The values are normalized and then scaled by the average regulated inflow. See the inflow-example notebook for further details.

  • volume_curve: A mapping from reservoir elevation to volume, with:

    • x: A list of volume values, in millions m³.

    • y: A list of elevation values corresponding to the volumes, in m. Ends represent the minimum and maximum possible elevations of the reservoir.

  • gross_head: The total vertical distance between the mean water surface elevation of the upstream reservoir and that of the downstream reservoir (which may be the ocean). in m.

  • tailrace_elevation: Elevation of the water surface at the tailrace (turbine outlet), in m above sea level.

Below is an example of how a reservoar can be configured in a JSON file.

"reservoirs": [
            {
                "name": "VITTINGFOSS",
                "average_regulated_inflow": 2.359381359381359,
                "initial_volume": 50,
                "max_discharge": 30,
                "reference_curve": {
                    "timestamps": [
                        "2024-04-22T00:00:00Z",
                        "2024-06-03T00:00:00Z",
                        "2024-12-30T00:00:00Z"
                    ],
                    "scenarios": [
                        [
                            95.01,
                            0.0,
                            95.0
                        ]
                    ]
                },
                "regulated_inflow": { 
                    Full inflow data is omitted here for readability. See the notebook inflow_example or the JSON file simple_eops.json for details.
                },
                "volume_curve": {
                    "x": [
                        1050,
                        1100
                    ],
                    "y": [
                        0,
                        100
                    ]
                }
            }
        ],

Plants

A plant must include the following input:

  • name: Object name

  • average_energy_equivalent: The average energy equivalent of spilled water, in kWh/m³.

  • discharge_energy_equivalent: A time series specifying how much energy (in MW) is produced per unit of discharge (in m³/s).

  • pq_curves: Maps discharge (x) to power output (y) from specific points in time. The curve should cover the full operational range of discharges.

  • average_unregulated_inflow: Average unregulated inflow (e.g., inflow downstream of a dam), in m³/s.

  • unregulated_inflow: A time series representing the shape of the unregulated inflow. The values are normalized and then scaled by the average unregulated inflow. See the inflow-example notebook for further details.

Below is an example of how a plant can be configured in a JSON file.

"plants": [
            {
                "name": "VITTINGFOSS_plant",
                "discharge_energy_equivalent": {
                    "timestamps": [
                        "2023-01-02T00:00:00Z"
                    ],
                    "scenarios": [
                        [
                            0.12
                        ]
                    ]
                },
                "pq_curves": {
                    "2024-01-01T00:00:00Z": {
                        "y": [
                            0.0,
                            9.89
                        ],
                        "x": [
                            0.0,
                            24.6
                        ]
                    }
                },
                "average_unregulated_inflow": 0.635938135938136,
                "gross_head": 40.0,
                "tailrace_elevation": 1030,
                "unregulated_inflow": {
                    Full inflow data is omitted here for readability. See the notebook inflow_example or the JSON file simple_eops.json for details.
                }
            }
        ],

Areas

The EOPS model requires the system to contain exactly one area.

An area must include the following input:

  • name: Object name

Below is an example of how an area can be configured in a JSON file.

"areas": [
            {
                "name": "numedal"
            }
        ],

Price series

For the EOPS model, a price_series_main must be provided. Secondary price series are not supported. The main price series defines expected external electricity prices used to calculate revenues from market sales and costs of market purchases.

The main price series must include the following input:

  • name: Object name

  • series: Contains the following:

    • timestamps: Time points corresponding to price changes.

    • scenarios: A list of price series (one per scenario), each aligned with the timestamps.

Prices are given in currency per MWh. The choice of currency is arbitrary, as it is not used internally by the model. For readability, the example below uses a reduced temporal resolution compared to the actual simulation.

"price_series_main": [
            {
                "name": "HOVEDPRISREKKE",
                "series": {
                    "timestamps": [
                        "2024-01-01T00:00:00Z",
                        "2024-05-01T00:00:00Z",
                        "2024-09-01T00:00:00Z",
                        "2025-01-01T00:00:00Z",
                        "2025-05-01T00:00:00Z",
                        "2025-09-01T00:00:00Z"
                    ],
                    "scenarios": [
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ],
                        [
                            114.81,
                            46.65,
                            26.45,
                            114.81,
                            46.65,
                            26.45
                        ]
                    ]
                }
            }
        ],

Connections

Connections defines the topology of the system by connecting its objects. In this example, connections are used to connect the market steps to the busbar numdedal, and to set up a simple hydro topology consisting of one reservoar with one power plant, also connected to the busbar numdal. It is important to ensure that one reservoir from each waterway (which may be chosen arbitrarily for larger waterways) is connected to the busbar. For details on how to model hydro topology, see the API documentation under API Waterways.

"connections": [
            {
                "from": "VITTINGFOSS",
                "to": "numedal"
            },
            {
                "from": "VITTINGFOSS",
                "to": "VITTINGFOSS_plant"
            },
            {
                "from": "ts_spot_sale",
                "to": "numedal"
            },
            {
                "from": "ts_spot_purchase",
                "to": "numedal"
            }
        ]

Scenarios

In this simple model, which does not include forecasting, each scenario consists of a repetition of historical data. Scenarios start at different points in time, spaced one year apart, and each continues for the full duration of the simulation period. As a result, the number of scenarios is equal to the number of years in the historical dataset. Specifically:

  • Scenario 0 begins at the first year of the historical period.

  • Scenario 1 starts one year later, and so on.

  • When a scenario reaches the end of the historical data, it continues from the beginning.

Simulation of the system

busbar: numedal
'Could not get water value results for numedal'
<Figure size 640x480 with 1 Axes>
<Figure size 640x480 with 1 Axes>
<Figure size 640x480 with 1 Axes>
<Figure size 640x480 with 1 Axes>
<Figure size 640x480 with 1 Axes>

The notebook eops-market extends this example by adding a demand to the system.