Skip to main content

OpenModelica Microgrid Gym

https://travis-ci.org/upb-lea/openmodelica-microgrid-gym.svg?branch=master https://img.shields.io/badge/doc-success-success https://codecov.io/gh/upb-lea/openmodelica-microgrid-gym/branch/master/graph/badge.svg https://img.shields.io/pypi/v/openmodelica_microgrid_gym.svg Updates https://img.shields.io/github/license/upb-lea/openmodelica-microgrid-gym
https://github.com/upb-lea/openmodelica-microgrid-gym/raw/master/docs/pictures/microgrid.jpg

The OpenModelica Microgrid Gym (OMG) package is a software toolbox for the simulation and control optimization of microgrids based on energy conversion by power electronic converters.

The main characteristics of the toolbox are the plug-and-play grid design and simulation in OpenModelica as well as the ready-to-go approach of intuitive reinfrocement learning (RL) approaches through a Python interface.

The OMG toolbox is built upon the OpenAI Gym environment definition framework. Therefore, the toolbox is specifically designed for running reinforcement learning algorithms to train agents controlling power electronic converters in microgrids. Nevertheless, also arbritary classical control approaches can be combined and tested using the OMG interface.

Installation

Install Python environment

  • Install OpenModelica MicrogridGym from PyPI (recommended):

    $ pip install openmodelica_microgrid_gym
  • Or install from Github source:

    $ git clone https://github.com/upb-lea/openmodelica-microgrid-gym.git
    $ cd openmodelica_microgrid_gym
    $ python setup.py install

Hint: PyFMI might throw some errors while installing via pip. It can be installed via conda by running:

$ conda install -c conda-forge pyfmi

Installation of OpenModelica

OMG was create by using OMEdit v1.16

In this case, try to download the pre-built virtual machine.

Getting started

OMG uses the FMI standard for the exchange of the model between OpenModelica and python.

An example network consisting out of two inverters, three filters and an inductive load.

https://github.com/upb-lea/openmodelica-microgrid-gym/raw/master/docs/pictures/omedit.jpg

You can either use one of the provided FMUs (Windows and Linux, 64-bit, both included in the grid.network.fmu) or create your own by running:

openmodelica_microgrid_gym\fmu> omc create_fmu.mos

Running the staticctrl.py starts a simulation with a manually tuned cascaded PIPI controller

https://github.com/upb-lea/openmodelica-microgrid-gym/raw/master/docs/pictures/control.jpg

A save Bayesian approach of a reinforcement learning agent is provided under examples/berkamkamp.py.

https://github.com/upb-lea/openmodelica-microgrid-gym/raw/master/docs/pictures/kp_kp_J.png

Every user defined settings can be directly done in the example program.

env = gym.make(environment-id, **kwargs)

Returns an instantiated grid environment. Provide any additional settings right here (see full documentation for all possibilities)

Citation

A whitepaper for this framework will be avaiable soon. Please use the following BibTeX entry for citing us:

@misc{LEA2020XXXXXXX,
    title={XXXXXXXXXX},
    author={Daniel Weber and Stefan Heid and Henrik Bode and Oliver Wallscheid},
    year={2020},
    eprint={XXXXX},
    archivePrefix={arXiv},
    primaryClass={eess.SY}
}

Contributing

Please refer to the contribution guide.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.2 (2020-05-04)

  • corrected pip install requirements

0.1.1 (2020-04-22)

  • First release on PyPI.

Metadata

Release files for openmodelica-microgrid-gym 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openmodelica-microgrid-gym 0.1.2
File Size Uploaded
openmodelica_microgrid_gym-0.1.2.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for openmodelica-microgrid-gym 0.1.2
File Interpreter ABI Platform
openmodelica_microgrid_gym-0.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 1.1 MB

Release files / openmodelica_microgrid_gym-0.1.2.tar.gz

Download URL openmodelica_microgrid_gym-0.1.2.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
6037ba884464710666bc4abe98eb5c5fd88f7d295356f2d0720dd5d32aab0162
BLAKE2b-256 checksum
How to use checksums
2d46046f2cb6a22f55d0bf4a53800cb859eaf23896c25dd4a903b2c9cbfe8690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

Release files / openmodelica_microgrid_gym-0.1.2-py2.py3-none-any.whl

Download URL openmodelica_microgrid_gym-0.1.2-py2.py3-none-any.whl
Size 43.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2553674d2c2bd257aa098699dd984a4ff5cdcd1298f3e9a2efc619cdc1e29729
BLAKE2b-256 checksum
How to use checksums
959e35a5931fe36e30186089e8521c0d9fe9509df98b5156c86ce4141cdc32f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page