A toolbox for Python based control of DIgSILENT PowerFactory
Project description
IEEH PowerFactory Tools
A toolbox for Python based control of DIgSILENT PowerFactory.
Field of Application
This application is intended to use for an external usage ('engine mode') of the power flow calculation program DIgSILENT PowerFactory. Therefore, the Python-PowerFactory-API, provided by the company, is utilized.
The following functionalities are provided:
- export of calculation relevant grid data from a PowerFactory project to the IEEH Power System Data Model
- basic control of PowerFactory
- [intended in future release] import from external grid data into the PowerFactory environment
Tutorials
Please consider the README in the example section. Here, Jupyter notebooks are provided to get in touch with the usage of this toolbox:
- for export: powerfactory_export.ipynb
- for control: powerfactory_control.ipynb
General Remarks on Export
Please find below some important general remarks and assumptions to consider for the application:
General
After successful connection to PowerFactory via PowerFactoryInterface, a temporary unit conversion to default values is automatically performed to have a project setting independent behavior. The units are reset when the interface is closed. During an active connection, the following units apply:
- power in MW
- voltage in kV
- current in kA
- length in km
Exporter
-
The grid export follows the rules of usage recommended by psdm:
- The passive sign convention is used for all types of loads (consumer as well as producer).
- The
Rated Power
is always defined positive (absolute value).
-
By default, all assests of all active grids within the selected study case are to be exported, see example readme.
-
The following type of elements are supported:
ElmLne
- a symmetrical overhead line / cableElmTerm
- a network terminal / busElmCoup
- a bus-bus switch (e.g. a circuit breaker in a detailed switching gear)ElmTr2
- a symmetrical 2-winding transformersElmTr3
- a symmetrical 3-winding transformers (in future releases)ElmLod
- a general load (asym. / sym.)ElmLodMv
- a medium voltage loadElmLodLv
- a low voltage loadElmLodLvp
- a partial low voltage loadElmPvsys
- a PV system (generator)ElmGenstat
- a static generatorElmIac
- a AC current sourceElmXNet
- an external grid representationRelFuse
- a fuse (bus-bus or bus-load)
-
Remarks on export of
loads
:- Be aware that the reference voltage of the load model must not match the nominal voltage of the terminal the load is connected to.
-
Remarks on export of
transformer
:- Impedances of all winding objects are referred to the high voltage side of the transformer.
- Zero sequence impedances are exported without considering the vector group, resulting zero sequence must be calculated separately by the user afterwards.
-
Remarks on export of
fuses
:- Branch like fuses are exported as switching state.
- Element fuses does not apply a switching state by their own in PowerFactory but considered in export as applicable switching state.
-
Remarks on export of
SteadyStateCase
:- The operating points of the loads are specified by the controller and the associated load model in the topology for active or reactive power.
- By default a consumer load has a CosPhiConst type controller, except in the case where active and reactive power are explicitly specified in the load flow mask in PowerFactory.
- It is assumed, that a station controller (if relevant) is exclusively assigned to a single generator. The generator itself ought to be parameterized in the same way as the station controller to ensure that the exported q operating point is the same that set by the station controller.
- The operating points of the loads are specified by the controller and the associated load model in the topology for active or reactive power.
Installation
Just install via pip:
pip install ieeh-powerfactory-tools
Compatibility
Tools Version | PSDM Version | PowerFactory Version | Python Version |
---|---|---|---|
<= 1.3.1 | 1.1.0 | 2022 | 3.9, 3.10 |
1.4.x | 1.1.0 | 2022 | 3.10 |
1.5.1 | 1.3.0 | 2022 | 3.10 |
2.0.0 | 2.1.1 | 2022 | 3.10 |
Starting with PowerFactory 2023
, a new model for LV and MV loads is available as well as e.g. the result structure of harmonic load flow has changed. Also Python 3.11
can be used. Related adjustments are on schedule for the next mayor release 3.x
Development
Install pdm
Windows:
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py -UseBasicParsing).Content | python -
Linux/Mac:
curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -
Or using pipx or pip:
pipx install pdm
pip install --user pdm
Clone powerfactory-tools
git@github.com:ieeh-tu-dresden/powerfactory-tools.git
cd powerfactory-tools
Install powerfactory-tools
as a production tool
pdm install --prod
Install powerfactory-tools
in development mode
pdm install
For development in Visual Studio Code, all configurations are already provided:
Acknowledgement
Please note that this work is part of research activities and is still under active development.
This code was tested with DIgSILENT PowerFactory 2021 SP5
(version < 1.4) and DIgSILENT PowerFactory 2022 SP2
.
Attribution
Please provide a link to this repository:
https://github.com/ieeh-tu-dresden/powerfactory-tools
Please cite as:
Institute of Electrical Power Systems and High Voltage Engineering - TU Dresden, PowerFactory Tools - A toolbox for Python based control of DIgSILENT PowerFactory, Zenodo, 2022. https://doi.org/10.5281/zenodo.7074968.
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 ieeh_powerfactory_tools-2.0.0.tar.gz
.
File metadata
- Download URL: ieeh_powerfactory_tools-2.0.0.tar.gz
- Upload date:
- Size: 58.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.11.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5681189000d86fcf4981610b3f499474b9e422301680ebe46e221fb11666228 |
|
MD5 | d8f1c12afbf8add77417bc2114e09ad8 |
|
BLAKE2b-256 | 0945c454482d5ce7098804f9e53f1e439b9d6ffa138fe39065ee9617af2d7c57 |
File details
Details for the file ieeh_powerfactory_tools-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: ieeh_powerfactory_tools-2.0.0-py3-none-any.whl
- Upload date:
- Size: 59.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.11.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad43ebbcdbfd8427bae8f1ef98cd95a689ce261cd663c0ce8653110910f5c23 |
|
MD5 | fd6735263371173269496e08f1d2ca66 |
|
BLAKE2b-256 | 06d2136dbbc54fc6cd703d29da3fbdd5154289f182dc9033907b2c4a12f6ca8d |