PGM Documentation

Data Conversions Documentation

Mailing List





To face the challenges of the energy transition, many statistical and machine learning methods are required for distribution power system analysis, which usually requires power system calculations (preferably in parallel) for a substantial number of simulation cases/scenarios. 

Power Grid Model is a high-performance Python/C++ library for steady-state distribution power system analysis. Compared to similar tools, Power Grid Model offers:

  • Optimized algorithms for the characteristics of the distribution grid.
  • Full support of three-phase asymmetric calculation.
  • Efficient C++ implementation with native parallel computing support.

Use cases include:

  • Monte-Carlo low voltage grid simulations of different scenarios of EV and PV penetrations in the coming decades. Analysis of potential bottleneck of LV grids.
  • Simulations of different potential grid expansion plans in profile calculations over future decades.
  • Real-time what-if analysis (of component failing or other anomalies) for the current grid state.


The project consists of two main libraries: power-grid-model and power-grid-model-io.


The library power-grid-model is the main calculation library. It is written in C++ with native shared-memory multi-threading for parallelization in batch calculations. The library provides a C-API (with dynamic shared object) and a user-friendly Python API. The tool works across platforms including Windows (x64), Linux (x64/arm64), and macOS (x64/arm64), and publishes binary Python packages in official PyPI. 

The architecture of the library is shown below. The calculation core is a C++ header only library. It is wrapped by a C-API which can be used by C-API users. The C-API is further wrapped into a Python API for Python users. The calculation core is thoroughly tested by its own unit tests and validation tests. The model is also validated at the Python side with the same test data.

More in-depth information on the Power Grid Model library can be found here.


The library power-grid-model-io is a data conversion Python library which handles the conversion between Power Grid Model format and other common grid data formats. Currently it supports the conversion from Vision and pandapower. 

More in-depth information on the data conversions library can be found here.

Further Details

Validation of the library has been performed against the Power Grid Model reference models with 80 or more test cases, and continuous validation is part of the CI pipeline in GitHub Actions. The calculation core is now integrated into GridCal. It is also planned to be integrated into pandapower.

Become A Member

Gain a seat at the table to influence the strategic direction of LF Energy and the projects that will shape an industry for millennia.


Stay Connected with the LF Energy Newsletter