pandapower

3.4.0 · active · verified Thu Apr 16

pandapower is an easy-to-use open-source tool for power system modeling, analysis, and optimization, designed for high automation. As of version 3.4.0, it integrates with pandas for data handling and various solvers for power flow calculations, supporting steady-state analysis, optimal power flow, state estimation, and short-circuit calculations. It maintains a regular release cadence with several updates per year.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart creates a simple 3-bus network with an external grid, a transformer, a line, and a load. It then runs a power flow calculation and prints the voltage magnitudes for buses and loading percentages for lines. This demonstrates the basic steps of network creation, power flow execution, and result access.

import pandapower as pp

# Create an empty network
net = pp.create_empty_network()

# Create buses
b1 = pp.create_bus(net, vn_kv=20., name="Bus 1")
b2 = pp.create_bus(net, vn_kv=0.4, name="Bus 2")
b3 = pp.create_bus(net, vn_kv=0.4, name="Bus 3")

# Create external grid (slack bus)
pp.create_ext_grid(net, bus=b1, vm_pu=1.02, name="Grid Connection")

# Create load
pp.create_load(net, bus=b3, p_kw=100, q_kvar=50, name="Load")

# Create transformer (using standard type)
pp.create_transformer_from_parameters(net, sn_kva=400., hv_bus=b1, lv_bus=b2, 
                                      vn_hv_kv=20., vn_lv_kv=0.4, vsc_percent=6., 
                                      vscr_percent=1.425, i0_percent=0.3375, 
                                      pfe_kw=1.35, name="Trafo")

# Create a line
pp.create_line(net, from_bus=b2, to_bus=b3, length_km=0.1, std_type="NAYY 4x50 SE")

# Run power flow
pp.runpp(net)

# Print results
print("Bus Voltage Magnitude (p.u.):\n", net.res_bus.vm_pu)
print("Line Loading (%):\n", net.res_line.loading_percent)

view raw JSON →