Skip to main content

A toolbox for Python based control of DIgSILENT PowerFactory

Project description

IEEH PowerFactory Tools

License

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:

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 / cable
    • ElmTerm - a network terminal / bus
    • ElmCoup - a bus-bus switch (e.g. a circuit breaker in a detailed switching gear)
    • ElmTr2 - a symmetrical 2-winding transformers
    • ElmTr3 - a symmetrical 3-winding transformers (in future releases)
    • ElmLod - a general load (asym. / sym.)
    • ElmLodMv - a medium voltage load
    • ElmLodLv - a low voltage load
    • ElmLodLvp - a partial low voltage load
    • ElmPvsys - a PV system (generator)
    • ElmGenstat - a static generator
    • ElmIac - a AC current source
    • ElmXNet - an external grid representation
    • RelFuse - 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.

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.

DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ieeh_powerfactory_tools-2.0.0.tar.gz (58.7 kB view details)

Uploaded Source

Built Distribution

ieeh_powerfactory_tools-2.0.0-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

File details

Details for the file ieeh_powerfactory_tools-2.0.0.tar.gz.

File metadata

File hashes

Hashes for ieeh_powerfactory_tools-2.0.0.tar.gz
Algorithm Hash digest
SHA256 a5681189000d86fcf4981610b3f499474b9e422301680ebe46e221fb11666228
MD5 d8f1c12afbf8add77417bc2114e09ad8
BLAKE2b-256 0945c454482d5ce7098804f9e53f1e439b9d6ffa138fe39065ee9617af2d7c57

See more details on using hashes here.

File details

Details for the file ieeh_powerfactory_tools-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ieeh_powerfactory_tools-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bad43ebbcdbfd8427bae8f1ef98cd95a689ce261cd663c0ce8653110910f5c23
MD5 fd6735263371173269496e08f1d2ca66
BLAKE2b-256 06d2136dbbc54fc6cd703d29da3fbdd5154289f182dc9033907b2c4a12f6ca8d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page