Digitalized-Energy-Systems / opfgym

A gymnasium-compatible framework to create reinforcement learning (RL) environment for solving the optimal power flow (OPF) problem. Contains five OPF benchmark environments for comparable research.
https://opf-gym.readthedocs.io
MIT License
2 stars 0 forks source link
action-shaping benchmark contextual-bandit energy-system environment environment-design gymnasium opf optimal-power-flow pandapower power-system reinforcement-learning reward-design reward-shaping rl supervised-learning

PyPi | Read the Docs | Github | mail

lifecycle MIT License Test OPF-gym

General

A set of benchmark environments to solve the Optimal Power Flow (OPF) problem with reinforcement learning (RL) algorithms. It is also easily possible to create custom OPF environments. All environments use the gymnasium API. The modelling of the power systems and the calculation of power flows happens with pandapower. The benchmark power grids and time-series data of loads and generators are taken from SimBench.

Documentation can be found on https://opf-gym.readthedocs.io/en/latest/.

Warning: The whole repository is work-in-progress. Feel free to use the environments as benchmarks for your research. However, the environments can be expected to change slightly in the next months. The release of version 1.0 is planned for winter 2024. Afterward, the benchmarks will be kept as stable as possible.

If you want to use the benchmark environments or the general framework to build own environments, please cite the following publication, where the framework is first mentioned (in an early stage): https://doi.org/10.1016/j.egyai.2024.100410

Installation

Run pip install opfgym within some kind of virtual env. For contributing, clone the repository and run pip install -e .. Tested for python 3.10.

Environments

Currently, five OPF benchmark environments are available.

Additionally, some example environments for more advanced features can be found in opfgym/examples.

Working With the Framework

All environments use the gymnasium API:

On top, some additional OPF-specfic features are implemented:

Contribution

Any kind of contribution is welcome! Feel free to create issues or merge requests. Also, additional benchmark environment are highly appreciated. For example, the examples environments could be refined to difficult but solvable RL-OPF benchmarks. Here, it would be especially helpful to incorporate an OPF solver that is more capable than the very limited pandapower OPF. For example, it should be able to deal with multi-stage problems, discrete actuators like switches, and stochastic problems, which the pandapower OPF can't. For questions, feedback, collaboration, etc., contact thomas.wolgast@uni-oldenburg.de.