About pandapower

pandapower builds on the data analysis library pandas and the power system analysis toolbox PYPOWER to create an easy to use network calculation program aimed at automation of analysis and optimization in power systems. What started as a convenience wrapper around PYPOWER has evolved into a stand-alone power systems analysis toolbox with extensive power system model library, an improved power flow solver and many other power systems analysis functions.

Why another tool?

Motivation

pandapower was developed to close the gap between commercial and open source power systems analysis tools. While open source power systems tools are flexible and can easily be customized, they often lack the detailed model libraries and comfortable usage of commercial power system analysis tools.

  Electric Models Automation Customization
Commercial Tools (e.g. Sincal, PowerFactory, NEPLAN) Thoroughly validated and easy to parametrize electric models of lines, transformers, switches etc. Graphical User Interface applications that are difficult to automate. Restricted possibilities for customization due to proprietary code base.
Open Source Tools (e.g. MATPOWER, PYPOWER) Basic models that require parametrization by the user with expert knowledge. Console application that are designed for automated evaluations. Open Source code base that can be freely modified and customized.
pandapower Thoroughly validated and easy to parametrize electric models of lines, transformers, switches etc. Console application that is designed for automated evaluations. Open source code base that can be freely modified and customized.

This is of course a very broad classification of tools that is only supposed to illustrate the focus of pandapower without considering the diverse landscape of existing tools. A more detailed analysis of existing open source tools and the gap that pandapower closes can be found in [1]. Overviews over existing open source tools can also be found in [2] or [3] .

Scope

pandapower is aimed at static analysis of balanced power systems. This allows analysis of:

  • transmission and subtransmission systems, which are typically operated symmetrically.
  • symmetric distribution systems, which are commonly found in Europe.

Distribution grids with unbalanced power flows, such as the feeder design common in North America, can currently not be analysed with pandapower.

Power System Modeling

Equivalent Circuit Models

pandapower is an element based network calculation tool that supports a wide variety of electric components. The following table shows that the pandapower model library goes beyond of that of most existing open source tools:

Comparison of open source electric model libraries [1]

All equivalent circuit models are thoroughly validated against commercial software tools and therefore allow industry level modeling of electric power systems.

Tabular Data Structure

pandapower is based on a tabular data structure, where every element type is represented by a table that holds all parameters for a specific element and a result table which contains the element specific results of the different analysis methods. The tabular data structure is based on the Python library pandas. It allows storing variables of any data type, so that electrical parameters can be stored together with status variables and meta-data, such as names or descriptions. The tables can be easily expanded and customized by adding new columns without influencing the pandapower functionality. All inherent pandas methods can be used to efficiently read, write and analyze the network and results data.

Standard Type Libraries

pandapower includes a standard type library that allows the creation of lines and transformers using predefined basic standard type parameters. The user can either define individual standard types or use the predefined pandapower basic standard types for convenient definition of networks.

Power System Analysis

pandapower supports the following power systems analysis functions:

Power Flow

The pandapower power flow solver is based on the Newton-Raphson method. The implementation was originally based on PYPOWER, but has been improved with respect to robustness, runtime and usability.
Learn more

Initialization

pandapower offers three different methods to initialize the complex voltage vector for the AC power flow calculation:

  • flat start
  • voltage vector of a previous calculation
  • initialization with a DC power flow
Performance

Some parts of the pandapower solver have been accelerated using the JIT compiler numba. This makes the pandapower Newton-Raphson significantly faster than the PYPOWER solver from which it was originally derived. To outline the difference in computational time, the convergence times for different standard MATPOWER case files are shown here for MATPOWER, PYPOWER and pandapower:

Power flow speed convergence time comparison of different open source tools [1]

While PYPOWER and MATPOWER operate directly on the bus-branch model of the grid, the element based power system model in pandapower requires mappings and conversions of grid data and results into the tabular data structure. The graph shows that this conversion can take a significant amount of time in smaller networks, but its share decreases in larger networks. Even with the conversion overhead, pandapower is the fastest of the three tools in large grids with >1000 nodes.

Other solvers

In addition to the default Newton-Raphson solver, pandapower also provides an implementation of a backward/forward sweep. pandapower also includes an Iwamoto variant of the Newton-Raphson, which includes a damping factor that can help convergence in ill-conditioned problems. It is also possible to use the fast decoupled as well as the Gauss-Seidel power flow algorithms through an interface to PYPOWER, although some features, such as ZIP loads or unsymmetrical impedances will only work with the pandapower solvers.

