Source-linked AI summary

pandapower - an Open Source Python Tool for Convenient Modeling, Analysis and Optimization of Electric Power Systems

Leon Thurner, Alexander Scheidler, Florian Schäfer, Jan-Hendrik Menke, Julian Dollichon, Friederike Meier, Steffen Meinecke, Martin Braun

arXiv:1709.06743v3cs.CE

TL;DR

Power-system analysis needs an automated, accessible tool for balanced static and quasi-static studies. pandapower provides Python-based element modeling and multiple analysis functions, with a demonstrated automated time-series case study completing 9732 power flows while maintaining stated operating limits.

  • Problem

    There is no full-fledged open-source tool focused on automated, easy-to-use symmetric power-system analysis for scientific applications.

  • Method

    pandapower combines Python-based tabular data structures with element models, equivalent circuits, and functions for power flow, optimization, state estimation, short circuits, and graph searches.

  • Results

    9732 power flows were completed in 7 min, with line and transformer loadings below 50 %, bus voltages between 0.97 pu and 1.03 pu, and minimum fault current above 1.1 kA.

  • Takeaways & Limitations

    pandapower supports automated grid studies and educational use through a tested, documented, extensible Python interface and a comprehensive model library.

Abstract

from arXiv · show

pandapower is a Python based, BSD-licensed power system analysis tool aimed at automation of static and quasi-static analysis and optimization of balanced power systems. It provides power flow, optimal power flow, state estimation, topological graph searches and short circuit calculations according to IEC 60909. pandapower includes a Newton-Raphson power flow solver formerly based on PYPOWER, which has been accelerated with just-in-time compilation. Additional enhancements to the solver include the capability to model constant current loads, grids with multiple reference nodes and a connectivity check. The pandapower network model is based on electric elements, such as lines, two and three-winding transformers or ideal switches. All elements can be defined with nameplate parameters and are internally processed with equivalent circuit models, which have been validated against industry standard software tools. The tabular data structure used to define networks is based on the Python library pandas, which allows comfortable handling of input and output parameters. The implementation in Python makes pandapower easy to use and allows comfortable extension with third-party libraries. pandapower has been successfully applied in several grid studies as well as for educational purposes. A comprehensive, publicly available case-study demonstrates a possible application of pandapower in an automated time series calculation.

I. INTRODUCTION

Increasing power-system complexity creates demand for automated, accessible analysis tools. pandapower addresses this need as a Python-based open-source tool supporting diverse power-system analyses.

  • Distributed generation and automation increase the complexity of power-system operation, analysis, and planning, especially in distribution systems.
  • Open-source tools offer free and transparent alternatives to commercial software for scientific and educational applications.
  • Existing open-source tools differ in focus, including power flow, optimal power flow, dynamic analysis, time-series simulation, short circuits, and market optimization.
  • Many tools depend on MATLAB or Delphi, limiting stand-alone use, library extension, cluster deployment, or licensing flexibility.
  • pandapower combines automated power-system analysis with a Python implementation that supports scientific libraries, third-party extensions, and cluster parallelization.

II. PANDAPOWER

pandapower targets automated symmetric power-system analysis by combining element-based modeling with broad analysis functionality. Its Python implementation supports extensibility, cross-platform deployment, and use across distribution and transmission systems.

  • No existing open-source tool specifically combines symmetric power-system analysis, ease of use, and automation for scientific applications.
  • pandapower addresses this gap as an open-source Python library for symmetric distribution and transmission-system analysis.
  • Python enables free availability, third-party library expansion, cross-platform cluster deployment, and license-free parallelization.
  • The element-based model defines lines, transformers, loads, and generators with characteristic or nameplate parameters instead of generic branch equivalents.
  • Equivalent circuits translate element models into analysis-specific mathematical network descriptions, including composite models and different representations for power flow and short circuits.

D. Data Structure

pandapower represents networks as pandas-based tabular data organized by element and result tables. This structure stores electrical parameters, statuses, metadata, and analysis outputs while supporting convenient network construction and extension.

  • Each element type has an input table for its parameters and a result table for outputs from analysis methods.
  • The network is a Python dictionary containing element and result tables for components such as lines, transformers, and switches.
  • Pandas tables can store electrical parameters together with status variables and metadata, and can be expanded with custom columns.
  • Buses use nominal voltage and system-wide rated power as per-unit references, with voltage magnitude and angle returned by grid analysis.
  • ZIP loads represent constant-power, constant-current, and constant-impedance portions using percentage parameters for the latter two components.

