A simulator for pandapower grids.
Project description
Midas Powergrid Simulator
Description
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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file midas_powergrid-2.1.0a6.tar.gz.
File metadata
- Download URL: midas_powergrid-2.1.0a6.tar.gz
- Upload date:
- Size: 48.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2632436d0039a8011f03181a55f98dcfe7a52f400f96448d38fbb84e1f6318a0
|
|
| MD5 |
788734456143936f1205b791e1cc4ab3
|
|
| BLAKE2b-256 |
81ad77abd3423463c5ce2704e6e4ac03deb5847381490577aa3241ff1cdb53d7
|
File details
Details for the file midas_powergrid-2.1.0a6-py3-none-any.whl.
File metadata
- Download URL: midas_powergrid-2.1.0a6-py3-none-any.whl
- Upload date:
- Size: 49.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e19a7a87d5a562c64d940c5ae4d5314cecec37f9daafadeb200b02e0763c981
|
|
| MD5 |
95bae9d5d5cd2b2714c1134f8cb4836d
|
|
| BLAKE2b-256 |
9572450fa20eb3cf5fcc2088ca86444bdb884587c700438b7d7bf4c8463efdf9
|