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, it does not depend from anything MIDAS-related except for the midas-util
package. You can use in any mosaik simulation scenario.
Installation
This package will usually installed automatically together with midas-mosaik
. 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.
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, plotting=False, plot_path="path/to/store/plots")
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
File details
Details for the file midas_powergrid-2.0.0a2.tar.gz
.
File metadata
- Download URL: midas_powergrid-2.0.0a2.tar.gz
- Upload date:
- Size: 41.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345e4fb8888ed5b71c62bccc6cc6f130b51992538203c2c435ed916c3853dcd6 |
|
MD5 | dfe30b9fc8fc5033098dc78887da0045 |
|
BLAKE2b-256 | 8604e42fbbd610951fe5f346e64f2c8a5d5772b8120efc8b460ca227a9d7c484 |
File details
Details for the file midas_powergrid-2.0.0a2-py3-none-any.whl
.
File metadata
- Download URL: midas_powergrid-2.0.0a2-py3-none-any.whl
- Upload date:
- Size: 48.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 172d0d9b39bf191cc76eda8907d57a8b7b43fb721a510db857f689aea5defc14 |
|
MD5 | 569dce1c91e810f08e9c8bb67a40e7aa |
|
BLAKE2b-256 | a6891385742e867d590f516284deffc5d770b4087d7dae5065caebdb5ebe6747 |