Unbalanced Power Flow

An unbalanced power flow is currently being implemented and a first version will hopefully be released soon. Follow the progress or join the implementation efforts on github, or subscribe to the pandapower mailing list for updates.

Optimal Power Flow

pandapower allows solving AC and DC optimal power flow (OPF) problems through interfacing PYPOWER. The interior point solver provided by PYPOWER is used to solve the problem, while costs, flexibilities and constraints are configured through the element-based pandapower data structure. Static loads can be used as flexibilities in the OPF, which allows optimization dispatch of static generators as well as load shedding. The cost function for each power injection or load can either be defined by a piecewise linear or a n-polynomial cost function of the active and reactive power output of the respective elements.
Learn more

State Estimation

pandapower includes a state estimation module that allows to estimate the electrical state of a network by dealing with inaccuracies and errors from measurement data. pandapower supports measurement of voltages, active and reactive power or currents at bus, lines and transformers. The state estimation is solved with a weighted-least-square method. It also includes a bad-data detection method based on a Chi-squared and a normalized residuals test.
Learn more

Short-Circuit Calculation

pandapower includes a short-circuit calculation that allows to calculate fault currents for three-phase, two-phase and single phase short-circuits according to the IEC 60909 standard. The implementation also allows modeling power converter elements, such as PV plants or wind parks, according to the 2016 revision of the standard.
Learn more

Graph Searches

pandapower provides the possibility of graph searches using the Python library NetworkX by providing a possibility to translate pandapower networks into NetworkX graphs. Once a network is translated into an abstract graph, all graph searches implemented in the NetworkX library can be used to analyze the network structure. Additionally, pandapower also provides some predefined search algorithms to tackle common graph search problems in electric networks, such as finding unsupplied buses or identifying buses on main or secondary network feeders.
Learn more

Tests and Validation

pandapower is tested with pytest. There are currently over 250 tests testing all kinds of pandapower functionality. The tests also include automatic validation of pandapower results from power flow or short circuit calculations against commercial software, to ensure that the implementation is correct.

Continous Integration

The tests are continuously carried out with Travis CI in Python 2.7, 3.4, 3.5 and 3.6 . The test coverage rate is checked with codecov , code quality with codacy .

Model Validation

To ensure that pandapower loadflow results are correct, all pandapower element behaviour is tested against DIgSILENT PowerFactory or PSS Sincal.

There is a result test for each of the pandapower elements that checks loadflow results in pandapower against results from a commercial tools.

Here is an overview of all test networks that are used to validate the electric models:

The pandapower test grids for validation of the electric models.

These minimal networks are used to compare power flow results with commercial tools. The tests ensure deviation do not surpass the following tolerances:

Parameter Max. Deviation
Voltage Magnitude 0.000001 pu
Voltage Angle 0.01°
Current 0.000001 kA
Power 0.005 kW
Element Loading 0.001%

The validation process is explained in the following for the transformer as an example.

Example: Transformer

To validate the pandapower transformer model, a transformer is created with the same parameters in pandapower and PowerFactory. To test all aspects of the model we use a transformer with:

  • both iron and copper losses > 0
  • nominal voltages that deviate from the nominal bus voltages at both sides
  • an active tap changer
  • a voltage angle shift > 0
  • more than one parallel transformer

We use a transformer with the following parameters:

  • vsc_percent= 5.0
  • vscr_percent = 2.0
  • i0_percent = 0.4
  • pfe_kw = 2.0
  • sn_kva = 400
  • vn_hv_kv = 22
  • vn_lv_kv = 0.42
  • tp_max = 10
  • tp_mid = 5
  • tp_min = 0
  • tp_st_percent = 1.25
  • tp_side = "hv"
  • tp_pos = 3
  • shift_degree = 150

To validate the in_service parameter as well as the transformer switch element, we create three transformers in parallel: one in service, one out of service and one with an open switch in open loop operation. All three transformers are connected to a 20kV / 0.4 kV bus network. The test network then looks like this:

The loadflow result for the exact same network are now compared in pandapower and PowerFactory. It can be seen that both bus voltages:

and transformer results:

match within the margins defined above.

Citing pandapower

If you use pandapower in your work, we kindly ask you to cite the pandapower reference paper

License

pandapower is published under the following 3-clause BSD license:

Copyright (c) 2018 by University of Kassel and Fraunhofer Institute for Fraunhofer Institute for Energy Economics and Energy System Technology (IEE) Kassel and individual contributors (see AUTHORS file for details). All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, NCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.