name: pandapower-sim description: Use when driving pandapower (Python power-system analysis library combining pandas data tables with PYPOWER-style solvers, from Fraunhofer IEE) via Python scripts — load flow, optimal power flow (OPF), short-circuit, time-series, contingency analysis on transmission / distribution networks — through sim runtime one-shot execution.
pandapower-sim
You are connected to pandapower via sim-cli.
pandapower (Thurner et al., IEEE Trans. Power Systems 2018) is the
standard Python library for power-system analysis. Pure Python +
pandas + numpy/scipy (with optional Numba for speedup). Pip-installable
(pip install pandapower).
Scripts are plain .py:
import pandapower as pp
net = pp.create_empty_network()
b1 = pp.create_bus(net, vn_kv=20.0); b2 = pp.create_bus(net, vn_kv=20.0)
pp.create_ext_grid(net, b1)
pp.create_line(net, b1, b2, length_km=10, std_type='NAYY 4x150 SE')
pp.create_load(net, b2, p_mw=0.5)
pp.runpp(net)
print(net.res_bus.vm_pu) # bus voltage magnitudes (p.u.)
Same subprocess driver mode as PyBaMM.
base/ — always relevant
| Path | What's there |
|---|---|
base/reference/workflow.md |
Empty net → buses → branches → injections → run. |
base/reference/elements.md |
Bus / Line / Trafo / Load / Gen / SGen / ExtGrid / Storage / Switch. |
base/reference/solvers.md |
runpp (PF), runopp (OPF), runsc (short-circuit), runts (time-series). |
base/reference/standard_libs.md |
Built-in line types, transformer types, IEEE benchmark networks. |
base/snippets/01_pf.py |
Verified 2-bus power flow E2E. |
base/known_issues.md |
numpy bool serialization, AC vs DC PF, slack bus required. |
sdk/2/ — pandapower 2.x
sdk/2/notes.md— version-specific surface notes.
Hard constraints
- Every network needs an
ext_grid(slack bus) for AC power flow, elserunppraises. For islanded systems use agenwithslack=True. - Bus voltages set by
vn_kv— must match the line / transformer ratings on each side. Mismatched voltages silently cause convergence failures. - Default
runppis AC Newton-Raphson. For approximate / DC userunpp(net, algorithm='dc'). For three-phase:runpp_3ph. - Acceptance != "ran without error". Always check that PF converged and bus voltages are within plausible bounds (typically 0.95-1.05 p.u.) and line loadings < 100%.
- Result tables live on
net.res_*AFTER running. Empty before. - Print results as JSON on the last stdout line. Cast pandas
floats:
float(net.res_bus.vm_pu[b]).
Required protocol
- Gather inputs:
- Category A: network topology (bus / line / trafo data), load and generation profiles, slack reference, acceptance.
- Category B: PF algorithm, tolerance, max iterations.
sim check pandapower.- Write
.pyperbase/reference/workflow.md. sim lint script.py.sim run script.py --solver pandapower.- Validate JSON.