C. Static Generator (sgen)

pandapower distinguishes static generators, voltage-controlled generators, external grids, and shunts through dedicated element models and parameters. These models encode injections, voltage control, reference nodes, and reactive compensation.

  • Static generators model constant-power injections using active and reactive power parameters, with generation represented as negative nodal power.
  • Voltage-controlled generators fix active power and a voltage-magnitude set point by representing their buses as PV nodes.
  • External grids represent voltage sources with specified magnitude and angle, and their buses can serve as slack nodes in power-flow calculations.
  • Shunts model capacitors or reactors through reactive-power and loss parameters referenced to rated voltage.

G. Line (line)

pandapower models lines and transformers with equivalent circuits while exposing nameplate parameters, loading measures, switch configurations, taps, and parallel units.

  • Line (line): Lines use a π-equivalent circuit with length, resistance, reactance, and shunt-capacitance parameters.Line current is calculated from the maximum current at both ends, and line loading can be expressed as a ratio.
  • Two-Winding Transformer (trafo): Two-winding transformers use T-equivalent circuits by default and also support π-transformer models.Their impedance and losses are represented through short-circuit voltage, its real part, and shunt admittance.
  • Switch (switch): The switch model includes bus-bus, bus-line, and bus-transformer configurations.These configurations are listed with common approximations and their internal pandapower switch representations.
  • Two-Winding Transformer (trafo): Transformer nominal ratios need not equal connected-bus rated voltages and can incorporate angle shifts, tap changers, and phase shifting.Tap position, step size, side, and angle-shift parameters determine ratio changes and voltage-angle shifts.
  • Three-Winding Transformer (trafo3w): Three-winding transformers are internally converted into three two-winding transformers connected in a wye configuration.Open-loop losses are assigned to the high-voltage-side transformer, while loading can use rated apparent powers or currents.

J. Switch (switch)

pandapower represents ideal switches and several network elements, including DC lines, impedances, and Ward equivalents, through explicit element models.

  • Switch (switch): An ideal switch connects a bus to another bus, a line, or a transformer, with switch.closed indicating its status.A closed bus-bus switch galvanically connects buses without a voltage drop.
  • DC Line (dcline): A DC line transmits active power between buses while accounting for absolute and relative transmission losses at the destination.It is modeled with generators at both buses, with reactive-power voltage control as in the generator model.
  • Impedance (impedance): An impedance element connects buses using per-unit impedance relative to rated power and may be asymmetric.Asymmetric impedances produce an asymmetric nodal admittance matrix and support network-reduction equivalents.
  • Ward Equivalents (ward / xward): A Ward equivalent combines constant apparent-power consumption with a constant-impedance load.The extended xward model adds a voltage source with internal impedance.

IV. ELECTRIC NETWORK ANALYSIS

pandapower converts element-based network data into an internal bus-branch model for power-system analyses, using an improved Newton-Raphson power flow and PYPOWER-based OPF.

  • Electric Network Analysis: Power flow, optimal power flow, state estimation, and short-circuit calculations are supported as static network-analysis features.Element models are translated internally into a bus-branch model for analysis.
  • Power Flow: The Newton-Raphson power-flow solver was originally based on PYPOWER and improved for robustness, runtime, and usability.pandapower also automates internal node-type and per-unit conversions and offers three voltage-vector initialization methods.
  • Power Flow: For small networks, conversion overhead exceeds half of calculation time, while pandapower becomes faster than MATPOWER for medium and large networks including conversion overhead.The comparison concerns MATPOWER casefiles and includes the internal bus-branch-model conversion.
  • Optimal Power Flow: AC and DC optimal power flow are solved through PYPOWER’s interior-point solver using pandapower’s element-based costs, flexibilities, and constraints.Branch constraints use maximum transformer and line loading, and costs may be piecewise-linear or n-polynomial.

C. State Estimation

pandapower estimates network states from measurements, detects bad data, calculates IEC 60909 short-circuit currents, and supports graph-based topology analysis.

  • State Estimation: State estimation uses weighted least squares to minimize weighted squared differences between measurements and corresponding power-flow equations.Supported measurements include bus voltage and injections, plus line or transformer currents and power flows at either branch end.
  • State Estimation: Bad measurements are addressed with χ2 and normalized-residual tests before state estimation.The χ2 test assesses whether bad measurements or topology mismatch may exist, while normalized residuals provide further identification.
  • Short Circuit Calculation: pandapower implements IEC 60909 correction factors and initial sub-transient currents for symmetrical three-phase and two-phase short circuits.The corrections are automatically applied during conversion to the internal bus-branch model.
  • Topological Network Analysis: NetworkX integration translates pandapower networks into graphs for connected-component, cycle, shortest-path, and distance searches.Open-switch lines are excluded from graph edges by default because they do not provide an electrical connection.
  • Topological Network Analysis: The generic MV Oberrhein network can be plotted with stations colored by feeder to highlight radiality.The figure presents a visual topology representation rather than a numerical analysis result.

