Reports#
A solved case renders to a report sized to the network. This notebook covers the report formats. Reading individual quantities, the convergence trace, and the reactive-limit signals from the same solved case are shown in the recipes.
import gpf
from gpf import GpfCase, Bus, Generator, Load, Branch
case = GpfCase(
sbase=100.0,
buses=[
Bus(ibus=1, ide=3, vm=1.02, area=1, baskv=230.0), # slack
Bus(ibus=2, ide=2, vm=1.01, area=1, baskv=230.0), # PV
Bus(ibus=3, ide=1, vm=1.0, area=1, baskv=230.0),
Bus(ibus=4, ide=1, vm=1.0, area=1, baskv=230.0),
],
generators=[
Generator(ibus=1, machid="1", pg=0.0, vs=1.02, qb=-300, qt=300),
Generator(ibus=2, machid="1", pg=80.0, vs=1.01, qb=-150, qt=150),
],
loads=[Load(ibus=3, pl=120, ql=40), Load(ibus=4, pl=60, ql=20)],
branches=[
Branch(ibus=1, jbus=2, r=0.01, x=0.08),
Branch(ibus=2, jbus=3, r=0.01, x=0.08),
Branch(ibus=3, jbus=4, r=0.01, x=0.08),
Branch(ibus=1, jbus=3, r=0.01, x=0.10),
],
)
sol = gpf.solve_power_flow(case, backend="cpu")
sol.summary()
'SolvedCase(CONVERGED in 5 iterations (2 outer), max_mismatch=8.59e-08, buses=4, branches=4, P_loss=2.41 MW, Q_loss=21.13 Mvar)'
Report formats#
render produces a text report sized to the network. The same result is also
available as render_json, render_plain, or sol.to_report().
print(gpf.render(sol))
gpf converged 5 iter 8.6e-08 mismatch 59 us
------------------------------------------------------------
4 buses 2 gen 4 branches 100 MVA base
P: +182.4 MW gen 2.4 MW loss
Q: +81.1 Mvar +21.1 Mvar loss
V: 0.949..1.020 pu
Voltage reg: 1 groups (1 reduced, 0 full), 1 members | Newton dim 9 = 8 base + 1 aug
BUS V(pu) th(deg) P(MW) Q(Mvar)
1 1.0200 0.00 102.4 53.7
2 1.0100 -0.60 80.0 27.5
3 0.9730 -4.81 -120.0 -40.0
4 0.9486 -7.67 -60.0 -20.0
GEN BUS ID P(MW) Q(Mvar)
1 1 1 102.4 53.7
2 2 1 80.0 27.5
BR FROM TO CKT Pf(MW) Qf(Mvar) Pt(MW) Qt(Mvar) Pl(MW) Ql(Mvar)
1 1 2 1 14.9 11.0 -14.9 -10.7 0.03 0.26
2 2 3 1 94.9 38.2 -93.9 -30.0 1.03 8.20
3 3 4 1 60.4 23.6 -60.0 -20.0 0.44 3.56
4 1 3 1 87.5 42.7 -86.6 -33.6 0.91 9.11