pandapower Documentation

repository·develop·Indexed 22 days ago

https://github.com/e2niee/pandapower

An open source tool for power system modeling, analysis, and optimization using pandas for data handling. The library provides functionality for network calculations, including balanced and unbalanced load flow, N-1 contingency analysis, and power system optimization. Documentation covers naming conventions, per unit systems, power signing conventions, and migration guides for versions 2.x and 3.0, including transitions to MVA-based units and GeoJSON geographic data storage.

Tokens
126K
Snippets
188
Records
736
Agent score
78%

What's inside pandapower

  1. Overview of the pandapower toolbox

    develop
    The pandapower.toolbox is a collection of helper functions designed for common application tasks that do not belong to specialized packages. It provides utilities for comparing networks, calculating power factors, extracting result information, selecting elements, modifying data, and performing electric grid modifications (such as dropping or replacing elements).
  2. Overview of pandapower

    develop

    pandapower is a network calculation program designed to automate the analysis and optimization of power systems. It is built on top of the pandas library and is compatible with the MATPOWER / PYPOWER case format.

    Key features include:

    • Power System Modeling and Analysis: Automated workflows for power system studies.
    • Multiple Solver Support:
      • Improved Newton-Raphson power flow implementation.
      • All PYPOWER solvers.
      • C++ library solvers from PowerGridModel for fast steady-state distribution analysis.
      • Newton-Raphson solvers from the lightsim2grid C++ library.
      • Integration with the PowerModels.jl library.
    • Data Integration: Works seamlessly with pandas for data manipulation and can utilize realistic load profiles and grid models from the SimBench project.
  3. Create interactive network plots with Plotly

    develop

    pandapower supports interactive network visualization through the Plotly library. The Plotly implementation is designed to be analogous to pandapower's matplotlib plotting library, allowing for a consistent user experience when switching between static and interactive plots.

    Pandapower can translate network elements (such as lines, buses, or transformers) into Plotly collections (traces), which can then be rendered as interactive plots. For networks containing geocoordinates, interactive plots can also be represented on MapLibre maps.

  4. Access synthetic and benchmark grids via the networks module

    develop

    Instead of manually constructing power grids, you can use the pandapower.networks module to load pre-defined grids. The module provides several types of networks for testing and benchmarking, including:

    • Example grids: For learning and demonstration.
    • Test grids: Simple grids for verifying code functionality.
    • Randomly generated grids: For stochastic testing.
    • CIGRE test grids: Standardized benchmark grids.
    • IEEE case files: Including 3-phase grids.
    • Synthetic low voltage grids: Based on research by Georg Kerber, Lindner et. al., and Dickert et. al.

    For high-fidelity benchmarking involving full-year load, generation, and storage profiles, the documentation recommends using the SimBench repository.

  5. Simulate controlled elements with the control module

    develop

    The control module enables the simulation of power system elements that react to power flows, such as tap changer controllers (adjusting transformer taps based on bus voltage) or droop controllers in PV plants (adjusting reactive power based on bus voltage).

    You can implement these strategies in two ways:

    1. Use predefined controller elements provided by pandapower.
    2. Build custom controllers using an object-oriented framework.

    The control module is designed to work closely with the timeseries module, enabling quasi-static timeseries simulations that include controlled elements.

  6. Visualize pandapower networks using Matplotlib

    develop

    pandapower allows you to translate network elements (lines, buses, transformers) into Matplotlib collections. These collections can then be rendered using matplotlib.pyplot.

    Key behaviors:

    • Buses: If bus coordinates are missing, you can generate generic coordinates using the igraph package.
    • Lines: If geocoordinates are missing for lines, they are plotted as direct connections between the buses.
  7. Run a Power Flow in pandapower

    develop

    pandapower supports three main types of power flow calculations:

    1. AC Power Flow (Balanced/Unbalanced): Standard alternating current power flow.
    2. DC Power Flow (Linearized): A linearized approximation of the AC power flow, typically used for faster calculations in transmission studies.
    3. AC 3-Phase Power Flow: Specialized AC power flow for unbalanced three-phase systems.

    Depending on your network model and study requirements, you should choose the appropriate method (AC, DC, or 3-phase AC) to solve the power flow equations.

  8. What is an Extended Ward (xward)?

    develop

    An Extended Ward (xward) is an electrical model equivalent to a standard Ward equivalent but with an additional PV-node containing internal resistance.

    Key modeling characteristics:

    • Constant Apparent Power: Defined by ps_mw (P) and qs_mvar (Q).
    • Shunt Admittance: Calculated using pz_mw, qz_mvar, and the system base power $S_{N}$ as: $\underline{y}{shunt} = \frac{pz_mw + j \cdot qz_mvar}{S{N}}$.
    • Internal Resistance: Defined by $\underline{z}_{int} = r_pu + j \cdot x_pu$.
    • Internal Voltage Source: Modeled as a PV-node (generator) where active power $p_mw = 0$ and voltage magnitude is $vm_pu$.
  9. Overview of Time Series Simulation in pandapower

    develop
    The time series module is used to simulate time-based operations in power systems. It works by linking with the control module: during a simulation, controllers are used to update the values of various network elements at each time step within a loop. This allows for the modeling of dynamic behaviors and automated control responses over time.
  10. Control transformer tap changers

    develop

    Pandapower provides several predefined controllers for managing transformer tap changers:

    • ContinuousTapControl: For continuous tap adjustment.
    • DiscreteTapControl: For discrete tap adjustment.
    • VmSetTapControl: Controls taps based on voltage setpoints using characteristics.
    • TapDependentImpedance: Adjusts impedance based on tap position.
  11. Calculate Thermal Short-Circuit Current

    develop

    The equivalent thermal current $\underline{I}{th}$ is calculated by scaling the short-circuit currents $\underline{I}''{k}$ using correction factors $m$ and $n$. These factors represent the DC and AC components of the thermal load respectively. The calculation follows the matrix operation:

    $$\begin{bmatrix} \underline{I}{th, 1} \ \vdots \ \underline{I}{th, n} \ \end{bmatrix} = \begin{bmatrix} \sqrt{m_1 + n_1} \ \vdots \ \sqrt{m_n + n_n} \ \end{bmatrix} \begin{bmatrix} \underline{I}''{k, 1} \ \vdots \ \underline{I}''{k, n} \ \end{bmatrix}$$

    This allows for the determination of the thermal impact of short-circuit currents based on their AC and DC characteristics.

  12. Understand the Ward electric model

    develop

    A Ward element is modeled as a combination of a constant apparent power consumption and a constant impedance load (shunt admittance).

    1. Constant Apparent Power:

      • $P_{const} = ps_mw$
      • $Q_{const} = qs_mvar$
    2. Shunt Admittance ($\underline{y}{shunt}$): Calculated using the power components and the nominal voltage ($S{N}$): $$\underline{y}{shunt} = \frac{pz_mw + j \cdot qz_mvar}{S{N}}$$