Skip to main content

PFPy - PowerFactory with Python

Documentation Status

PFPy provides a wrapper around PowerFactory's Python API with additional features in pfpy.pf. Furthermore, pfpy.models provides a high-level access to PowerFactory models, e.g. via:

  • model.simulate()
  • model.linearize()
  • model.set_params()

It has been developed at the Division of Electric Power and Energy Systems, KTH Royal Institute of Technology.

The code has been tested with PowerFactory 2019 and PowerFactory 2020. Note that $PYTHONPATH needs to point to the PowerFactory Python API.

Examples

The PowerFactory model used in all of the examples is located in ./examples/data/models/PFPY_DEMO.pfd

Simulation Example

The simulation of the aforementioned model is demonstrated in the simulation example. The model contains a controllable voltage source at the PCC. CSV files are generated that are replayed at the PCC, simulation is executed and the results are plotted.

Linearization Examples

The same model is linearized as seen from the PCC in the following Jupyter notebook. When compared to the linearization in PowerFacory, this code, in addition to the A matrix, provides also B,C, and D matrices.

Documentation

Automatically generated documentation from docstrings can be found here.

Acknowledgments

Parts of this code were inspired by the following book: Francisco Gonzalez-Longatt, José Luis Rueda Torres, Advanced Smart Grid Functionalities Based on PowerFactory, Springer, 2017

Metadata

Release files for pfpy 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pfpy 0.0.2
File Size Uploaded
pfpy-0.0.2.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pfpy 0.0.2
File Interpreter ABI Platform
pfpy-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 32.7 kB

Release files / pfpy-0.0.2.tar.gz

Download URL pfpy-0.0.2.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fab7cf9954ff0d3743a72a10006d6fc5359358d15079b5b1697a95a2c712842d
BLAKE2b-256 checksum
How to use checksums
4d2e048c8ce10c0f6f3f872f717deeb37d09a3b22ea03461a687f7cf3651644a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

Release files / pfpy-0.0.2-py3-none-any.whl

Download URL pfpy-0.0.2-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82bf38490e87a7315d97c9db4ff9c157208f12591981ca1f67511321e35d6104
BLAKE2b-256 checksum
How to use checksums
69ef6f93495162dc2218e20feef58e7d01602c3f6c3f2dc22f82217fd9291e4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page