Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is s2_mpc?

s2_mpc is a seasonal stochastic model predictive control (MPC) framework for optimizing the operation of energy systems with short-term to seasonal storage under forecast uncertainty.

Using long-term scenarios and matching stochastic forecasts generated by ents_casting, simulates realistic energy system operation over multiple weather years while accounting for forecast uncertainty and seasonal storage management.

flowchart TD
    A[Historical measured data] --> B[ents_casting]
    B --> C["Long-term scenarios<br/>and stochastic forecasts"]

    C --> F[s2_mpc]
    D["Energy system configuration<br/><code>input_dict.txt</code>"] --> F
    E["Configuration<br/><code>config.yaml</code>"] --> F

    F --> G["Storage level trajectories<br/>and KPIs"]
Loading

Exemplary seasonal storage-level trajectory generated with s2_mpc


Installation

Clone the repository:

git clone https://github.com/RWTH-LTT/s2_mpc.git

Create a virtual environment:

python3 -m venv ./venv_s2_mpc

Activate the virtual environment:

. venv_s2_mpc/Scripts/activate

If you already use a virtual environment for ents_casting, you can reuse that environment.

Install s2_mpc together with all required dependencies:

pip install -e ./s2_mpc

Getting started

Configure config.yaml

config.yaml contains all settings required for the optimization, including:

  • the path to the ents_casting data directory,
  • the energy system to optimize,
  • the MPC look-ahead horizon,
  • the number of stochastic forecast scenarios,
  • Gurobi solver settings, and
  • the method used to mitigate the end-of-horizon effect (including the forecast-updated annual cost-to-go).

The default configuration is sufficient for a first test run.

Configure the energy system

Two exemplary energy systems are currently provided:

  • input_dict_honda.txt
  • input_dict_flensburg.txt

Provide ents_casting data

s2_mpc requires long-term scenarios and stochastic forecasts generated by ents_casting. Ensure that these datasets are available in the directory specified in config.yaml.


Run the optimization

Run the complete workflow:

python -m s2_mpc

Command-line arguments described in __main__.py can be used to overwrite the corresponding settings in config.yaml.

Many stages of the workflow can also be executed individually and parallelized using MPI.

Intermediate results are written to:

data_results/01-COMPUTED-INPUT

Final optimization results are written to:

data_results/02-RESULTS

Authors

s2_mpc has been at the Institute of Technical Thermodynamics (RWTH Aachen University) by:

  • Benedict Brosius
  • Judith Zoeller
  • Mats Zoellmann
  • Stefan Helders
  • Jan Wilberg

Citation

If s2_mpc supports your research, please cite:

Brosius, B., Zoeller, J., Zoellmann, M., Helders, S., Nilges, B., Schricker, H., & von der Assen, N. (2026). Model predictive control of smart energy systems with seasonal storage: Mitigating the end-of-horizon effect via stochastic dynamic programming. Energy Conversion and Management: X. https://doi.org/10.1016/j.ecmx.2026.102138

License

BSD 3-Clause License

About

Model predictive control framework for optimizing the operation of energy systems with short-term to seasonal storage under forecast uncertainty.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages