Skip to content

Repository files navigation

p3s - parallel pandapower solver

PyPI version Documentation Status REUSE status

CPU / GPU based AC/DC Powerflow solver

Features

Solvers

  • C++ Newton-Raphson with KLU, single and multi-threaded (using openMP)
  • GPU-resident polar Newton solver (cuDSS, cuSolverRF and cuSolverSp QR)
  • reference python / numba implementation

Study opportunities

  • batched timeseries calculation
  • N-1 contingency analysis with islanding detection (including a "reslack" feature)
  • station controllers solved inside the Newton Raphson (still under review)

Robustness

  • Armijo damped Newton-Raphson
  • DC power-flow initialisation with flat start fallback
  • voltage-band plausibility check against non-physical roots
  • per-case convergence and per-bus served masks

Integration

  • operates directly on pandapower networks (standalone)
  • zero-copy numpy interface, using pybind11, no per-call marshalling
  • Linux and Windows native builds; pip installable
  • Will be directly integrated in pandapower

Verification

  • all results are verified against pandapower
  • test pipeline automatically tests every change
  • accuracy is 1e-11 vs pandapower

Installation

Compiled C++/KLU Newton-Raphson solver (the nr_klu extension). Opt-in because it needs a C++17 compiler and SuiteSparse/KLU at build time. Installs the separate p3s-cpp distribution, whose CMake build drops nr_klu into the p3s package so from p3s import nr_klu works.

pip install parallel-pandapower-solver[cpp]              # from an index (published p3s-cpp)
pip install .[cpp]                # from a checkout (see note below)

From a source checkout, p3s-cpp is not on an index, so build it explicitly: pip install ./p3s/cpp (SuiteSparse must be available, e.g. conda install -c conda-forge suitesparse.) (cuda-toolkit1 must be available, e.g. conda install -c nvidia/label/cuda-12.4.0 cuda-toolkit.)

Look into docs/installation.md for more details.

Acknowledgment

The code in this repository was created as part of the research project “GRAVITON”, supported by the German Federal Ministry for Economic Affairs and Climate Action (BMWE) on the basis of a decision by the German Bundestag (grant no. 03EIM4109).

Supported by: Federal Ministry for Economic Affairs and Energy on the basis of a decision by the German Bundestag

Credits

This package was created with Cookiecutter and the audreyfeldroy/cookiecutter-pypackage project template.


Footnotes

  1. CUDA libraries are not part of this repository and must be acquired separately from NVIDIA, under their respective license terms. ↩

About

Open-source cpu/gpu based massive parallel AC/DC-powerflow solver

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages