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:

In addition, please see this interactive example Code Ocean Capsule how to import a PSDM grid representation in Matlab for grid calculation purposes.

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
    • 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.
    • By default, the power factor direction of the rated power is set to "not defined", see docs at LoadPower - as_rated_power().
  • Remarks on export of transformer:

    • The impedances of all winding objects are referred to the high voltage side of the transformer.
    • The impedance of transformer earthing is an absolute natural value.
    • The zero sequence impedances are exported without considering the vector group, resulting zero sequence must be calculated separately by the user afterwards.
    • The zero sequence magnetising impedances are dependent on the wiring group, see docs at PowerFactoryExporter - create_transformer_2w().
  • 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.1.0 2.2.0 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
    
  • 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.1.0.tar.gz (61.9 kB view details)

Uploaded Source

Built Distribution

ieeh_powerfactory_tools-2.1.0-py3-none-any.whl (61.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for ieeh_powerfactory_tools-2.1.0.tar.gz
Algorithm Hash digest
SHA256 713df25013146dd197818efd15d251deb110874fe1c2d84b2c3860e28711198d
MD5 c4bf9716fbca689e16e3a981cba551d6
BLAKE2b-256 2d751e887168ef0d33be46eb9e8e885597edebeaebfc475e302780db6ddd0742

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ieeh_powerfactory_tools-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05a1ff95353c93af61b777e1276cf0737c29f6f2d3882003f9f6550b19388fcd
MD5 a2def5879900b1ecb5bff82eb3274d40
BLAKE2b-256 cbbaf6df581a3c798e1857b0fa74c10d2bc8c294db48b49883733e3e5a92b829

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