Skip to main content

Midas Powergrid Simulator

This package contains a Midas module providing a pandapower simulator and a number of custom powergrids.

Although this package is intended to be used with midas, but you can use in any mosaik simulation scenario.

Version: 2.1

Installation

This package will usually installed automatically together with midas-mosaik if you opt-in any of the extras, e.g., base or bh. It is available on pypi, so you can install it manually with

pip install midas-powergrid

Usage

The complete documentation is available at https://midas-mosaik.gitlab.io/midas.

Inside of midas

To use the powergrid inside of midas, just add powergrid to your modules

my_scenario:
  modules:
    - powergrid
    - ...

and configure it with (gridfile is required, everything else is optional and can be left out if the default values, shown below, are used):

  powergrid_params:
    my_grid_scope:
      gridfile: midasmv
      grid_params: {}
      step_size: 900
      plotting: False
      plot_path: _plots # Output path defined in runtime config
      save_grid_json: False

All simulators that want to connect to this grid, will have to use my_grid_scope as their grid_name value. Activating the plotting will results in a considerably longer execution time. Activate it only if you really need this feature and it does not work for all of the grids.

The gridfile can be either a path to a .json or .xlsx file, a simbench grid code, one of cigre_hv, cigre_mv, cigre_lv, midasmv, midaslv, or bhv, or an import path to a function or class that either returns a valid pandapower grid or is a pandapower grid itself. The grid_params can be used to pass keywork arguments to custom grids.

Any mosaik scenario

If you don't use midas, you can add the powergrid manually to your mosaik scenario file. First, the entry in the sim_config:

sim_config = {
    "Powergrid": {"python": "midas_powergrid.simulator:PandapowerSimulator"}
    # ...
}

Next, you need to start the simulator (assuming a step_size of 900):

powergrid_sim = world.start("Powergrid", step_size=900)

Finally, the model needs to be started:

powergrid = powergrid_sim.Grid(gridfile="midasmv", grid_params={})

To connect the output of the grids' buses to another model, you have to get the list of bus models from the powergrids' children like

bus_models = [e for e in powergrid.children if "bus" in e.eid]

and then connect those models either individually or in a loop, e.g.,

for bus in bus_models:
    world.connect(bus, other_entity, "vm_pu", "va_degree", "p_mw", "q_mvar")

The inputs are generally handled in the same way. Have a look at powergrid.children to get the required entity eids.

License

This software is released under the GNU Lesser General Public License (LGPL). See the license file for more information about the details.

Metadata

Release files for midas-powergrid 2.1.4

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

Source distribution (sdist)

Source distribution for midas-powergrid 2.1.4
File Size Uploaded
midas_powergrid-2.1.4.tar.gz 63.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for midas-powergrid 2.1.4
File Interpreter ABI Platform
midas_powergrid-2.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 121.3 kB

Release files / midas_powergrid-2.1.4.tar.gz

Download URL midas_powergrid-2.1.4.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
69dadb1e0b5b4a8716fa08ca96ca46dcb39e657574270b7ad3ba422f2425f6cf
BLAKE2b-256 checksum
How to use checksums
61387199ce37442fe09c1f7c2e524bcbd48c08e7f30b0dbc0f8fc0856b2ee734
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / midas_powergrid-2.1.4-py3-none-any.whl

Download URL midas_powergrid-2.1.4-py3-none-any.whl
Size 58.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11adb5ba4e7e3d37c348c692003c5acc6b46d352c1c9be29ffd7eee7fc249427
BLAKE2b-256 checksum
How to use checksums
b11ce72f5a860c6b0b63e09584863fd6d564dc7e217e7025f02cbb3639ead0f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

2.1.4 This release

2 release files

2.1.3

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

1 release file

1.0.14

2 release files

1.0.13

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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