VI. FURTHER FUNCTIONALITY

pandapower supports convenient network construction, reuse, visualization, and interoperability through standard types, published test networks, plotting tools, and MATPOWER/PYPOWER converters.

  • Standard type libraries create lines and transformers from predefined basic parameters, separating element-specific data from type-dependent parameters.
  • 66 published test and benchmark networks, including IEEE, CIGRE, and generic medium- and low-voltage networks, are directly accessible.
  • Matplotlib plots can customize element shape, size, color, and colormaps to visualize quantities such as line loading or bus voltage.
  • Plotly support adds interactive network exploration through element selection and hover information.
  • Converters import and export MATPOWER or PYPOWER case files, but conversion can lose element-based information such as relative impedance and line length.

VII. CASE STUDY

The case study models active operation of a 10 kV ringmain grid with distributed loads and wind generation. It combines network definition, switching, and operating constraints to seek low-loss feasible configurations.

  • The case study demonstrates automated grid modeling and analysis for active operation in a radial, quasi-static distribution grid.The study combines pandapower’s network analysis functionalities with minimal effort.
  • The 10 kV ringmain grid has two 110 kV connection points, two- and three-winding transformers, 10 loads, 4 wind systems, and 12 lines.The network can be defined in 32 lines of programming code, and Figure 5 is generated with pandapower’s plotting module.
  • Active operation continuously reconfigures switches and transformer taps while minimizing active power losses under safety constraints.The constraints require radial operation, bus voltages within ±3%, loadings below 50%, and fault currents above 1.1 kA.
  • 276 switching states are theoretically possible from 24 tie-line switches, although meshing or loss of supply makes some configurations impermissible.Two switches must be open to separate the three feeders.

C. Time-series simulation

The time-series case study optimizes switching states and transformer taps at each step, checking feasible configurations with power flows. It maintains the operating constraints while enabling substantial parallel speedup.

  • At each time step, pandapower optimizes transformer tap positions and switching state to minimize active power losses while satisfying the case-study constraints.
  • Power flows evaluate each of the 88 valid switching states against voltage and loading constraints, while 80 states already satisfy radiality and fault-current requirements.A state is rejected when any line or transformer exceeds 50% loading.
  • Line and transformer loadings remain below 50%, bus voltages stay between 0.97 pu and 1.03 pu, and minimum fault current remains above 1.1 kA.Transformer tap positions vary between -2 and +2 throughout the day.
  • The grid uses 9 different switching states for optimal operation, with feeder configurations changing between peak-generation and peak-load conditions.
  • 9732 power flows run in 7 min on a modern business laptop, while parallelized execution on 48 cores reduces runtime to under 15 s.Quasi-static time steps are independent, enabling parallel execution.
  • The algorithm successfully simulates active grid operation, analyzing bus voltages and line and transformer loadings.
  • Python’s open-source, cross-platform implementation supports multi-core deployment, reducing runtime for computationally complex tasks without additional licensing fees.

F. Comparison to other tools

The paper argues that pandapower enables a detailed, reproducible case study that is difficult to reproduce with other open-source tools. Its tested models, automation features, and Python ecosystem support scientific and educational use, while some capabilities remain planned.

  • The case study was not easily reproducible with other available tools because detailed three-winding transformer and tie-line switch models are uncommon among open-source alternatives.
  • Pandapower uniquely combines graph search for radiality checks with IEC 60909 fault-current calculations among the compared open-source tools.
  • Other tools could implement the desired behavior through workarounds, but pandapower provides the required models and analysis functions out of the box and tests them thoroughly.
  • Pandapower automates static and quasi-static balanced three-phase analysis and optimization using nameplate-defined equivalent-circuit models validated against commercial software.
  • The case study highlights accessible quasi-static time-series analysis and multi-core calculation without additional licensing fees, with code publicly available on GitHub.
  • Unbalanced power flow, unbalanced short-circuit calculations, and a graphical user interface were planned future additions.
Loading 1709.06743v3…