Help

Load Flow Analysis (Gauss-Seidel)

Jump to section

Overview

Performs multi-bus power system load flow analysis using the Gauss-Seidel iterative method. Supports PQ (load), PV (generator), and Slack (reference) bus types. Assembles the bus admittance matrix (Y-bus) from line impedances, solves for bus voltages, and computes line power flows and system losses. Optional Successive Over-Relaxation (SOR) acceleration and generator reactive power limit enforcement are supported.

Applicable to radial and mesh networks with up to 50 buses. All quantities are internally converted to the per-unit system using a user-specified base MVA and base kV.

Input Parameters

System Parameters

Parameter Type Default Range Description
num_buses Integer 3 2 – 50 Total number of buses in the system
base_mva Number 100.0 1.0 – 10000.0 System base power in MVA for per-unit calculations
base_kv Number 11.0 0.1 – 1000.0 System base voltage in kV
frequency Enum: 50 / 60 50 — System frequency (Hz)

Bus Data (array)

Each element in the bus_data array defines one bus. At least one bus must be type Slack.

Parameter Type Default Range Description
bus_number Integer — 0 – 49 Bus index (zero-based)
bus_type Enum: Slack / PV / PQ PQ — Bus type — Slack (reference), PV (generator), or PQ (load)
v_magnitude Number 1.0 — Specified voltage magnitude in per-unit (Slack and PV buses)
v_angle Number 0.0 — Specified voltage angle in degrees (Slack bus only)
p_gen Number 0.0 — Generator real power output (MW)
q_gen Number 0.0 — Generator reactive power output (MVAr)
p_load Number 0.0 — Load real power consumption (MW)
q_load Number 0.0 — Load reactive power consumption (MVAr)
q_min Number -999.0 — Minimum generator reactive capability in MVAr (PV buses)
q_max Number 999.0 — Maximum generator reactive capability in MVAr (PV buses)

Line Data (array)

Each element in the line_data array defines a transmission line or cable between two buses. Impedances are specified in per-unit.

Parameter Type Default Range Description
from_bus Integer — 0 – 49 Sending-end bus index
to_bus Integer — 0 – 49 Receiving-end bus index
z_real Number — — Line resistance in per-unit
z_imag Number — — Line reactance in per-unit
b_shunt Number 0.0 — Half-line charging susceptance in per-unit

Solver Settings

Parameter Type Default Range Description
tolerance Number 1×10-6 1×10-10 – 1×10-3 Maximum voltage change for convergence
max_iterations Integer 100 10 – 1000 Maximum number of Gauss-Seidel iterations
use_sor Boolean false — Enable Successive Over-Relaxation acceleration
sor_factor Number 1.6 1.0 – 2.0 SOR acceleration factor (ω); 1.0 = no acceleration
enforce_q_limits Boolean true — Convert PV to PQ bus when reactive limits are violated
calculate_line_flows Boolean true — Compute power flow through each line after convergence
calculate_losses Boolean true — Compute total real and reactive system losses

Output Results

Bus Voltages (per bus)

Output Unit Description
magnitude pu Bus voltage magnitude
angle_deg ° Bus voltage angle in degrees
angle_rad rad Bus voltage angle in radians
real pu Real component of bus voltage
imag pu Imaginary component of bus voltage

Power Injections (per bus)

Output Unit Description
p_specified_mw MW Specified net real power injection (generation − load)
q_specified_mvar MVAr Specified net reactive power injection
p_calculated_mw MW Calculated real power injection from converged voltages
q_calculated_mvar MVAr Calculated reactive power injection from converged voltages
p_mismatch_mw MW Absolute difference between specified and calculated real power
q_mismatch_mvar MVAr Absolute difference for reactive power (PQ buses only)

Line Flows (per line)

Output Unit Description
p_from_to_mw MW Real power flow from sending to receiving end
q_from_to_mvar MVAr Reactive power flow from sending to receiving end
p_to_from_mw MW Real power flow from receiving to sending end
q_to_from_mvar MVAr Reactive power flow from receiving to sending end
p_loss_mw MW Real power loss in the line
q_loss_mvar MVAr Reactive power loss in the line
i_from_pu pu Current magnitude at sending end
i_to_pu pu Current magnitude at receiving end

System Summary

Output Unit Description
converged Boolean Whether the solution converged within the tolerance
iterations — Number of Gauss-Seidel iterations performed
p_loss_mw MW Total system real power losses (sum of all line losses)
q_loss_mvar MVAr Total system reactive power losses
y_bus_real pu Real part of Y-bus admittance matrix
y_bus_imag pu Imaginary part of Y-bus admittance matrix

Formulas

Y-bus Admittance Matrix

Series admittance of each line:

\[ y_{ij} = \frac{1}{z_{ij}} = \frac{1}{R_{ij} + jX_{ij}} \]

Diagonal elements (self-admittance):

\[ Y_{ii} = \sum_{k \neq i} y_{ik} + \sum_{k} y_{\text{shunt},ik} \]

Off-diagonal elements (mutual admittance):

\[ Y_{ij} = -y_{ij} \quad (i \neq j) \]

Where \(z_{ij} = R_{ij} + jX_{ij}\) is the series impedance and \(y_{\text{shunt}}\) is the half-line charging susceptance (pi-model).

Gauss-Seidel Voltage Update (PQ Bus)

\[ V_i^{(k+1)} = \frac{1}{Y_{ii}} \left( \frac{S_i^*}{\left(V_i^{(k)}\right)^*} - \sum_{j \neq i} Y_{ij} V_j \right) \]

Where:

  • \(S_i = P_i + jQ_i\) is the net scheduled complex power injection (generation − load) at bus \(i\)
  • \(V_i^{(k)}\) is the voltage at bus \(i\) at iteration \(k\)
  • For \(j < i\), the already-updated \(V_j^{(k+1)}\) is used; for \(j > i\), \(V_j^{(k)}\) is used (Gauss-Seidel property)

PV Bus Voltage Enforcement

After computing a temporary voltage update, the magnitude is enforced:

\[ V_i^{(k+1)} = |V_i|_{\text{spec}} \cdot e^{j\angle V_i^{\text{temp}}} \]

The reactive power is then recalculated from the updated voltages:

\[ Q_i^{(k+1)} = \text{Im}\left\{ V_i^{(k+1)} \left( \sum_j Y_{ij} V_j \right)^* \right\} \]

If \(Q_i\) exceeds generator limits (\(Q_{\min}\) or \(Q_{\max}\)), the bus is converted from PV to PQ and the reactive power is clamped at the violated limit.

Successive Over-Relaxation (SOR)

\[ V_i^{(k+1)} \leftarrow (1 - \omega)\, V_i^{(k)} + \omega\, V_i^{(k+1)} \]

Where \(\omega\) is the acceleration factor. Typical values are 1.0 – 1.2 for well-conditioned systems (up to 2.0 maximum). Setting \(\omega = 1.0\) reduces to standard Gauss-Seidel.

Power Flow Equations

Net complex power injection at bus \(i\):

\[ S_i = P_i + jQ_i = V_i \cdot I_i^* = V_i \left( \sum_{j=0}^{n-1} Y_{ij}\, V_j \right)^* \]

Expanding into real and reactive components:

\[ P_i = \text{Re}\left\{ V_i \left( \sum_{j} Y_{ij}\, V_j \right)^* \right\} \] \[ Q_i = \text{Im}\left\{ V_i \left( \sum_{j} Y_{ij}\, V_j \right)^* \right\} \]

Line Power Flow and Losses

Current from bus \(i\) to bus \(j\):

\[ I_{ij} = (V_i - V_j)\, y_{ij} + V_i\, y_{\text{shunt},ij} \]

Power flow from bus \(i\) to bus \(j\):

\[ S_{ij} = V_i \cdot I_{ij}^* \]

Line losses are the algebraic sum of flows in both directions:

\[ S_{\text{loss},ij} = S_{ij} + S_{ji} \]

Total system losses:

\[ P_{\text{loss,total}} = \sum_{\text{all lines}} P_{\text{loss},ij} \]

Convergence Criterion

\[ \max_i \left| V_i^{(k+1)} - V_i^{(k)} \right| < \varepsilon \]

Where \(\varepsilon\) is the convergence tolerance (default: \(1 \times 10^{-6}\) pu). If the maximum voltage change across all buses drops below this threshold, the solution is considered converged.

Per-Unit Conversion

Power quantities are converted between MW/MVAr and per-unit using the system base:

\[ P_{\text{pu}} = \frac{P_{\text{MW}}}{S_{\text{base}}} \qquad Q_{\text{pu}} = \frac{Q_{\text{MVAr}}}{S_{\text{base}}} \]

Where \(S_{\text{base}}\) is the base MVA (default 100 MVA).

Worked Examples

These examples are run by the fe_calc_load_flow MCP tool, which takes an inline network in SI units (ohms, watts, kV, with transformers, taps, shunts and branch ratings) and solves it with the PSAS engine's Newton-Raphson or Gauss-Seidel solver or with pandapower. The per-unit conversion, Y-bus, power-flow equations and branch-flow formulas are the same as above; two-bus cases are also solved in closed form, and meshed cases are checked against published textbook solutions.

In the tool, every solver enforces PV reactive limits on the generator's output \(Q_G = Q_{\text{net}} + Q_{\text{load}}\): a generator that cannot hold its set-point within \([Q_{\min}, Q_{\max}]\) is held at the limit and its bus solved as PQ, and it returns to PV control only once its voltage crosses back over the set-point (Glover, Sarma & Overbye §6.5). The Gauss-Seidel acceleration factor moves PQ voltages and PV angles, never a PV magnitude; it stops on the largest voltage change per sweep and also reports the power mismatch of the result. Branch losses are the series \(|I|^2(R + jX)\) only; line charging and shunt capacitors/reactors are reported separately as shunt reactive power:

\[ S_{ij} + S_{ji} = |I_{\text{series}}|^2 (R + jX) \; - \; j\tfrac{B}{2}\left(|V_i|^2 + |V_j|^2\right) \]

The 28 examples below are the validation cases for this calculation. Each one was produced by the calculation engine from the inputs shown, every figure was checked against the independent reference quoted at the end of the example, and the same cases are run against every engine build (see validation scorecard, tool fe_calc_load_flow; worked examples for every calculation).

#CaseBusesSolverVmin (pu)Vmax (pu)Max loading (%)Losses (kW)Result
1Two-bus lossless line, lagging load (closed form)2Newton-Raphson0.9782 (L)1.0000 (S)–0.0PASS
2Two-bus lossy line on the pandapower solver2pandapower (NR)0.9518 (L)1.0000 (S)70.7 (LN1)160.0PASS
3Two-bus Gauss-Seidel, 50 MW + 20 Mvar (under-voltage)2Gauss-Seidel0.9390 (B1)1.0000 (B0)–1,644.4FAIL
4Unity power-factor load on a 33 kV line2Newton-Raphson0.9832 (LOAD)1.0000 (GXP)–132.4PASS
5Leading load raises the receiving voltage (over-voltage)2Newton-Raphson1.0000 (S)1.0517 (L)–90.4FAIL
6Ferranti rise on a 300 km open-ended 132 kV line2Newton-Raphson1.0000 (A)1.0530 (B)–71.6FAIL
733 kV cable loaded past its rating2Newton-Raphson0.9960 (PLANT)1.0000 (SUB)112.3 (FDR1)18.1FAIL
8Project limits 0.90–1.10 pu and 80 % loading2Newton-Raphson0.9468 (R)1.0000 (S)75.4 (SWER)139.4PASS
9415 V cable from per-km data on a 1 MVA base2Newton-Raphson0.9711 (DB1)1.0000 (MSB)69.1 (SUBMAIN)3.9PASS
101.5 MVA 11/0.433 kV transformer from nameplate %Z2Newton-Raphson0.9618 (LV)1.0000 (HV)98.1 (TX1)10.7PASS
11Same transformer on the −5 % HV tap2Newton-Raphson1.0000 (HV)1.0166 (LV)97.7 (TX1)9.6PASS
12Off-nominal tap solved by pandapower2pandapower (NR)1.0000 (HV)1.0166 (LV)97.7 (TX1)9.6PASS
133 Mvar shunt capacitor lifts a sagging bus2Newton-Raphson0.9600 (L)1.0000 (S)–143.9PASS
14PV generator bus on a reactive tie (power-angle equation)2Newton-Raphson1.0000 (GRID)1.0200 (GEN)–0.0PASS
15PV bus with local load on a lossy line2Newton-Raphson1.0000 (GRID)1.0300 (MILL)–54.7PASS
16PV generator inside its Q limits (Gauss-Seidel)2Gauss-Seidel1.0000 (GRID)1.0500 (GEN)–0.0PASS
17PV generator held at Q_max (Gauss-Seidel)2Gauss-Seidel1.0000 (GRID)1.0275 (GEN)–0.0PASS
18Generator Q limit with a local reactive load (Newton-Raphson)2Newton-Raphson1.0000 (GRID)1.0087 (GEN)–0.0PASS
19Generator held at Q_min (pandapower)2pandapower (NR)0.9880 (GEN)1.0000 (GRID)–0.0PASS
20Bus load with a motor and an embedded generator2Newton-Raphson0.9638 (PLANT)1.0000 (S)–81.5PASS
21Slack at 1.02 pu ∠30°, charged cable, 60 Hz (pandapower)2pandapower (NR)1.0086 (L)1.0200 (S)–37.5PASS
22Saadat three-bus system, Gauss-Seidel3Gauss-Seidel0.9818 (2)1.0500 (1)–14,300.0PASS
23Saadat three-bus system with a PV bus, Newton-Raphson3Newton-Raphson0.9717 (2)1.0500 (1)–18,422.8PASS
24Three-bus slack + PV generator + PQ load3Newton-Raphson0.9501 (2)1.0500 (0)–5,190.6PASS
25Grainger & Stevenson four-bus 230 kV system4Newton-Raphson0.9690 (3)1.0200 (4)–4,809.1PASS
26Glover, Sarma & Overbye five-bus system with transformers5Newton-Raphson0.8338 (2)1.0500 (3)66.8 (T1)34,838.8FAIL
27Five-bus system on the pandapower solver5pandapower (NR)0.8338 (2)1.0500 (3)66.8 (T1)34,838.8FAIL
28Gauss-Seidel stopped by a 5-iteration cap3Gauss-Seidel0.9823 (2)1.0500 (1)––FAIL

Example 1 — Two-bus lossless line, lagging load (closed form)

A purely reactive line feeding a lagging PQ load: the receiving-end quartic gives the voltage, and all the reactive loss is I²X.

Given: Sbase = 10 MVA, 50 Hz. Buses: S (11 kV, SLACK at 11 kV (1 pu) ∠0°); L (11 kV, PQ, load 5 MW + j2 Mvar). Branches: LN1 LINE S–L: 0 + j1.21 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 10 = 12.1 Ω; powers ÷ 10 MVA
Branch impedancesLN1: z = (0.0000 + j1.2100) / 12.1 = 0 + j0.1 pu; y = 1/z = 0.0000 − j10.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): L: S = (−5.000 − j2.000)/10 = −0.50000 − j0.20000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 0.0000 − j10.0000; YL,L = 0.0000 − j10.0000; YS,L = 0.0000 + j10.0000
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.5, Q = 0.2 pu, R + jX = 0.000000 + j0.100000 pu, E = 1.00000: V⁴ − 0.960000V² + 0.0029 = 0 → V² = (0.96 + √0.910000)/2 → V = 0.97825 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.05)/(0.97697) → θ = 2.9298° behind E; δ2 = 0.0000 − 2.9298 = −2.9298°
Load-flow resultNewton-Raphson: VL = 0.97825∠−2.9298° pu = 10.7607 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: LN1: SS→ = 5.0000 + j2.3030 MVA, SL→ = −5.0000 − j2.0000 MVA; loss = sum = |I|²(R + jX) = 0.00 kW + j303.04 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 0.00 kW + j303.04 kvar; slack supplies P = 5.0000 MW, Q = 2.3030 Mvar. P balance: Pslack + ΣPgen = 5.0000 + 0.0000 = 5.0000 MW = ΣPload + Ploss = 5.0000 + 0.0000 = 5.0000 MW. Q balance: ΣQinj = 303.04 kvar = Qloss + Qshunt = 303.04 + (0.00) = 303.04 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.69e-10 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus L at 0.97825 pu → 0.97825 vs limit 0.95000 pu PASS
Maximum voltagehighest bus S at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9782–1.0000 pu, losses 0.0 kW; governing: minimum voltage. No rating_mva on LN1: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/10 = 12.1 Ω; z = 0 + j0.1 pu; load P = 0.5, Q = 0.2 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.960000V² + 0.0029 = 0 → V = 0.97825 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −2.9298°; S_from = 5.0000 + j2.3030 MVA; series loss |I|²z = 0.00 + j303.04 (kW, kvar); slack supplies 5.00000 + j2.30304 (MW, Mvar) (validation case psas-2bus-lossless-nr)

Example 2 — Two-bus lossy line on the pandapower solver

The same feeder with R/X = 0.5 solved by pandapower: the closed-form voltage, I²R loss and the slack's supply are reproduced, and the 8 MVA rating is checked.

Given: Sbase = 10 MVA, 50 Hz. Buses: S (11 kV, SLACK at 11 kV (1 pu) ∠0°); L (11 kV, PQ, load 5 MW + j2 Mvar). Branches: LN1 LINE S–L: 0.605 + j1.21 Ω; rated 8 MVA. Solver pandapower (NR); limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 10 = 12.1 Ω; powers ÷ 10 MVA
Branch impedancesLN1: z = (0.6050 + j1.2100) / 12.1 = 0.05 + j0.1 pu; y = 1/z = 4.0000 − j8.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): L: S = (−5.000 − j2.000)/10 = −0.50000 − j0.20000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 4.0000 − j8.0000; YL,L = 4.0000 − j8.0000; YS,L = −4.0000 + j8.0000
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.5, Q = 0.2 pu, R + jX = 0.050000 + j0.100000 pu, E = 1.00000: V⁴ − 0.910000V² + 0.003625 = 0 → V² = (0.91 + √0.813600)/2 → V = 0.95184 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.04)/(0.950999) → θ = 2.4085° behind E; δ2 = 0.0000 − 2.4085 = −2.4085°
Load-flow resultpandapower (NR): VL = 0.95184∠−2.4085° pu = 10.4702 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: LN1: SS→ = 5.1600 + j2.3201 MVA, SL→ = −5.0000 − j2.0000 MVA; loss = sum = |I|²(R + jX) = 160.04 kW + j320.09 kvar; loading |Sfrom|/rating = 5.6576/8 = 70.72 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 160.04 kW + j320.09 kvar; slack supplies P = 5.1600 MW, Q = 2.3201 Mvar. P balance: Pslack + ΣPgen = 5.1600 + 0.0000 = 5.1600 MW = ΣPload + Ploss = 5.0000 + 0.1600 = 5.1600 MW. Q balance: ΣQinj = 320.09 kvar = Qloss + Qshunt = 320.09 + (0.00) = 320.09 kvar
Convergencepandapower Newton-Raphson converged in 3 iterations on its own mismatch tolerance PASS
Minimum voltagelowest bus L at 0.95184 pu → 0.95184 vs limit 0.95000 pu PASS
Maximum voltagehighest bus S at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch LN1 → 70.72 vs limit 100.00 % PASS
Result4/4 checks pass → PASS; V 0.9518–1.0000 pu, losses 160.0 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/10 = 12.1 Ω; z = 0.05 + j0.1 pu; load P = 0.5, Q = 0.2 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.910000V² + 0.003625 = 0 → V = 0.95184 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −2.4085°; S_from = 5.1600 + j2.3201 MVA; series loss |I|²z = 160.04 + j320.09 (kW, kvar); loading 5.6576/8 = 70.72 %; slack supplies 5.16004 + j2.32009 (MW, Mvar) (validation case psas-2bus-lossy-pandapower)

Example 3 — Two-bus Gauss-Seidel, 50 MW + 20 Mvar (under-voltage)

The page's former two-bus Gauss-Seidel example: the first iteration by hand, the converged 0.939 pu, line flow and losses — and the 0.95 pu under-voltage check it fails.

Given: Sbase = 100 MVA, 50 Hz. Buses: B0 (100 kV, SLACK at 100 kV (1 pu) ∠0°); B1 (100 kV, PQ, load 50 MW + j20 Mvar). Branches: L01 LINE B0–B1: 5 + j15 Ω. Solver Gauss-Seidel, tolerance 1e-08 pu, ≤ 200 iterations, acceleration α = 1.6; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases100 kV: Zbase = 100² / 100 = 100 Ω; powers ÷ 100 MVA
Branch impedancesL01: z = (5.0000 + j15.0000) / 100 = 0.05 + j0.15 pu; y = 1/z = 2.0000 − j6.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): B1: S = (−50.000 − j20.000)/100 = −0.50000 − j0.20000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YB0,B0 = 2.0000 − j6.0000; YB1,B1 = 2.0000 − j6.0000; YB0,B1 = −2.0000 + j6.0000
Gauss-Seidel sweep 1VB1(1) = [S*/V*(0) − ΣYikVk] / Yii = [(−0.5000 + j0.2000)/1 − (−2.0000 + j6.0000)(1.0000 + j0.0000)] / (2.0000 − j6.0000) = 0.94500 − j0.06500 pu; accelerated V ← 1 + 1.6 × (−0.05500 − j0.06500) = 0.91200 − j0.10400 pu; sweeps repeat until the largest |ΔV| < 1e-08 pu
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.5, Q = 0.2 pu, R + jX = 0.050000 + j0.150000 pu, E = 1.00000: V⁴ − 0.890000V² + 0.00725 = 0 → V² = (0.89 + √0.763100)/2 → V = 0.93903 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.065)/(0.936778) → θ = 3.9692° behind E; δ2 = 0.0000 − 3.9692 = −3.9692°
Load-flow resultGauss-Seidel: VB1 = 0.93903∠−3.9692° pu = 93.9030 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: L01: SB0→ = 51.6444 + j24.9332 MVA, SB1→ = −50.0000 − j20.0000 MVA; loss = sum = |I|²(R + jX) = 1,644.40 kW + j4,933.21 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 1,644.40 kW + j4,933.22 kvar; slack supplies P = 51.6444 MW, Q = 24.9332 Mvar. P balance: Pslack + ΣPgen = 51.6444 + 0.0000 = 51.6444 MW = ΣPload + Ploss = 50.0000 + 1.6444 = 51.6444 MW. Q balance: ΣQinj = 4,933.21 kvar = Qloss + Qshunt = 4,933.22 + (0.00) = 4,933.22 kvar
Convergenceconverged after 57 iterations; largest |ΔV| in the last sweep 9.15e-09 vs tolerance 1e-08 pu; power mismatch of the returned voltages 1.86e-08 pu PASS
Minimum voltagelowest bus B1 at 0.93903 pu → 0.93903 vs limit 0.95000 pu FAIL
Maximum voltagehighest bus B0 at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Result2/3 checks pass → FAIL; V 0.9390–1.0000 pu, losses 1,644.4 kW; governing: minimum voltage. No rating_mva on L01: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 100²/100 = 100 Ω; z = 0.05 + j0.15 pu; load P = 0.5, Q = 0.2 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.890000V² + 0.00725 = 0 → V = 0.93903 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −3.9692°; S_from = 51.6444 + j24.9332 MVA; series loss |I|²z = 1644.40 + j4933.21 (kW, kvar); slack supplies 51.64440 + j24.93321 (MW, Mvar) (validation case psas-2bus-gauss-seidel-undervoltage)

Example 4 — Unity power-factor load on a 33 kV line

With Q = 0 the voltage drop is set by the resistive term PR and the angle by PX.

Given: Sbase = 10 MVA, 50 Hz. Buses: GXP (33 kV, SLACK at 33 kV (1 pu) ∠0°); LOAD (33 kV, PQ, load 8 MW + j0 Mvar). Branches: OHL LINE GXP–LOAD: 2.178 + j4.356 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesOHL: z = (2.1780 + j4.3560) / 108.9 = 0.02 + j0.04 pu; y = 1/z = 10.0000 − j20.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): LOAD: S = (−8.000 + j0.000)/10 = −0.80000 + j0.00000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGXP,GXP = 10.0000 − j20.0000; YLOAD,LOAD = 10.0000 − j20.0000; YGXP,LOAD = −10.0000 + j20.0000
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.8, Q = 0 pu, R + jX = 0.020000 + j0.040000 pu, E = 1.00000: V⁴ − 0.968000V² + 0.00128 = 0 → V² = (0.968 + √0.931904)/2 → V = 0.98320 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.032)/(0.982676) → θ = 1.8651° behind E; δ2 = 0.0000 − 1.8651 = −1.8651°
Load-flow resultNewton-Raphson: VLOAD = 0.98320∠−1.8651° pu = 32.4455 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: OHL: SGXP→ = 8.1324 + j0.2648 MVA, SLOAD→ = −8.0000 + j0.0000 MVA; loss = sum = |I|²(R + jX) = 132.41 kW + j264.83 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 132.41 kW + j264.82 kvar; slack supplies P = 8.1324 MW, Q = 0.2648 Mvar. P balance: Pslack + ΣPgen = 8.1324 + 0.0000 = 8.1324 MW = ΣPload + Ploss = 8.0000 + 0.1324 = 8.1324 MW. Q balance: ΣQinj = 264.82 kvar = Qloss + Qshunt = 264.82 + (0.00) = 264.82 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.58e-11 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus LOAD at 0.98320 pu → 0.98320 vs limit 0.95000 pu PASS
Maximum voltagehighest bus GXP at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9832–1.0000 pu, losses 132.4 kW; governing: minimum voltage. No rating_mva on OHL: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0.02 + j0.04 pu; load P = 0.8, Q = 0 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.968000V² + 0.00128 = 0 → V = 0.98320 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −1.8651°; S_from = 8.1324 + j0.2648 MVA; series loss |I|²z = 132.41 + j264.83 (kW, kvar); slack supplies 8.13241 + j0.26483 (MW, Mvar) (validation case psas-2bus-unity-pf)

Example 5 — Leading load raises the receiving voltage (over-voltage)

A leading (negative-Q) load makes PR + QX negative, so the receiving end rises above the source to 1.052 pu and fails the 1.05 pu limit.

Given: Sbase = 10 MVA, 50 Hz. Buses: S (11 kV, SLACK at 11 kV (1 pu) ∠0°); L (11 kV, PQ, load 2 MW − j6 Mvar). Branches: C1 CABLE S–L: 0.3025 + j1.21 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 10 = 12.1 Ω; powers ÷ 10 MVA
Branch impedancesC1: z = (0.3025 + j1.2100) / 12.1 = 0.025 + j0.1 pu; y = 1/z = 2.3529 − j9.4118 pu
Scheduled injectionsNet injection = generation − load (machines included): L: S = (−2.000 + j6.000)/10 = −0.20000 + j0.60000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 2.3529 − j9.4118; YL,L = 2.3529 − j9.4118; YS,L = −2.3529 + j9.4118
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.2, Q = −0.6 pu, R + jX = 0.025000 + j0.100000 pu, E = 1.00000: V⁴ − 1.110000V² + 0.00425 = 0 → V² = (1.11 + √1.215100)/2 → V = 1.05174 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.035)/(1.05116) → θ = 1.9071° behind E; δ2 = 0.0000 − 1.9071 = −1.9071°
Load-flow resultNewton-Raphson: VL = 1.05174∠−1.9071° pu = 11.5691 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: C1: SS→ = 2.0904 − j5.6384 MVA, SL→ = −2.0000 + j6.0000 MVA; loss = sum = |I|²(R + jX) = 90.40 kW + j361.61 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 90.40 kW + j361.61 kvar; slack supplies P = 2.0904 MW, Q = −5.6384 Mvar. P balance: Pslack + ΣPgen = 2.0904 + 0.0000 = 2.0904 MW = ΣPload + Ploss = 2.0000 + 0.0904 = 2.0904 MW. Q balance: ΣQinj = 361.61 kvar = Qloss + Qshunt = 361.61 + (0.00) = 361.61 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.39e-09 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus S at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus L at 1.05174 pu → 1.05174 vs limit 1.05000 pu FAIL
Result2/3 checks pass → FAIL; V 1.0000–1.0517 pu, losses 90.4 kW; governing: maximum voltage. No rating_mva on C1: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/10 = 12.1 Ω; z = 0.025 + j0.1 pu; load P = 0.2, Q = −0.6 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.110000V² + 0.00425 = 0 → V = 1.05174 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −1.9071°; S_from = 2.0904 − j5.6384 MVA; series loss |I|²z = 90.40 + j361.61 (kW, kvar); slack supplies 2.09040 − j5.63839 (MW, Mvar) (validation case psas-2bus-leading-overvoltage)

Example 6 — Ferranti rise on a 300 km open-ended 132 kV line

An unloaded long line modelled as a nominal π: the far-end charging current through the series impedance lifts the open end to 1.053 pu.

Given: Sbase = 100 MVA, 50 Hz. Buses: A (132 kV, SLACK at 132 kV (1 pu) ∠0°); B (132 kV, PQ). Branches: OHL1 LINE A–B: 300 km × (0.07 + j0.4) Ω/km; Btotal 0.00084 S. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases132 kV: Zbase = 132² / 100 = 174.24 Ω; powers ÷ 100 MVA
Branch impedancesOHL1: (0.07 + j0.4) × 300 = 21.0000 + j120.0000 Ω; z = (21.0000 + j120.0000) / 174.24 = 0.120523 + j0.688705 pu; y = 1/z = 0.2465 − j1.4089 pu; Btotal = 0.00084 × 174.24 = 0.146362 pu (B/2 = 0.0731808 at each end)
Scheduled injectionsNet injection = generation − load (machines included): B: S = (0.000 + j0.000)/100 = 0.00000 + j0.00000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YA,A = 0.2465 − j1.3357; YB,B = 0.2465 − j1.3357; YA,B = −0.2465 + j1.4089
Thevenin sourceEth = −Y21V1/Y22 = −(−0.2465 + j1.4089) × 1∠0° / (0.2465 − j1.3357) = 1.05303∠−0.5322° pu; Zth = 1/Y22 = 0.133645 + j0.724017 pu
Closed-form voltageV⁴ + [2(PR + QX) − Eth²]V² + (R² + X²)(P² + Q²) = 0 with P = 0, Q = 0 pu, R + jX = 0.133645 + j0.724017 pu, Eth = 1.05303: V⁴ − 1.108871V² + 0 = 0 → V² = (1.10887 + √1.229595)/2 → V = 1.05303 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0)/(1.10887) → θ = 0.0000° behind Eth; δ2 = −0.5322 − 0.0000 = −0.5322°
Load-flow resultNewton-Raphson: VB = 1.05303∠−0.5322° pu = 138.9999 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: OHL1: SA→ = 0.0716 − j15.0239 MVA, SB→ = 0.0000 + j0.0000 MVA; sum = series loss |I|²(R + jX) 71.57 kW + j408.99 kvar + charging j−15,432.89 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 71.57 kW + j408.99 kvar; shunt Q (SHUNT elements, line charging) −15,432.89 kvar, reported separately; slack supplies P = 0.0716 MW, Q = −15.0239 Mvar. P balance: Pslack + ΣPgen = 0.0716 + 0.0000 = 0.0716 MW = ΣPload + Ploss = 0.0000 + 0.0716 = 0.0716 MW. Q balance: ΣQinj = −15,023.90 kvar = Qloss + Qshunt = 408.99 + (−15,432.89) = −15,023.90 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.07e-10 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus A at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus B at 1.05303 pu → 1.05303 vs limit 1.05000 pu FAIL
Result2/3 checks pass → FAIL; V 1.0000–1.0530 pu, losses 71.6 kW; governing: maximum voltage. No rating_mva on OHL1: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 132²/100 = 174.24 Ω; z = 0.120523 + j0.688705 pu; Thevenin at the load bus E_th = 1.05303∠−0.5322° pu, Z_th = 0.133645 + j0.724017 pu; load P = 0, Q = 0 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.108871V² + 0 = 0 → V = 1.05303 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −0.5322°; S_from = 0.0716 − j15.0239 MVA; series loss |I|²z = 71.57 + j408.99 (kW, kvar); shunt Q (charging/capacitor) −15432.89 kvar, not a loss; slack supplies 0.07157 − j15.02390 (MW, Mvar) (validation case psas-ferranti-open-line)

Example 7 — 33 kV cable loaded past its rating

Voltage is fine but the 5 MVA cable carries 5.6 MVA, so branch loading fails and governs.

Given: Sbase = 10 MVA, 50 Hz. Buses: SUB (33 kV, SLACK at 33 kV (1 pu) ∠0°); PLANT (33 kV, PQ, load 5 MW + j2.5 Mvar). Branches: FDR1 CABLE SUB–PLANT: 0.625 + j0.5 Ω; rated 5 MVA. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesFDR1: z = (0.6250 + j0.5000) / 108.9 = 0.00573921 + j0.00459137 pu; y = 1/z = 106.2439 − j84.9951 pu
Scheduled injectionsNet injection = generation − load (machines included): PLANT: S = (−5.000 − j2.500)/10 = −0.50000 − j0.25000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YSUB,SUB = 106.2439 − j84.9951; YPLANT,PLANT = 106.2439 − j84.9951; YSUB,PLANT = −106.2439 + j84.9951
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.5, Q = 0.25 pu, R + jX = 0.005739 + j0.004591 pu, E = 1.00000: V⁴ − 0.991965V² + 1.6881e-05 = 0 → V² = (0.991965 + √0.983927)/2 → V = 0.99597 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.000860882)/(0.995966) → θ = 0.0495° behind E; δ2 = 0.0000 − 0.0495 = −0.0495°
Load-flow resultNewton-Raphson: VPLANT = 0.99597∠−0.0495° pu = 32.8669 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: FDR1: SSUB→ = 5.0181 + j2.5145 MVA, SPLANT→ = −5.0000 − j2.5000 MVA; loss = sum = |I|²(R + jX) = 18.08 kW + j14.46 kvar; loading |Sfrom|/rating = 5.6128/5 = 112.26 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 18.08 kW + j14.46 kvar; slack supplies P = 5.0181 MW, Q = 2.5145 Mvar. P balance: Pslack + ΣPgen = 5.0181 + 0.0000 = 5.0181 MW = ΣPload + Ploss = 5.0000 + 0.0181 = 5.0181 MW. Q balance: ΣQinj = 14.46 kvar = Qloss + Qshunt = 14.46 + (0.00) = 14.46 kvar
Convergenceconverged after 3 iterations; largest power mismatch 3.50e-08 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus PLANT at 0.99597 pu → 0.99597 vs limit 0.95000 pu PASS
Maximum voltagehighest bus SUB at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch FDR1 → 112.26 vs limit 100.00 % FAIL
Result3/4 checks pass → FAIL; V 0.9960–1.0000 pu, losses 18.1 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0.00573921 + j0.00459137 pu; load P = 0.5, Q = 0.25 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.991965V² + 1.6881e−05 = 0 → V = 0.99597 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −0.0495°; S_from = 5.0181 + j2.5145 MVA; series loss |I|²z = 18.08 + j14.46 (kW, kvar); loading 5.6128/5 = 112.26 %; slack supplies 5.01808 + j2.51446 (MW, Mvar) (validation case psas-2bus-branch-overload)

Example 8 — Project limits 0.90–1.10 pu and 80 % loading

A 0.947 pu voltage that would fail the default 0.95 pu limit passes the project's 0.90 pu limit, and 75 % loading passes the 80 % cap.

Given: Sbase = 10 MVA, 50 Hz. Buses: S (22 kV, SLACK at 22 kV (1 pu) ∠0°); R (22 kV, PQ, load 4 MW + j3 Mvar). Branches: SWER LINE S–R: 2.42 + j4.84 Ω; rated 7 MVA. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.9–1.1 pu, loading ≤ 80 %.

Per-unit bases22 kV: Zbase = 22² / 10 = 48.4 Ω; powers ÷ 10 MVA
Branch impedancesSWER: z = (2.4200 + j4.8400) / 48.4 = 0.05 + j0.1 pu; y = 1/z = 4.0000 − j8.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): R: S = (−4.000 − j3.000)/10 = −0.40000 − j0.30000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 4.0000 − j8.0000; YR,R = 4.0000 − j8.0000; YS,R = −4.0000 + j8.0000
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.4, Q = 0.3 pu, R + jX = 0.050000 + j0.100000 pu, E = 1.00000: V⁴ − 0.900000V² + 0.003125 = 0 → V² = (0.9 + √0.797500)/2 → V = 0.94684 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.025)/(0.946514) → θ = 1.5130° behind E; δ2 = 0.0000 − 1.5130 = −1.5130°
Load-flow resultNewton-Raphson: VR = 0.94684∠−1.5130° pu = 20.8306 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: SWER: SS→ = 4.1394 + j3.2789 MVA, SR→ = −4.0000 − j3.0000 MVA; loss = sum = |I|²(R + jX) = 139.43 kW + j278.86 kvar; loading |Sfrom|/rating = 5.2807/7 = 75.44 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 139.43 kW + j278.86 kvar; slack supplies P = 4.1394 MW, Q = 3.2789 Mvar. P balance: Pslack + ΣPgen = 4.1394 + 0.0000 = 4.1394 MW = ΣPload + Ploss = 4.0000 + 0.1394 = 4.1394 MW. Q balance: ΣQinj = 278.86 kvar = Qloss + Qshunt = 278.86 + (0.00) = 278.86 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.12e-09 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus R at 0.94684 pu → 0.94684 vs limit 0.90000 pu PASS
Maximum voltagehighest bus S at 1.00000 pu → 1.00000 vs limit 1.10000 pu PASS
Branch loadingmost loaded branch SWER → 75.44 vs limit 80.00 % PASS
Result4/4 checks pass → PASS; V 0.9468–1.0000 pu, losses 139.4 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 22²/10 = 48.4 Ω; z = 0.05 + j0.1 pu; load P = 0.4, Q = 0.3 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.900000V² + 0.003125 = 0 → V = 0.94684 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −1.5130°; S_from = 4.1394 + j3.2789 MVA; series loss |I|²z = 139.43 + j278.86 (kW, kvar); loading 5.2807/7 = 75.44 %; slack supplies 4.13943 + j3.27886 (MW, Mvar) (validation case psas-custom-limits)

Example 9 — 415 V cable from per-km data on a 1 MVA base

Per-km impedance × length, a 1 MVA base so the tolerance suits a 134 kVA load, and the 2.9 % LV drop the load flow returns.

Given: Sbase = 1 MVA, 50 Hz. Buses: MSB (0.415 kV, SLACK at 0.415 kV (1 pu) ∠0°); DB1 (0.415 kV, PQ, load 0.12 MW + j0.06 Mvar). Branches: SUBMAIN CABLE MSB–DB1: 0.15 km × (0.232 + j0.0721) Ω/km; rated 0.2 MVA. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases0.415 kV: Zbase = 0.415² / 1 = 0.172225 Ω; powers ÷ 1 MVA
Branch impedancesSUBMAIN: (0.232 + j0.0721) × 0.15 = 0.0348 + j0.0108 Ω; z = (0.0348 + j0.0108) / 0.172225 = 0.202061 + j0.0627958 pu; y = 1/z = 4.5131 − j1.4026 pu
Scheduled injectionsNet injection = generation − load (machines included): DB1: S = (−0.120 − j0.060)/1 = −0.12000 − j0.06000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YMSB,MSB = 4.5131 − j1.4026; YDB1,DB1 = 4.5131 − j1.4026; YMSB,DB1 = −4.5131 + j1.4026
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.12, Q = 0.06 pu, R + jX = 0.202061 + j0.062796 pu, E = 1.00000: V⁴ − 0.943970V² + 0.000805897 = 0 → V² = (0.94397 + √0.887855)/2 → V = 0.97114 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (−0.00458818)/(0.97113) → θ = −0.2707° behind E; δ2 = 0.0000 − (−0.2707) = 0.2707°
Load-flow resultNewton-Raphson: VDB1 = 0.97114∠0.2707° pu = 0.4030 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: SUBMAIN: SMSB→ = 0.1239 + j0.0612 MVA, SDB1→ = −0.1200 − j0.0600 MVA; loss = sum = |I|²(R + jX) = 3.86 kW + j1.20 kvar; loading |Sfrom|/rating = 0.1382/0.2 = 69.08 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 3.86 kW + j1.20 kvar; slack supplies P = 0.1239 MW, Q = 0.0612 Mvar. P balance: Pslack + ΣPgen = 0.1239 + 0.0000 = 0.1239 MW = ΣPload + Ploss = 0.1200 + 0.0039 = 0.1239 MW. Q balance: ΣQinj = 1.20 kvar = Qloss + Qshunt = 1.20 + (0.00) = 1.20 kvar
Convergenceconverged after 4 iterations; largest power mismatch 2.53e-12 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus DB1 at 0.97114 pu → 0.97114 vs limit 0.95000 pu PASS
Maximum voltagehighest bus MSB at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch SUBMAIN → 69.08 vs limit 100.00 % PASS
Result4/4 checks pass → PASS; V 0.9711–1.0000 pu, losses 3.9 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 0.415²/1 = 0.172225 Ω; z = 0.202061 + j0.0627958 pu; load P = 0.12, Q = 0.06 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.943970V² + 0.000805897 = 0 → V = 0.97114 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle 0.2707°; S_from = 0.1239 + j0.0612 MVA; series loss |I|²z = 3.86 + j1.20 (kW, kvar); loading 0.1382/0.2 = 69.08 %; slack supplies 0.12386 + j0.06120 (MW, Mvar) (validation case psas-lv-cable-per-km)

Example 10 — 1.5 MVA 11/0.433 kV transformer from nameplate %Z

Nameplate 6 % with X/R 8 on a 1.5 MVA base is the per-unit impedance directly; the LV voltage and the 98 % loading follow.

Given: Sbase = 1.5 MVA, 50 Hz. Buses: HV (11 kV, SLACK at 11 kV (1 pu) ∠0°); LV (0.433 kV, PQ, load 1.2 MW + j0.75 Mvar). Branches: TX1 XFMR HV–LV: 6 % on 1.5 MVA, X/R 8; rated 1.5 MVA. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 1.5 = 80.6667 Ω; 0.433 kV: Zbase = 0.433² / 1.5 = 0.124993 Ω; powers ÷ 1.5 MVA
Branch impedancesTX1: z = 6/100 × 1.5/1.5 = 0.06 pu; R = z/√(1 + 8²) = 0.00744208, X = 8R = 0.0595367 pu; y = 1/z = 2.0672 − j16.5380 pu
Scheduled injectionsNet injection = generation − load (machines included): LV: S = (−1.200 − j0.750)/1.5 = −0.80000 − j0.50000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YHV,HV = 2.0672 − j16.5380; YLV,LV = 2.0672 − j16.5380; YHV,LV = −2.0672 + j16.5380
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.8, Q = 0.5 pu, R + jX = 0.007442 + j0.059537 pu, E = 1.00000: V⁴ − 0.928556V² + 0.003204 = 0 → V² = (0.928556 + √0.849400)/2 → V = 0.96182 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.0439083)/(0.960815) → θ = 2.6165° behind E; δ2 = 0.0000 − 2.6165 = −2.6165°
Load-flow resultNewton-Raphson: VLV = 0.96182∠−2.6165° pu = 0.4165 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TX1: SHV→ = 1.2107 + j0.8359 MVA, SLV→ = −1.2000 − j0.7500 MVA; loss = sum = |I|²(R + jX) = 10.74 kW + j85.92 kvar; loading |Sfrom|/rating = 1.4713/1.5 = 98.08 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 10.74 kW + j85.92 kvar; slack supplies P = 1.2107 MW, Q = 0.8359 Mvar. P balance: Pslack + ΣPgen = 1.2107 + 0.0000 = 1.2107 MW = ΣPload + Ploss = 1.2000 + 0.0107 = 1.2107 MW. Q balance: ΣQinj = 85.92 kvar = Qloss + Qshunt = 85.92 + (0.00) = 85.92 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.17e-09 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus LV at 0.96182 pu → 0.96182 vs limit 0.95000 pu PASS
Maximum voltagehighest bus HV at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch TX1 → 98.08 vs limit 100.00 % PASS
Result4/4 checks pass → PASS; V 0.9618–1.0000 pu, losses 10.7 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/1.5 = 80.6667 Ω; z = 0.00744208 + j0.0595367 pu; load P = 0.8, Q = 0.5 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.928556V² + 0.003204 = 0 → V = 0.96182 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −2.6165°; S_from = 1.2107 + j0.8359 MVA; series loss |I|²z = 10.74 + j85.92 (kW, kvar); loading 1.4713/1.5 = 98.08 %; slack supplies 1.21074 + j0.83592 (MW, Mvar) (validation case psas-xfmr-impedance-percent)

Example 11 — Same transformer on the −5 % HV tap

An off-nominal ratio a = 0.95 on the HV side makes the LV bus see 1/a = 1.053 pu behind the transformer impedance, lifting it about 5 %.

Given: Sbase = 1.5 MVA, 50 Hz. Buses: HV (11 kV, SLACK at 11 kV (1 pu) ∠0°); LV (0.433 kV, PQ, load 1.2 MW + j0.75 Mvar). Branches: TX1 XFMR HV–LV: 6 % on 1.5 MVA, X/R 8; tap a = 0.95 on the HV side; rated 1.5 MVA. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 1.5 = 80.6667 Ω; 0.433 kV: Zbase = 0.433² / 1.5 = 0.124993 Ω; powers ÷ 1.5 MVA
Branch impedancesTX1: z = 6/100 × 1.5/1.5 = 0.06 pu; R = z/√(1 + 8²) = 0.00744208, X = 8R = 0.0595367 pu; y = 1/z = 2.0672 − j16.5380 pu; tap a = 0.95: Yff = y/a² = 2.2906 − j18.3246, Yft = Ytf = −y/a = −2.1760 + j17.4084, Ytt = y
Scheduled injectionsNet injection = generation − load (machines included): LV: S = (−1.200 − j0.750)/1.5 = −0.80000 − j0.50000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YHV,HV = 2.2906 − j18.3246; YLV,LV = 2.0672 − j16.5380; YHV,LV = −2.1760 + j17.4084
Thevenin sourceEth = −Y21V1/Y22 = −(−2.1760 + j17.4084) × 1∠0° / (2.0672 − j16.5380) = 1.05263∠0.0000° pu; Zth = 1/Y22 = 0.007442 + j0.059537 pu
Closed-form voltageV⁴ + [2(PR + QX) − Eth²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.8, Q = 0.5 pu, R + jX = 0.007442 + j0.059537 pu, Eth = 1.05263: V⁴ − 1.036589V² + 0.003204 = 0 → V² = (1.03659 + √1.061701)/2 → V = 1.01661 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.0439083)/(1.06921) → θ = 2.3516° behind Eth; δ2 = 0.0000 − 2.3516 = −2.3516°
Load-flow resultNewton-Raphson: VLV = 1.01661∠−2.3516° pu = 0.4402 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TX1: SHV→ = 1.2096 + j0.8269 MVA, SLV→ = −1.2000 − j0.7500 MVA; loss = sum = |I|²(R + jX) = 9.61 kW + j76.91 kvar; loading |Sfrom|/rating = 1.4652/1.5 = 97.68 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 9.61 kW + j76.91 kvar; slack supplies P = 1.2096 MW, Q = 0.8269 Mvar. P balance: Pslack + ΣPgen = 1.2096 + 0.0000 = 1.2096 MW = ΣPload + Ploss = 1.2000 + 0.0096 = 1.2096 MW. Q balance: ΣQinj = 76.91 kvar = Qloss + Qshunt = 76.91 + (0.00) = 76.91 kvar
Convergenceconverged after 4 iterations; largest power mismatch 6.31e-11 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus HV at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus LV at 1.01661 pu → 1.01661 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch TX1 → 97.68 vs limit 100.00 % PASS
Result4/4 checks pass → PASS; V 1.0000–1.0166 pu, losses 9.6 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/1.5 = 80.6667 Ω; z = 0.00744208 + j0.0595367 pu; Thevenin at the load bus E_th = 1.05263∠−0.0000° pu, Z_th = 0.00744208 + j0.0595367 pu; load P = 0.8, Q = 0.5 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.036589V² + 0.003204 = 0 → V = 1.01661 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −2.3516°; S_from = 1.2096 + j0.8269 MVA; series loss |I|²z = 9.61 + j76.91 (kW, kvar); loading 1.4652/1.5 = 97.68 %; slack supplies 1.20961 + j0.82691 (MW, Mvar) (validation case psas-xfmr-off-nominal-tap)

Example 12 — Off-nominal tap solved by pandapower

The tapped transformer through the pandapower backend (an HV tap changer at +(a − 1) × 100 %) lands on the same closed-form LV voltage.

Given: Sbase = 1.5 MVA, 50 Hz. Buses: HV (11 kV, SLACK at 11 kV (1 pu) ∠0°); LV (0.433 kV, PQ, load 1.2 MW + j0.75 Mvar). Branches: TX1 XFMR HV–LV: 6 % on 1.5 MVA, X/R 8; tap a = 0.95 on the HV side; rated 1.5 MVA. Solver pandapower (NR); limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 1.5 = 80.6667 Ω; 0.433 kV: Zbase = 0.433² / 1.5 = 0.124993 Ω; powers ÷ 1.5 MVA
Branch impedancesTX1: z = 6/100 × 1.5/1.5 = 0.06 pu; R = z/√(1 + 8²) = 0.00744208, X = 8R = 0.0595367 pu; y = 1/z = 2.0672 − j16.5380 pu; tap a = 0.95: Yff = y/a² = 2.2906 − j18.3246, Yft = Ytf = −y/a = −2.1760 + j17.4084, Ytt = y
Scheduled injectionsNet injection = generation − load (machines included): LV: S = (−1.200 − j0.750)/1.5 = −0.80000 − j0.50000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YHV,HV = 2.2906 − j18.3246; YLV,LV = 2.0672 − j16.5380; YHV,LV = −2.1760 + j17.4084
Thevenin sourceEth = −Y21V1/Y22 = −(−2.1760 + j17.4084) × 1∠0° / (2.0672 − j16.5380) = 1.05263∠0.0000° pu; Zth = 1/Y22 = 0.007442 + j0.059537 pu
Closed-form voltageV⁴ + [2(PR + QX) − Eth²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.8, Q = 0.5 pu, R + jX = 0.007442 + j0.059537 pu, Eth = 1.05263: V⁴ − 1.036589V² + 0.003204 = 0 → V² = (1.03659 + √1.061701)/2 → V = 1.01661 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.0439083)/(1.06921) → θ = 2.3516° behind Eth; δ2 = 0.0000 − 2.3516 = −2.3516°
Load-flow resultpandapower (NR): VLV = 1.01661∠−2.3516° pu = 0.4402 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TX1: SHV→ = 1.2096 + j0.8269 MVA, SLV→ = −1.2000 − j0.7500 MVA; loss = sum = |I|²(R + jX) = 9.61 kW + j76.91 kvar; loading |Sfrom|/rating = 1.4652/1.5 = 97.68 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 9.61 kW + j76.91 kvar; slack supplies P = 1.2096 MW, Q = 0.8269 Mvar. P balance: Pslack + ΣPgen = 1.2096 + 0.0000 = 1.2096 MW = ΣPload + Ploss = 1.2000 + 0.0096 = 1.2096 MW. Q balance: ΣQinj = 76.91 kvar = Qloss + Qshunt = 76.91 + (0.00) = 76.91 kvar
Convergencepandapower Newton-Raphson converged in 3 iterations on its own mismatch tolerance PASS
Minimum voltagelowest bus HV at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus LV at 1.01661 pu → 1.01661 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch TX1 → 97.68 vs limit 100.00 % PASS
Result4/4 checks pass → PASS; V 1.0000–1.0166 pu, losses 9.6 kW; governing: branch loading
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/1.5 = 80.6667 Ω; z = 0.00744208 + j0.0595367 pu; Thevenin at the load bus E_th = 1.05263∠−0.0000° pu, Z_th = 0.00744208 + j0.0595367 pu; load P = 0.8, Q = 0.5 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.036589V² + 0.003204 = 0 → V = 1.01661 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −2.3516°; S_from = 1.2096 + j0.8269 MVA; series loss |I|²z = 9.61 + j76.91 (kW, kvar); loading 1.4652/1.5 = 97.68 %; slack supplies 1.20961 + j0.82691 (MW, Mvar) (validation case psas-xfmr-tap-pandapower)

Example 13 — 3 Mvar shunt capacitor lifts a sagging bus

Without the capacitor the load bus sits at 0.930 pu (fails); a 3 Mvar constant-admittance capacitor brings it back inside limits. Its output is shunt Q, reported apart from the line's I²X loss.

Given: Sbase = 10 MVA, 50 Hz. Buses: S (11 kV, SLACK at 11 kV (1 pu) ∠0°); L (11 kV, PQ, load 5 MW + j4 Mvar). Branches: LN1 LINE S–L: 0.605 + j1.21 Ω; CAP1 SHUNT at L: 0 − j40.3333 Ω to earth. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 10 = 12.1 Ω; powers ÷ 10 MVA
Branch impedancesLN1: z = (0.6050 + j1.2100) / 12.1 = 0.05 + j0.1 pu; y = 1/z = 4.0000 − j8.0000 pu
CAP1: zsh = (0.0000 − j40.3333) / 12.1 = 0.00000 − j3.33333 pu → ysh = 0.00000 + j0.30000 pu (3.000 Mvar of capacitive output at 1 pu)
Scheduled injectionsNet injection = generation − load (machines included): L: S = (−5.000 − j4.000)/10 = −0.50000 − j0.40000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 4.0000 − j8.0000; YL,L = 4.0000 − j7.7000; YS,L = −4.0000 + j8.0000
Thevenin sourceEth = −Y21V1/Y22 = −(−4.0000 + j8.0000) × 1∠0° / (4.0000 − j7.7000) = 1.03080∠−0.8859° pu; Zth = 1/Y22 = 0.053128 + j0.102271 pu
Closed-form voltageV⁴ + [2(PR + QX) − Eth²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.5, Q = 0.4 pu, R + jX = 0.053128 + j0.102271 pu, Eth = 1.03080: V⁴ − 0.927613V² + 0.00544561 = 0 → V² = (0.927613 + √0.838684)/2 → V = 0.96005 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.0298844)/(0.989177) → θ = 1.7305° behind Eth; δ2 = −0.8859 − 1.7305 = −2.6164°
Load-flow resultNewton-Raphson: VL = 0.96005∠−2.6164° pu = 10.5606 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: LN1: SS→ = 5.1439 + j1.5227 MVA, SL→ = −5.0000 − j1.2349 MVA; loss = sum = |I|²(R + jX) = 143.89 kW + j287.78 kvar
CAP1 (shunt at L): S = 0.0000 − j2.7651 MVA (generates 2.7651 Mvar at the solved voltage)
Losses and balanceTotal series losses Σ|I|²(R + jX) = 143.89 kW + j287.78 kvar; shunt Q (SHUNT elements, line charging) −2,765.11 kvar, reported separately; slack supplies P = 5.1439 MW, Q = 1.5227 Mvar. P balance: Pslack + ΣPgen = 5.1439 + 0.0000 = 5.1439 MW = ΣPload + Ploss = 5.0000 + 0.1439 = 5.1439 MW. Q balance: ΣQinj = −2,477.33 kvar = Qloss + Qshunt = 287.78 + (−2,765.11) = −2,477.33 kvar
Convergenceconverged after 4 iterations; largest power mismatch 8.76e-10 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus L at 0.96005 pu → 0.96005 vs limit 0.95000 pu PASS
Maximum voltagehighest bus S at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9600–1.0000 pu, losses 143.9 kW; governing: minimum voltage. No rating_mva on LN1: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/10 = 12.1 Ω; z = 0.05 + j0.1 pu; Thevenin at the load bus E_th = 1.03080∠−0.8859° pu, Z_th = 0.0531279 + j0.102271 pu; load P = 0.5, Q = 0.4 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.927613V² + 0.00544561 = 0 → V = 0.96005 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −2.6164°; S_from = 5.1439 + j1.5227 MVA; series loss |I|²z = 143.89 + j287.78 (kW, kvar); shunt Q (charging/capacitor) −2765.12 kvar, not a loss; without the capacitor V = 0.92955 pu (quartic with E = 1, R + jX = z); slack supplies 5.14389 + j1.52267 (MW, Mvar) (validation case psas-shunt-capacitor)

Example 14 — PV generator bus on a reactive tie (power-angle equation)

A 6 MW generator holding 1.02 pu: δ from P = V₁V₂ sin δ / X, then the reactive power each end supplies.

Given: Sbase = 10 MVA, 50 Hz. Buses: GRID (33 kV, SLACK at 33 kV (1 pu) ∠0°); GEN (33 kV, PV holding 33.66 kV (1.02 pu), Pgen 6 MW). Branches: TIE LINE GRID–GEN: 0 + j10.89 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesTIE: z = (0.0000 + j10.8900) / 108.9 = 0 + j0.1 pu; y = 1/z = 0.0000 − j10.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): GEN: P = 6.000/10 = 0.6 pu at |V| = 1.02 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGRID,GRID = 0.0000 − j10.0000; YGEN,GEN = 0.0000 − j10.0000; YGRID,GEN = 0.0000 + j10.0000
Power-angle equationP2 = V2²G22 + V1V2(G21 cos δ + B21 sin δ): 0.6 = 1.02² × 0 + 1 × 1.02 × (0 cos δ + 10 sin δ) → 0 cos δ + 10.2 sin δ = 0.6 → δ = atan2(10.2, 0) − arccos(0.6/10.2) = 3.3723° (relative to the slack)
Reactive powerQ2 = −V2²B22 + V1V2(G21 sin δ − B21 cos δ) = −1.02² × (−10) + 1.02 × (0 × 0.0588235 − 10 × 0.998268) = 0.221662 pu = 2.2166 Mvar; engine Qinj = 2.2166 Mvar
Load-flow resultNewton-Raphson: VGEN = 1.02000∠3.3723° pu = 33.6600 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TIE: SGRID→ = −6.0000 − j1.8234 MVA, SGEN→ = 6.0000 + j2.2166 MVA; loss = sum = |I|²(R + jX) = 0.00 kW + j393.25 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 0.00 kW + j393.25 kvar; slack supplies P = −6.0000 MW, Q = −1.8234 Mvar. P balance: Pslack + ΣPgen = −6.0000 + 6.0000 = 0.0000 MW = ΣPload + Ploss = 0.0000 + 0.0000 = 0.0000 MW. Q balance: ΣQinj = 393.25 kvar = Qloss + Qshunt = 393.25 + (0.00) = 393.25 kvar
Convergenceconverged after 3 iterations; largest power mismatch 3.46e-10 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus GRID at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus GEN at 1.02000 pu → 1.02000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 1.0000–1.0200 pu, losses 0.0 kW; governing: minimum voltage. No rating_mva on TIE: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0 + j0.1 pu; PV bus P = 0.6 pu at |V| = 1.02: P = V²G₂₂ + V₁V₂(G₂₁cos δ + B₂₁sin δ) gives δ = 3.3723°; Q = −V²B₂₂ + V₁V₂(G₂₁sin δ − B₂₁cos δ) = 0.221662 pu = 2.2166 Mvar; S_from = −6.0000 − j1.8234 MVA; series loss |I|²z = 0.00 + j393.25 (kW, kvar); slack supplies −6.00000 − j1.82338 (MW, Mvar) (validation case psas-pv-bus-lossless)

Example 15 — PV bus with local load on a lossy line

Net 3 MW export from a bus held at 1.03 pu through R + jX: the PV angle from G and B terms, and the generator's reactive output.

Given: Sbase = 10 MVA, 50 Hz. Buses: GRID (11 kV, SLACK at 11 kV (1 pu) ∠0°); MILL (11 kV, PV holding 11.33 kV (1.03 pu), Pgen 4 MW, load 1 MW + j0.5 Mvar). Branches: LN1 LINE GRID–MILL: 0.605 + j1.21 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 10 = 12.1 Ω; powers ÷ 10 MVA
Branch impedancesLN1: z = (0.6050 + j1.2100) / 12.1 = 0.05 + j0.1 pu; y = 1/z = 4.0000 − j8.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): MILL: P = 3.000/10 = 0.3 pu at |V| = 1.03 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGRID,GRID = 4.0000 − j8.0000; YMILL,MILL = 4.0000 − j8.0000; YGRID,MILL = −4.0000 + j8.0000
Power-angle equationP2 = V2²G22 + V1V2(G21 cos δ + B21 sin δ): 0.3 = 1.03² × 4 + 1 × 1.03 × (−4 cos δ + 8 sin δ) → −4.12 cos δ + 8.24 sin δ = −3.9436 → δ = atan2(8.24, −4.12) − arccos(−3.9436/9.2126) = 1.2202° (relative to the slack)
Reactive powerQ2 = −V2²B22 + V1V2(G21 sin δ − B21 cos δ) = −1.03² × (−8) + 1.03 × (−4 × 0.0212944 − 8 × 0.999773) = 0.161336 pu = 1.6134 Mvar; engine Qinj = 1.6134 Mvar
Load-flow resultNewton-Raphson: VMILL = 1.03000∠1.2202° pu = 11.3300 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: LN1: SGRID→ = −2.9453 − j1.5040 MVA, SMILL→ = 3.0000 + j1.6134 MVA; loss = sum = |I|²(R + jX) = 54.68 kW + j109.37 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 54.68 kW + j109.37 kvar; slack supplies P = −2.9453 MW, Q = −1.5040 Mvar. P balance: Pslack + ΣPgen = −2.9453 + 4.0000 = 1.0547 MW = ΣPload + Ploss = 1.0000 + 0.0547 = 1.0547 MW. Q balance: ΣQinj = 109.37 kvar = Qloss + Qshunt = 109.37 + (0.00) = 109.37 kvar
Convergenceconverged after 3 iterations; largest power mismatch 2.46e-08 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus GRID at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus MILL at 1.03000 pu → 1.03000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 1.0000–1.0300 pu, losses 54.7 kW; governing: minimum voltage. No rating_mva on LN1: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/10 = 12.1 Ω; z = 0.05 + j0.1 pu; PV bus P = 0.3 pu at |V| = 1.03: P = V²G₂₂ + V₁V₂(G₂₁cos δ + B₂₁sin δ) gives δ = 1.2202°; Q = −V²B₂₂ + V₁V₂(G₂₁sin δ − B₂₁cos δ) = 0.161336 pu = 1.6134 Mvar; S_from = −2.9453 − j1.5040 MVA; series loss |I|²z = 54.68 + j109.37 (kW, kvar); slack supplies −2.94532 − j1.50399 (MW, Mvar) (validation case psas-pv-bus-lossy-with-load)

Example 16 — PV generator inside its Q limits (Gauss-Seidel)

Gauss-Seidel checks the generator's reactive limits each sweep: holding 1.05 pu needs 5.42 Mvar, inside ±6 Mvar, so the bus stays PV and sits exactly on the 1.05 pu limit (a pass).

Given: Sbase = 10 MVA, 50 Hz. Buses: GRID (33 kV, SLACK at 33 kV (1 pu) ∠0°); GEN (33 kV, PV holding 34.65 kV (1.05 pu), Pgen 6 MW, Q limits −6 … 6 Mvar). Branches: TIE LINE GRID–GEN: 0 + j10.89 Ω. Solver Gauss-Seidel, tolerance 1e-08 pu, ≤ 500 iterations, acceleration α = 1.6; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesTIE: z = (0.0000 + j10.8900) / 108.9 = 0 + j0.1 pu; y = 1/z = 0.0000 − j10.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): GEN: P = 6.000/10 = 0.6 pu at |V| = 1.05 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGRID,GRID = 0.0000 − j10.0000; YGEN,GEN = 0.0000 − j10.0000; YGRID,GEN = 0.0000 + j10.0000
Gauss-Seidel startPV bus GEN from a flat start: Q = −Im{V*iΣYikVk} = 0.52500 pu; each sweep updates V like a PQ bus with that Q, accelerates it, V ← V + 1.6(Vnew − V), and only then resets |V| to 1.05 pu (α moves the angle, never the magnitude). If the generator's QG = Q + Qload leaves its limits the bus is held PQ at the limit until its voltage crosses back over the set-point
Power-angle equationP2 = V2²G22 + V1V2(G21 cos δ + B21 sin δ): 0.6 = 1.05² × 0 + 1 × 1.05 × (0 cos δ + 10 sin δ) → 0 cos δ + 10.5 sin δ = 0.6 → δ = atan2(10.5, 0) − arccos(0.6/10.5) = 3.2758° (relative to the slack)
Reactive powerQ2 = −V2²B22 + V1V2(G21 sin δ − B21 cos δ) = −1.05² × (−10) + 1.05 × (0 × 0.0571429 − 10 × 0.998366) = 0.542157 pu = 5.4216 Mvar; engine Qinj = 5.4216 Mvar
Q limitsQG = 5.422 Mvar vs −6 … 6 Mvar: inside the limits, so the bus stays PV at 1.05 pu
Load-flow resultGauss-Seidel: VGEN = 1.05000∠3.2758° pu = 34.6500 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TIE: SGRID→ = −6.0000 − j4.8284 MVA, SGEN→ = 6.0000 + j5.4216 MVA; loss = sum = |I|²(R + jX) = 0.00 kW + j593.14 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 0.00 kW + j593.14 kvar; slack supplies P = −6.0000 MW, Q = −4.8284 Mvar. P balance: Pslack + ΣPgen = −6.0000 + 6.0000 = 0.0000 MW = ΣPload + Ploss = 0.0000 + 0.0000 = 0.0000 MW. Q balance: ΣQinj = 593.14 kvar = Qloss + Qshunt = 593.14 + (0.00) = 593.14 kvar
Convergenceconverged after 26 iterations; largest |ΔV| in the last sweep 7.66e-09 vs tolerance 1e-08 pu; power mismatch of the returned voltages 2.62e-08 pu PASS
Minimum voltagelowest bus GRID at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus GEN at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 1.0000–1.0500 pu, losses 0.0 kW; governing: minimum voltage. No rating_mva on TIE: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0 + j0.1 pu; PV bus P = 0.6 pu at |V| = 1.05: P = V²G₂₂ + V₁V₂(G₂₁cos δ + B₂₁sin δ) gives δ = 3.2758°; Q = −V²B₂₂ + V₁V₂(G₂₁sin δ − B₂₁cos δ) = 0.542157 pu = 5.4216 Mvar; S_from = −6.0000 − j4.8284 MVA; series loss |I|²z = 0.00 + j593.14 (kW, kvar); Q = 5.4216 Mvar lies inside Q_min −6 / Q_max +6 Mvar, so the bus stays PV at 1.05 pu; slack supplies −6.00000 − j4.82843 (MW, Mvar) (validation case psas-pv-qlimits-gauss-seidel)

Example 17 — PV generator held at Q_max (Gauss-Seidel)

The same generator with Q_max = 3 Mvar: holding 1.05 pu needs 5.42 Mvar, so it is held at 3 Mvar and the bus is solved as PQ — it settles at 1.027 pu, below its set-point, which keeps it at the limit.

Given: Sbase = 10 MVA, 50 Hz. Buses: GRID (33 kV, SLACK at 33 kV (1 pu) ∠0°); GEN (33 kV, PV holding 34.65 kV (1.05 pu), Pgen 6 MW, Q limits −6 … 3 Mvar). Branches: TIE LINE GRID–GEN: 0 + j10.89 Ω. Solver Gauss-Seidel, tolerance 1e-08 pu, ≤ 500 iterations, acceleration α = 1.6; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesTIE: z = (0.0000 + j10.8900) / 108.9 = 0 + j0.1 pu; y = 1/z = 0.0000 − j10.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): GEN: P = 6.000/10 = 0.6 pu at |V| = 1.05 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGRID,GRID = 0.0000 − j10.0000; YGEN,GEN = 0.0000 − j10.0000; YGRID,GEN = 0.0000 + j10.0000
Gauss-Seidel startPV bus GEN from a flat start: Q = −Im{V*iΣYikVk} = 0.52500 pu; each sweep updates V like a PQ bus with that Q, accelerates it, V ← V + 1.6(Vnew − V), and only then resets |V| to 1.05 pu (α moves the angle, never the magnitude). If the generator's QG = Q + Qload leaves its limits the bus is held PQ at the limit until its voltage crosses back over the set-point
Power-angle equationP2 = V2²G22 + V1V2(G21 cos δ + B21 sin δ): 0.6 = 1.05² × 0 + 1 × 1.05 × (0 cos δ + 10 sin δ) → 0 cos δ + 10.5 sin δ = 0.6 → δ = atan2(10.5, 0) − arccos(0.6/10.5) = 3.2758° (relative to the slack)
Reactive powerQ2 = −V2²B22 + V1V2(G21 sin δ − B21 cos δ) = −1.05² × (−10) + 1.05 × (0 × 0.0571429 − 10 × 0.998366) = 0.542157 pu = 5.4216 Mvar
Q limitsQG = 5.422 Mvar vs −6 … 3 Mvar: above Qmax, so the generator is held at 3.000 Mvar and the bus is solved as PQ with Qnet = 3.000 − 0.000 = 3.000 Mvar = 0.3 pu
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = −0.6, Q = −0.3 pu, R + jX = 0.000000 + j0.100000 pu, E = 1.00000: V⁴ − 1.060000V² + 0.0045 = 0 → V² = (1.06 + √1.105600)/2 → V = 1.02749 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (−0.06)/(1.02574) → θ = −3.3477° behind E; δ2 = 0.0000 − (−3.3477) = 3.3477°
Holdat Qmax the bus sits below its set-point (1.02749 vs 1.05 pu), so it stays PQ: holding 1.05 pu would need a QG outside the limit (Glover, Sarma & Overbye §6.5)
Load-flow resultGauss-Seidel: VGEN = 1.02749∠3.3477° pu = 33.9072 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TIE: SGRID→ = −6.0000 − j2.5738 MVA, SGEN→ = 6.0000 + j3.0000 MVA; loss = sum = |I|²(R + jX) = 0.00 kW + j426.24 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 0.00 kW + j426.24 kvar; slack supplies P = −6.0000 MW, Q = −2.5738 Mvar. P balance: Pslack + ΣPgen = −6.0000 + 6.0000 = 0.0000 MW = ΣPload + Ploss = 0.0000 + 0.0000 = 0.0000 MW. Q balance: ΣQinj = 426.24 kvar = Qloss + Qshunt = 426.24 + (0.00) = 426.24 kvar
Convergenceconverged after 43 iterations; largest |ΔV| in the last sweep 8.33e-09 vs tolerance 1e-08 pu; power mismatch of the returned voltages 3.19e-08 pu PASS
Minimum voltagelowest bus GRID at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus GEN at 1.02749 pu → 1.02749 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 1.0000–1.0275 pu, losses 0.0 kW; governing: minimum voltage. PV bus(es) held at a reactive limit, so not at their voltage set-point: GEN (Q_max). No rating_mva on TIE: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0 + j0.1 pu; at its set-point |V| = 1.05 pu the generator would need Q_G = Q_net + Q_load = 5.4216 + 0 = 5.4216 Mvar, above Q_max 3 Mvar, so it is held at the limit and the bus is PQ with Q_net = 3 − 0 = 3 Mvar; load P = −0.6, Q = −0.3 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.060000V² + 0.0045 = 0 → V = 1.02749 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle 3.3477°; S_from = −6.0000 − j2.5738 MVA; series loss |I|²z = 0.00 + j426.24 (kW, kvar); V = 1.02749 pu is below the set-point, so the bus stays held (PV→PQ switching with hold, Glover, Sarma & Overbye §6.5); slack supplies −6.00000 − j2.57376 (MW, Mvar). (Textbook edition and example/figure numbers pending verification.) (validation case psas-pv-qmax-binding-gauss-seidel)

Example 18 — Generator Q limit with a local reactive load (Newton-Raphson)

The limit applies to the generator, not the bus: holding 1.02 pu needs 2.16 Mvar net, inside 3 Mvar, but 4.16 Mvar from the machine once the 2 Mvar local load is added — so the generator is held at 3 Mvar and the bus sags to 1.009 pu.

Given: Sbase = 10 MVA, 50 Hz. Buses: GRID (33 kV, SLACK at 33 kV (1 pu) ∠0°); GEN (33 kV, PV holding 33.66 kV (1.02 pu), Pgen 6 MW, Q limits −3 … 3 Mvar, load 1 MW + j2 Mvar). Branches: TIE LINE GRID–GEN: 0 + j10.89 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesTIE: z = (0.0000 + j10.8900) / 108.9 = 0 + j0.1 pu; y = 1/z = 0.0000 − j10.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): GEN: P = 5.000/10 = 0.5 pu at |V| = 1.02 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGRID,GRID = 0.0000 − j10.0000; YGEN,GEN = 0.0000 − j10.0000; YGRID,GEN = 0.0000 + j10.0000
Power-angle equationP2 = V2²G22 + V1V2(G21 cos δ + B21 sin δ): 0.5 = 1.02² × 0 + 1 × 1.02 × (0 cos δ + 10 sin δ) → 0 cos δ + 10.2 sin δ = 0.5 → δ = atan2(10.2, 0) − arccos(0.5/10.2) = 2.8097° (relative to the slack)
Reactive powerQ2 = −V2²B22 + V1V2(G21 sin δ − B21 cos δ) = −1.02² × (−10) + 1.02 × (0 × 0.0490196 − 10 × 0.998798) = 0.216262 pu = 2.1626 Mvar
Q limitsQG = Q2 + Qload = 2.163 + 2.000 = 4.163 Mvar vs −3 … 3 Mvar: above Qmax, so the generator is held at 3.000 Mvar and the bus is solved as PQ with Qnet = 3.000 − 2.000 = 1.000 Mvar = 0.1 pu
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = −0.5, Q = −0.1 pu, R + jX = 0.000000 + j0.100000 pu, E = 1.00000: V⁴ − 1.020000V² + 0.0026 = 0 → V² = (1.02 + √1.030000)/2 → V = 1.00868 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (−0.05)/(1.00744) → θ = −2.8413° behind E; δ2 = 0.0000 − (−2.8413) = 2.8413°
Holdat Qmax the bus sits below its set-point (1.00868 vs 1.02 pu), so it stays PQ: holding 1.02 pu would need a QG outside the limit (Glover, Sarma & Overbye §6.5)
Load-flow resultNewton-Raphson: VGEN = 1.00868∠2.8413° pu = 33.2866 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TIE: SGRID→ = −5.0000 − j0.7445 MVA, SGEN→ = 5.0000 + j1.0000 MVA; loss = sum = |I|²(R + jX) = 0.00 kW + j255.54 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 0.00 kW + j255.54 kvar; slack supplies P = −5.0000 MW, Q = −0.7445 Mvar. P balance: Pslack + ΣPgen = −5.0000 + 6.0000 = 1.0000 MW = ΣPload + Ploss = 1.0000 + 0.0000 = 1.0000 MW. Q balance: ΣQinj = 255.54 kvar = Qloss + Qshunt = 255.54 + (0.00) = 255.54 kvar
Convergenceconverged after 6 iterations; largest power mismatch 1.52e-07 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus GRID at 1.00000 pu → 1.00000 vs limit 0.95000 pu PASS
Maximum voltagehighest bus GEN at 1.00868 pu → 1.00868 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 1.0000–1.0087 pu, losses 0.0 kW; governing: minimum voltage. PV bus(es) held at a reactive limit, so not at their voltage set-point: GEN (Q_max). No rating_mva on TIE: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0 + j0.1 pu; at its set-point |V| = 1.02 pu the generator would need Q_G = Q_net + Q_load = 2.1626 + 2 = 4.1626 Mvar, above Q_max 3 Mvar, so it is held at the limit and the bus is PQ with Q_net = 3 − 2 = 1 Mvar; load P = −0.5, Q = −0.1 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.020000V² + 0.0026 = 0 → V = 1.00868 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle 2.8413°; S_from = −5.0000 − j0.7445 MVA; series loss |I|²z = 0.00 + j255.54 (kW, kvar); V = 1.00868 pu is below the set-point, so the bus stays held (PV→PQ switching with hold, Glover, Sarma & Overbye §6.5); slack supplies −5.00000 − j0.74446 (MW, Mvar). (Textbook edition and example/figure numbers pending verification.) (validation case psas-pv-qmax-local-load-nr)

Example 19 — Generator held at Q_min (pandapower)

A 0.95 pu set-point would make the generator absorb 4.56 Mvar, beyond its −1 Mvar limit: held at Q_min the bus floats up to 0.988 pu instead.

Given: Sbase = 10 MVA, 50 Hz. Buses: GRID (33 kV, SLACK at 33 kV (1 pu) ∠0°); GEN (33 kV, PV holding 31.35 kV (0.95 pu), Pgen 6 MW, Q limits −1 … 6 Mvar). Branches: TIE LINE GRID–GEN: 0 + j10.89 Ω. Solver pandapower (NR); limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases33 kV: Zbase = 33² / 10 = 108.9 Ω; powers ÷ 10 MVA
Branch impedancesTIE: z = (0.0000 + j10.8900) / 108.9 = 0 + j0.1 pu; y = 1/z = 0.0000 − j10.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): GEN: P = 6.000/10 = 0.6 pu at |V| = 0.95 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YGRID,GRID = 0.0000 − j10.0000; YGEN,GEN = 0.0000 − j10.0000; YGRID,GEN = 0.0000 + j10.0000
Power-angle equationP2 = V2²G22 + V1V2(G21 cos δ + B21 sin δ): 0.6 = 0.95² × 0 + 1 × 0.95 × (0 cos δ + 10 sin δ) → 0 cos δ + 9.5 sin δ = 0.6 → δ = atan2(9.5, 0) − arccos(0.6/9.5) = 3.6211° (relative to the slack)
Reactive powerQ2 = −V2²B22 + V1V2(G21 sin δ − B21 cos δ) = −0.95² × (−10) + 0.95 × (0 × 0.0631579 − 10 × 0.998004) = -0.456034 pu = −4.5603 Mvar
Q limitsQG = −4.560 Mvar vs −1 … 6 Mvar: below Qmin, so the generator is held at −1.000 Mvar and the bus is solved as PQ with Qnet = −1.000 − 0.000 = −1.000 Mvar = −0.1 pu
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = −0.6, Q = 0.1 pu, R + jX = 0.000000 + j0.100000 pu, E = 1.00000: V⁴ − 0.980000V² + 0.0037 = 0 → V² = (0.98 + √0.945600)/2 → V = 0.98803 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (−0.06)/(0.98621) → θ = −3.4815° behind E; δ2 = 0.0000 − (−3.4815) = 3.4815°
Holdat Qmin the bus sits above its set-point (0.98803 vs 0.95 pu), so it stays PQ: holding 0.95 pu would need a QG outside the limit (Glover, Sarma & Overbye §6.5)
Load-flow resultpandapower (NR): VGEN = 0.98803∠3.4815° pu = 32.6051 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: TIE: SGRID→ = −6.0000 + j1.3790 MVA, SGEN→ = 6.0000 − j1.0000 MVA; loss = sum = |I|²(R + jX) = 0.00 kW + j379.02 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 0.00 kW + j379.02 kvar; slack supplies P = −6.0000 MW, Q = 1.3790 Mvar. P balance: Pslack + ΣPgen = −6.0000 + 6.0000 = 0.0000 MW = ΣPload + Ploss = 0.0000 + 0.0000 = 0.0000 MW. Q balance: ΣQinj = 379.02 kvar = Qloss + Qshunt = 379.02 + (0.00) = 379.02 kvar
Convergencepandapower Newton-Raphson converged in 3 iterations on its own mismatch tolerance PASS
Minimum voltagelowest bus GEN at 0.98803 pu → 0.98803 vs limit 0.95000 pu PASS
Maximum voltagehighest bus GRID at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9880–1.0000 pu, losses 0.0 kW; governing: minimum voltage. PV bus(es) held at a reactive limit, so not at their voltage set-point: GEN (Q_min). No rating_mva on TIE: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 33²/10 = 108.9 Ω; z = 0 + j0.1 pu; at its set-point |V| = 0.95 pu the generator would need Q_G = Q_net + Q_load = −4.5603 + 0 = −4.5603 Mvar, below Q_min −1 Mvar, so it is held at the limit and the bus is PQ with Q_net = −1 − 0 = −1 Mvar; load P = −0.6, Q = 0.1 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.980000V² + 0.0037 = 0 → V = 0.98803 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle 3.4815°; S_from = −6.0000 + j1.3790 MVA; series loss |I|²z = 0.00 + j379.02 (kW, kvar); V = 0.98803 pu is above the set-point, so the bus stays held (PV→PQ switching with hold, Glover, Sarma & Overbye §6.5); slack supplies −6.00000 + j1.37902 (MW, Mvar). (Textbook edition and example/figure numbers pending verification.) (validation case psas-pv-qmin-binding-pandapower)

Example 20 — Bus load with a motor and an embedded generator

Machines aggregate into the bus injection — the motor adds to load, the generator offsets it — before the two-bus solution.

Given: Sbase = 10 MVA, 50 Hz. Buses: S (11 kV, SLACK at 11 kV (1 pu) ∠0°); PLANT (11 kV, PQ, load 3 MW + j1 Mvar, induction motor 2 MW + j1.2 Mvar, generator 1.5 MW + j0.5 Mvar). Branches: LN1 LINE S–PLANT: 0.605 + j1.21 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases11 kV: Zbase = 11² / 10 = 12.1 Ω; powers ÷ 10 MVA
Branch impedancesLN1: z = (0.6050 + j1.2100) / 12.1 = 0.05 + j0.1 pu; y = 1/z = 4.0000 − j8.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): PLANT: S = (−3.500 − j1.700)/10 = −0.35000 − j0.17000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 4.0000 − j8.0000; YPLANT,PLANT = 4.0000 − j8.0000; YS,PLANT = −4.0000 + j8.0000
Closed-form voltageV⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.35, Q = 0.17 pu, R + jX = 0.050000 + j0.100000 pu, E = 1.00000: V⁴ − 0.931000V² + 0.0018925 = 0 → V² = (0.931 + √0.859191)/2 → V = 0.96383 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.0265)/(0.963463) → θ = 1.5755° behind E; δ2 = 0.0000 − 1.5755 = −1.5755°
Load-flow resultNewton-Raphson: VPLANT = 0.96383∠−1.5755° pu = 10.6021 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: LN1: SS→ = 3.5815 + j1.8630 MVA, SPLANT→ = −3.5000 − j1.7000 MVA; loss = sum = |I|²(R + jX) = 81.49 kW + j162.98 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 81.49 kW + j162.98 kvar; slack supplies P = 3.5815 MW, Q = 1.8630 Mvar. P balance: Pslack + ΣPgen = 3.5815 + 1.5000 = 5.0815 MW = ΣPload + Ploss = 5.0000 + 0.0815 = 5.0815 MW. Q balance: ΣQinj = 162.98 kvar = Qloss + Qshunt = 162.98 + (0.00) = 162.98 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.08e-10 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus PLANT at 0.96383 pu → 0.96383 vs limit 0.95000 pu PASS
Maximum voltagehighest bus S at 1.00000 pu → 1.00000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9638–1.0000 pu, losses 81.5 kW; governing: minimum voltage. No rating_mva on LN1: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 11²/10 = 12.1 Ω; z = 0.05 + j0.1 pu; load P = 0.35, Q = 0.17 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 0.931000V² + 0.0018925 = 0 → V = 0.96383 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle −1.5755°; S_from = 3.5815 + j1.8630 MVA; series loss |I|²z = 81.49 + j162.98 (kW, kvar); slack supplies 3.58149 + j1.86298 (MW, Mvar) (validation case psas-machines-gen-motor)

Example 21 — Slack at 1.02 pu ∠30°, charged cable, 60 Hz (pandapower)

A slack set-point above nominal and a 30° reference angle carry straight through; the cable's charging susceptance enters the Thevenin source.

Given: Sbase = 10 MVA, 60 Hz. Buses: S (13.8 kV, SLACK at 14.076 kV (1.02 pu) ∠30°); L (13.8 kV, PQ, load 4 MW + j2 Mvar). Branches: CBL CABLE S–L: 0.38088 + j0.3809 Ω; Btotal 0.0025 S. Solver pandapower (NR); limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases13.8 kV: Zbase = 13.8² / 10 = 19.044 Ω; powers ÷ 10 MVA
Branch impedancesCBL: z = (0.3809 + j0.3809) / 19.044 = 0.02 + j0.0200011 pu; y = 1/z = 24.9987 − j25.0000 pu; Btotal = 0.0025 × 19.044 = 0.04761 pu (B/2 = 0.023805 at each end)
Scheduled injectionsNet injection = generation − load (machines included): L: S = (−4.000 − j2.000)/10 = −0.40000 − j0.20000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): YS,S = 24.9987 − j24.9762; YL,L = 24.9987 − j24.9762; YS,L = −24.9987 + j25.0000
Thevenin sourceEth = −Y21V1/Y22 = −(−24.9987 + j25.0000) × 1.02∠30° / (24.9987 − j24.9762) = 1.02049∠29.9727° pu; Zth = 1/Y22 = 0.020019 + j0.020001 pu
Closed-form voltageV⁴ + [2(PR + QX) − Eth²]V² + (R² + X²)(P² + Q²) = 0 with P = 0.4, Q = 0.2 pu, R + jX = 0.020019 + j0.020001 pu, Eth = 1.02049: V⁴ − 1.017376V² + 0.000160161 = 0 → V² = (1.01738 + √1.034412)/2 → V = 1.00857 pu
Angletan θ = (PX − QR)/(V² + PR + QX) = (0.00399661)/(1.02923) → θ = 0.2225° behind Eth; δ2 = 29.9727 − 0.2225 = 29.7502°
Load-flow resultpandapower (NR): VL = 1.00857∠29.7502° pu = 13.9183 kV, matching the closed form
Branch flowsSij = ViI*ij at each end: CBL: SS→ = 4.0375 + j1.5477 MVA, SL→ = −4.0000 − j2.0000 MVA; sum = series loss |I|²(R + jX) 37.53 kW + j37.54 kvar + charging j−489.82 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 37.53 kW + j37.54 kvar; shunt Q (SHUNT elements, line charging) −489.82 kvar, reported separately; slack supplies P = 4.0375 MW, Q = 1.5477 Mvar. P balance: Pslack + ΣPgen = 4.0375 + 0.0000 = 4.0375 MW = ΣPload + Ploss = 4.0000 + 0.0375 = 4.0375 MW. Q balance: ΣQinj = −452.28 kvar = Qloss + Qshunt = 37.54 + (−489.82) = −452.28 kvar
Convergencepandapower Newton-Raphson converged in 5 iterations on its own mismatch tolerance PASS
Minimum voltagelowest bus L at 1.00857 pu → 1.00857 vs limit 0.95000 pu PASS
Maximum voltagehighest bus S at 1.02000 pu → 1.02000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 1.0086–1.0200 pu, losses 37.5 kW; governing: minimum voltage. No rating_mva on CBL: loading not checked.
ReferenceHand calculation (closed-form two-bus): Z_base = 13.8²/10 = 19.044 Ω; z = 0.02 + j0.0200011 pu; Thevenin at the load bus E_th = 1.02049∠29.9727° pu, Z_th = 0.0200191 + j0.020001 pu; load P = 0.4, Q = 0.2 pu: V⁴ + [2(PR + QX) − E²]V² + (R² + X²)(P² + Q²) = 0 → V⁴ − 1.017376V² + 0.000160161 = 0 → V = 1.00857 pu; tan θ = (PX − QR)/(V² + PR + QX) → angle 29.7502°; S_from = 4.0375 + j1.5477 MVA; series loss |I|²z = 37.53 + j37.54 (kW, kvar); shunt Q (charging/capacitor) −489.82 kvar, not a loss; slack supplies 4.03753 + j1.54772 (MW, Mvar) (validation case psas-slack-setpoint-60hz-pandapower)

Example 22 — Saadat three-bus system, Gauss-Seidel

A published meshed example: the solution lands on V₂ = 0.98 − j0.06 and V₃ = 1.00 − j0.05 pu, with the slack supplying 409.5 MW + j189 Mvar.

Given: Sbase = 100 MVA, 50 Hz. Buses: 1 (100 kV, SLACK at 105 kV (1.05 pu) ∠0°); 2 (100 kV, PQ, load 256.6 MW + j110.2 Mvar); 3 (100 kV, PQ, load 138.6 MW + j45.2 Mvar). Branches: L12 LINE 1–2: 2 + j4 Ω; L13 LINE 1–3: 1 + j3 Ω; L23 LINE 2–3: 1.25 + j2.5 Ω. Solver Gauss-Seidel, tolerance 1e-08 pu, ≤ 500 iterations, acceleration α = 1.6; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases100 kV: Zbase = 100² / 100 = 100 Ω; powers ÷ 100 MVA
Branch impedancesL12: z = (2.0000 + j4.0000) / 100 = 0.02 + j0.04 pu; y = 1/z = 10.0000 − j20.0000 pu
L13: z = (1.0000 + j3.0000) / 100 = 0.01 + j0.03 pu; y = 1/z = 10.0000 − j30.0000 pu
L23: z = (1.2500 + j2.5000) / 100 = 0.0125 + j0.025 pu; y = 1/z = 16.0000 − j32.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): 2: S = (−256.600 − j110.200)/100 = −2.56600 − j1.10200 pu; 3: S = (−138.600 − j45.200)/100 = −1.38600 − j0.45200 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y1,1 = 20.0000 − j50.0000; Y2,2 = 26.0000 − j52.0000; Y3,3 = 26.0000 − j62.0000; Y1,2 = −10.0000 + j20.0000; Y1,3 = −10.0000 + j30.0000; Y2,3 = −16.0000 + j32.0000
Gauss-Seidel sweep 1V2(1) = [S*/V*(0) − ΣYikVk] / Yii = [(−2.5660 + j1.1020)/1 − [(−10.0000 + j20.0000)(1.0500 + j0.0000) + (−16.0000 + j32.0000)(1.0000 + j0.0000)]] / (26.0000 − j52.0000) = 0.98254 − j0.03100 pu; accelerated V ← 1 + 1.6 × (−0.01746 − j0.03100) = 0.97206 − j0.04960 pu; sweeps repeat until the largest |ΔV| < 1e-08 pu
Mismatch checkSolved voltages 1 1.05000∠0.0000°, 2 0.98184∠−3.5035°, 3 1.00125∠−2.8624° pu; Si = Vi(ΣYikVk)* from them: 1 (slack): S = 409.493 + j188.987 MVA → generation 409.500 MW + j189.000 Mvar; 2: S = −2.5659 − j1.1018 vs −2.5660 − j1.1020 pu scheduled; 3: S = −1.3861 − j0.4521 vs −1.3860 − j0.4520 pu scheduled (differences in the 4th decimal are the rounding of the printed voltages)
Branch flowsSij = ViI*ij at each end: L12: S1→ = 199.5000 + j84.0000 MVA, S2→ = −191.0000 − j67.0000 MVA; loss = sum = |I|²(R + jX) = 8,500.00 kW + j17,000.00 kvar
L13: S1→ = 210.0000 + j105.0000 MVA, S3→ = −205.0000 − j90.0000 MVA; loss = sum = |I|²(R + jX) = 5,000.00 kW + j15,000.00 kvar
L23: S2→ = −65.6000 − j43.2000 MVA, S3→ = 66.4000 + j44.8000 MVA; loss = sum = |I|²(R + jX) = 800.00 kW + j1,600.00 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 14,300.00 kW + j33,600.00 kvar; slack supplies P = 409.5000 MW, Q = 189.0000 Mvar. P balance: Pslack + ΣPgen = 409.5000 + 0.0000 = 409.5000 MW = ΣPload + Ploss = 395.2000 + 14.3000 = 409.5000 MW. Q balance: ΣQinj = 33,600.00 kvar = Qloss + Qshunt = 33,600.00 + (0.00) = 33,600.00 kvar
Convergenceconverged after 40 iterations; largest |ΔV| in the last sweep 6.96e-09 vs tolerance 1e-08 pu; power mismatch of the returned voltages 1.44e-07 pu PASS
Minimum voltagelowest bus 2 at 0.98184 pu → 0.98184 vs limit 0.95000 pu PASS
Maximum voltagehighest bus 1 at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9818–1.0500 pu, losses 14,300.0 kW; governing: minimum voltage. No rating_mva on L12, L13, L23: loading not checked.
ReferenceSaadat, Power System Analysis (2nd ed., McGraw-Hill), Ch. 6 three-bus Gauss-Seidel example (100 MVA base, z12 = 0.02 + j0.04, z13 = 0.01 + j0.03, z23 = 0.0125 + j0.025 pu, here on a 100 kV base so Z_base = 100 Ω): published V2 = 0.98 − j0.06 pu, V3 = 1.00 − j0.05 pu, S1 = 409.5 MW + j189.0 Mvar. Reproduced by an independent rectangular Newton: V2 = 0.98184∠−3.5035°, V3 = 1.00125∠−2.8624° pu; total losses 14.3000 MW. (Textbook edition and example/figure numbers pending verification.) (validation case psas-saadat-3bus-gauss-seidel)

Example 23 — Saadat three-bus system with a PV bus, Newton-Raphson

The same lines with bus 3 voltage-controlled at 1.04 pu and 200 MW: the published V₂ = 0.9717∠−2.696°, δ₃ = −0.499° and Q₃ = 146.2 Mvar.

Given: Sbase = 100 MVA, 50 Hz. Buses: 1 (100 kV, SLACK at 105 kV (1.05 pu) ∠0°); 2 (100 kV, PQ, load 400 MW + j250 Mvar); 3 (100 kV, PV holding 104 kV (1.04 pu), Pgen 200 MW). Branches: L12 LINE 1–2: 2 + j4 Ω; L13 LINE 1–3: 1 + j3 Ω; L23 LINE 2–3: 1.25 + j2.5 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases100 kV: Zbase = 100² / 100 = 100 Ω; powers ÷ 100 MVA
Branch impedancesL12: z = (2.0000 + j4.0000) / 100 = 0.02 + j0.04 pu; y = 1/z = 10.0000 − j20.0000 pu
L13: z = (1.0000 + j3.0000) / 100 = 0.01 + j0.03 pu; y = 1/z = 10.0000 − j30.0000 pu
L23: z = (1.2500 + j2.5000) / 100 = 0.0125 + j0.025 pu; y = 1/z = 16.0000 − j32.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): 2: S = (−400.000 − j250.000)/100 = −4.00000 − j2.50000 pu; 3: P = 200.000/100 = 2 pu at |V| = 1.04 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y1,1 = 20.0000 − j50.0000; Y2,2 = 26.0000 − j52.0000; Y3,3 = 26.0000 − j62.0000; Y1,2 = −10.0000 + j20.0000; Y1,3 = −10.0000 + j30.0000; Y2,3 = −16.0000 + j32.0000
Mismatch checkSolved voltages 1 1.05000∠0.0000°, 2 0.97168∠−2.6965°, 3 1.04000∠−0.4988° pu; Si = Vi(ΣYikVk)* from them: 1 (slack): S = 218.424 + j140.850 MVA → generation 218.423 MW + j140.852 Mvar; 2: S = −4.0000 − j2.5000 vs −4.0000 − j2.5000 pu scheduled; 3: P = 2.0000 vs 2.0000 pu scheduled, Q = 1.4617 pu (146.175 Mvar) (differences in the 4th decimal are the rounding of the printed voltages)
Branch flowsSij = ViI*ij at each end: L12: S1→ = 179.3618 + j118.7339 MVA, S2→ = −170.9684 − j101.9472 MVA; loss = sum = |I|²(R + jX) = 8,393.36 kW + j16,786.72 kvar
L13: S1→ = 39.0610 + j22.1176 MVA, S3→ = −38.8783 − j21.5693 MVA; loss = sum = |I|²(R + jX) = 182.76 kW + j548.29 kvar
L23: S2→ = −229.0316 − j148.0528 MVA, S3→ = 238.8783 + j167.7462 MVA; loss = sum = |I|²(R + jX) = 9,846.71 kW + j19,693.42 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 18,422.83 kW + j37,028.43 kvar; slack supplies P = 218.4228 MW, Q = 140.8515 Mvar. P balance: Pslack + ΣPgen = 218.4228 + 200.0000 = 418.4228 MW = ΣPload + Ploss = 400.0000 + 18.4228 = 418.4228 MW. Q balance: ΣQinj = 37,028.43 kvar = Qloss + Qshunt = 37,028.43 + (0.00) = 37,028.43 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.17e-09 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus 2 at 0.97168 pu → 0.97168 vs limit 0.95000 pu PASS
Maximum voltagehighest bus 1 at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9717–1.0500 pu, losses 18,422.8 kW; governing: minimum voltage. No rating_mva on L12, L13, L23: loading not checked.
ReferenceSaadat, Power System Analysis (2nd ed.), Ch. 6 three−bus example with bus 3 voltage−controlled (1.04 pu, 200 MW; bus 2 load 400 MW + j250 Mvar), solved there by Gauss−Seidel and Newton−Raphson: published V2 = 0.97168∠−2.696°, V3 = 1.04∠−0.4988°, S1 = 218.423 MW + j140.852 Mvar, Q3 = 146.177 Mvar. Independent Newton: V2 = 0.97168∠−2.6965°, δ3 = −0.4988°, Q3 = 146.177 Mvar. (Textbook edition and example/figure numbers pending verification.) (validation case psas-saadat-3bus-pv-nr)

Example 24 — Three-bus slack + PV generator + PQ load

The page's former three-bus example: a 100 MW generator at 1.04 pu pushes power back toward the slack on line 0–1 while the load bus sags to 0.950 pu.

Given: Sbase = 100 MVA, 50 Hz. Buses: 0 (100 kV, SLACK at 105 kV (1.05 pu) ∠0°); 1 (100 kV, PV holding 104 kV (1.04 pu), Pgen 100 MW, Q limits −50 … 150 Mvar); 2 (100 kV, PQ, load 100 MW + j50 Mvar). Branches: L01 LINE 0–1: 2 + j6 Ω; L02 LINE 0–2: 8 + j24 Ω; L12 LINE 1–2: 6 + j18 Ω. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases100 kV: Zbase = 100² / 100 = 100 Ω; powers ÷ 100 MVA
Branch impedancesL01: z = (2.0000 + j6.0000) / 100 = 0.02 + j0.06 pu; y = 1/z = 5.0000 − j15.0000 pu
L02: z = (8.0000 + j24.0000) / 100 = 0.08 + j0.24 pu; y = 1/z = 1.2500 − j3.7500 pu
L12: z = (6.0000 + j18.0000) / 100 = 0.06 + j0.18 pu; y = 1/z = 1.6667 − j5.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): 1: P = 100.000/100 = 1 pu at |V| = 1.04 pu; 2: S = (−100.000 − j50.000)/100 = −1.00000 − j0.50000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y0,0 = 6.2500 − j18.7500; Y1,1 = 6.6667 − j20.0000; Y2,2 = 2.9167 − j8.7500; Y0,1 = −5.0000 + j15.0000; Y0,2 = −1.2500 + j3.7500; Y1,2 = −1.6667 + j5.0000
Mismatch checkSolved voltages 0 1.05000∠0.0000°, 1 1.04000∠1.4243°, 2 0.95008∠−4.1459° pu; Si = Vi(ΣYikVk)* from them: 0 (slack): S = 5.191 + j61.135 MVA → generation 5.191 MW + j61.133 Mvar; 1: P = 1.0000 vs 1.0000 pu scheduled, Q = 0.0444 pu (4.441 Mvar); 2: S = −1.0000 − j0.5000 vs −1.0000 − j0.5000 pu scheduled (differences in the 4th decimal are the rounding of the printed voltages)
Branch flowsSij = ViI*ij at each end: L01: S0→ = −35.2954 + j29.8274 MVA, S1→ = 35.6827 − j28.6653 MVA; loss = sum = |I|²(R + jX) = 387.38 kW + j1,162.14 kvar
L02: S0→ = 40.4859 + j31.3054 MVA, S2→ = −38.5854 − j25.6039 MVA; loss = sum = |I|²(R + jX) = 1,900.51 kW + j5,701.54 kvar
L12: S1→ = 64.3173 + j33.1042 MVA, S2→ = −61.4146 − j24.3961 MVA; loss = sum = |I|²(R + jX) = 2,902.70 kW + j8,708.09 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 5,190.59 kW + j15,571.77 kvar; slack supplies P = 5.1906 MW, Q = 61.1329 Mvar. P balance: Pslack + ΣPgen = 5.1906 + 100.0000 = 105.1906 MW = ΣPload + Ploss = 100.0000 + 5.1906 = 105.1906 MW. Q balance: ΣQinj = 15,571.77 kvar = Qloss + Qshunt = 15,571.77 + (0.00) = 15,571.77 kvar
Convergenceconverged after 4 iterations; largest power mismatch 3.31e-08 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus 2 at 0.95008 pu → 0.95008 vs limit 0.95000 pu PASS
Maximum voltagehighest bus 0 at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9501–1.0500 pu, losses 5,190.6 kW; governing: minimum voltage. No rating_mva on L01, L02, L12: loading not checked.
ReferenceHand calculation (help-page three-bus example; y01 = 5 − j15, y02 = 1.25 − j3.75, y12 = 1.6667 − j5 pu): independent Newton gives V1 = 1.04000∠1.4243°, V2 = 0.95008∠−4.1459° pu, Q1 = 4.439 Mvar; L01 -35.30 MW / loss 0.387 MW, L02 40.49 MW / loss 1.901 MW, L12 64.32 MW / loss 2.903 MW; total loss 5.191 MW (the former page figures 0.9501∠−4.15°, −35.30/40.49/64.32 MW, 5.19 MW agree) (validation case psas-3bus-slack-pv-pq)

Example 25 — Grainger & Stevenson four-bus 230 kV system

A published meshed 230 kV system with line charging and a PV generator: V₂ = 0.982∠−0.976°, V₃ = 0.969∠−1.872°, δ₄ = 1.523° and the slack's 186.8 MW + j114.5 Mvar.

Given: Sbase = 100 MVA, 50 Hz. Buses: 1 (230 kV, SLACK at 230 kV (1 pu) ∠0°, load 50 MW + j30.99 Mvar); 2 (230 kV, PQ, load 170 MW + j105.35 Mvar); 3 (230 kV, PQ, load 200 MW + j123.94 Mvar); 4 (230 kV, PV holding 234.6 kV (1.02 pu), Pgen 318 MW, load 80 MW + j49.58 Mvar). Branches: 1-2 LINE 1–2: 5.33232 + j26.6616 Ω; Btotal 0.000193762 S; 1-3 LINE 1–3: 3.93576 + j19.6788 Ω; Btotal 0.000146503 S; 2-4 LINE 2–4: 3.93576 + j19.6788 Ω; Btotal 0.000146503 S; 3-4 LINE 3–4: 6.72888 + j33.6444 Ω; Btotal 0.000241021 S. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases230 kV: Zbase = 230² / 100 = 529 Ω; powers ÷ 100 MVA
Branch impedances1-2: z = (5.3323 + j26.6616) / 529 = 0.01008 + j0.0504 pu; y = 1/z = 3.8156 − j19.0781 pu; Btotal = 0.000193762 × 529 = 0.1025 pu (B/2 = 0.05125 at each end)
1-3: z = (3.9358 + j19.6788) / 529 = 0.00744 + j0.0372 pu; y = 1/z = 5.1696 − j25.8478 pu; Btotal = 0.000146503 × 529 = 0.0775001 pu (B/2 = 0.03875 at each end)
2-4: z = (3.9358 + j19.6788) / 529 = 0.00744 + j0.0372 pu; y = 1/z = 5.1696 − j25.8478 pu; Btotal = 0.000146503 × 529 = 0.0775001 pu (B/2 = 0.03875 at each end)
3-4: z = (6.7289 + j33.6444) / 529 = 0.01272 + j0.0636 pu; y = 1/z = 3.0237 − j15.1185 pu; Btotal = 0.000241021 × 529 = 0.1275 pu (B/2 = 0.0637501 at each end)
Scheduled injectionsNet injection = generation − load (machines included): 2: S = (−170.000 − j105.350)/100 = −1.70000 − j1.05350 pu; 3: S = (−200.000 − j123.940)/100 = −2.00000 − j1.23940 pu; 4: P = 238.000/100 = 2.38 pu at |V| = 1.02 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y1,1 = 8.9852 − j44.8360; Y2,2 = 8.9852 − j44.8360; Y3,3 = 8.1933 − j40.8638; Y4,4 = 8.1933 − j40.8638; Y1,2 = −3.8156 + j19.0781; Y1,3 = −5.1696 + j25.8478; Y2,4 = −5.1696 + j25.8478; Y3,4 = −3.0237 + j15.1185
Mismatch checkSolved voltages 1 1.00000∠0.0000°, 2 0.98242∠−0.9761°, 3 0.96900∠−1.8722°, 4 1.02000∠1.5231° pu; Si = Vi(ΣYikVk)* from them: 1 (slack): S = 136.812 + j83.525 MVA → generation 186.809 MW + j114.501 Mvar; 2: S = −1.7000 − j1.0535 vs −1.7000 − j1.0535 pu scheduled; 3: S = −2.0001 − j1.2396 vs −2.0000 − j1.2394 pu scheduled; 4: P = 2.3800 vs 2.3800 pu scheduled, Q = 1.3186 pu (131.859 Mvar) (differences in the 4th decimal are the rounding of the printed voltages)
Branch flowsSij = ViI*ij at each end: 1-2: S1→ = 38.6915 + j22.2984 MVA, S2→ = −38.4648 − j31.2363 MVA; sum = series loss |I|²(R + jX) 226.71 kW + j1,133.54 kvar + charging j−10,071.41 kvar
1-3: S1→ = 98.1175 + j61.2124 MVA, S3→ = −97.0861 − j63.5687 MVA; sum = series loss |I|²(R + jX) 1,031.44 kW + j5,157.19 kvar + charging j−7,513.52 kvar
2-4: S2→ = −131.5352 − j74.1137 MVA, S4→ = 133.2507 + j74.9195 MVA; sum = series loss |I|²(R + jX) 1,715.48 kW + j8,577.39 kvar + charging j−7,771.52 kvar
3-4: S3→ = −102.9139 − j60.3713 MVA, S4→ = 104.7493 + j56.9301 MVA; sum = series loss |I|²(R + jX) 1,835.45 kW + j9,177.27 kvar + charging j−12,618.50 kvar
Losses and balanceTotal series losses Σ|I|²(R + jX) = 4,809.08 kW + j24,045.39 kvar; shunt Q (SHUNT elements, line charging) −37,974.94 kvar, reported separately; slack supplies P = 186.8091 MW, Q = 114.5008 Mvar. P balance: Pslack + ΣPgen = 186.8091 + 318.0000 = 504.8091 MW = ΣPload + Ploss = 500.0000 + 4.8091 = 504.8091 MW. Q balance: ΣQinj = −13,929.55 kvar = Qloss + Qshunt = 24,045.39 + (−37,974.94) = −13,929.56 kvar
Convergenceconverged after 4 iterations; largest power mismatch 1.07e-09 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus 3 at 0.96900 pu → 0.96900 vs limit 0.95000 pu PASS
Maximum voltagehighest bus 4 at 1.02000 pu → 1.02000 vs limit 1.05000 pu PASS
Result3/3 checks pass → PASS; V 0.9690–1.0200 pu, losses 4,809.1 kW; governing: minimum voltage. No rating_mva on 1-2, 1-3, 2-4, 3-4: loading not checked.
ReferenceGrainger & Stevenson, Power System Analysis (McGraw-Hill 1994), Ch. 9 four-bus example (Tables 9.2/9.3: 230 kV, 100 MVA base, line charging Y/2 = 0.05125/0.03875/0.03875/0.06375 pu): published solution V2 = 0.982∠−0.976°, V3 = 0.969∠−1.872°, V4 = 1.02∠1.523°, slack generation 186.81 MW + j114.50 Mvar. Independent Newton: V2 = 0.98242∠−0.9761°, V3 = 0.96900∠−1.8722°, δ4 = 1.5231°, slack 186.809 MW + j114.501 Mvar. (Textbook edition and example/figure numbers pending verification.) (validation case psas-stevenson-4bus-nr)

Example 26 — Glover, Sarma & Overbye five-bus system with transformers

A published 15/345 kV system with two generator transformers and charged lines: bus 2 falls to 0.834 pu, so the under-voltage check fails exactly as the textbook's heavily loaded bus does.

Given: Sbase = 100 MVA, 50 Hz. Buses: 1 (15 kV, SLACK at 15 kV (1 pu) ∠0°); 2 (345 kV, PQ, load 800 MW + j280 Mvar); 3 (15 kV, PV holding 15.75 kV (1.05 pu), Pgen 520 MW, load 80 MW + j40 Mvar); 4 (345 kV, PQ); 5 (345 kV, PQ). Branches: L24 LINE 2–4: 10.7122 + j119.025 Ω; Btotal 0.00144507 S; rated 1,200 MVA; L25 LINE 2–5: 5.35612 + j59.5125 Ω; Btotal 0.00073934 S; rated 1,200 MVA; L45 LINE 4–5: 2.67806 + j29.7563 Ω; Btotal 0.00036967 S; rated 1,200 MVA; T1 XFMR 5–1: 1.78537 + j23.805 Ω; rated 600 MVA; T2 XFMR 4–3: 0.892687 + j11.9025 Ω; rated 1,000 MVA. Solver Newton-Raphson, tolerance 1e-06 pu, ≤ 50 iterations; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases345 kV: Zbase = 345² / 100 = 1190.25 Ω; 15 kV: Zbase = 15² / 100 = 2.25 Ω; powers ÷ 100 MVA
Branch impedancesL24: z = (10.7122 + j119.0250) / 1190.25 = 0.009 + j0.1 pu; y = 1/z = 0.8928 − j9.9197 pu; Btotal = 0.00144507 × 1190.25 = 1.72 pu (B/2 = 0.86 at each end)
L25: z = (5.3561 + j59.5125) / 1190.25 = 0.0045 + j0.05 pu; y = 1/z = 1.7855 − j19.8393 pu; Btotal = 0.00073934 × 1190.25 = 0.88 pu (B/2 = 0.44 at each end)
L45: z = (2.6781 + j29.7563) / 1190.25 = 0.00225 + j0.025 pu; y = 1/z = 3.5711 − j39.6786 pu; Btotal = 0.00036967 × 1190.25 = 0.44 pu (B/2 = 0.22 at each end)
T1: z = (1.7854 + j23.8050) / 1190.25 = 0.0015 + j0.02 pu; y = 1/z = 3.7290 − j49.7203 pu
T2: z = (0.8927 + j11.9025) / 1190.25 = 0.00075 + j0.01 pu; y = 1/z = 7.4580 − j99.4406 pu
Scheduled injectionsNet injection = generation − load (machines included): 2: S = (−800.000 − j280.000)/100 = −8.00000 − j2.80000 pu; 3: P = 440.000/100 = 4.4 pu at |V| = 1.05 pu; 4: S = (0.000 + j0.000)/100 = 0.00000 + j0.00000 pu; 5: S = (0.000 + j0.000)/100 = 0.00000 + j0.00000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y1,1 = 3.7290 − j49.7203; Y2,2 = 2.6783 − j28.4590; Y3,3 = 7.4580 − j99.4406; Y4,4 = 11.9219 − j147.9589; Y5,5 = 9.0856 − j108.5782; Y1,5 = −3.7290 + j49.7203; Y2,4 = −0.8928 + j9.9197; Y2,5 = −1.7855 + j19.8393; Y3,4 = −7.4580 + j99.4406; Y4,5 = −3.5711 + j39.6786
Mismatch checkSolved voltages 1 1.00000∠0.0000°, 2 0.83377∠−22.4064°, 3 1.05000∠−0.5973°, 4 1.01930∠−2.8340°, 5 0.97429∠−4.5479° pu; Si = Vi(ΣYikVk)* from them: 1 (slack): S = 394.840 + j114.275 MVA → generation 394.839 MW + j114.283 Mvar; 2: S = −8.0000 − j2.8000 vs −8.0000 − j2.8000 pu scheduled; 3: P = 4.4001 vs 4.4000 pu scheduled, Q = 2.9750 pu (297.503 Mvar); 4: S = −0.0002 − j0.0004 vs 0.0000 + j0.0000 pu scheduled; 5: S = 0.0000 + j0.0002 vs 0.0000 + j0.0000 pu scheduled (differences in the 4th decimal are the rounding of the printed voltages)
Branch flowsSij = ViI*ij at each end: L24: S2→ = −291.8411 − j139.1054 MVA, S4→ = 303.6824 + j121.5384 MVA; sum = series loss |I|²(R + jX) 11,841.26 kW + j131,569.56 kvar + charging j−149,136.55 kvar; loading |Sfrom|/rating = 323.2979/1,200 = 26.94 %
L25: S2→ = −508.1589 − j140.8946 MVA, S5→ = 525.6621 + j263.0209 MVA; sum = series loss |I|²(R + jX) 17,503.22 kW + j194,480.19 kvar + charging j−72,353.90 kvar; loading |Sfrom|/rating = 527.3298/1,200 = 43.94 %
L45: S4→ = 134.3986 + j150.3545 MVA, S5→ = −133.3577 − j182.5297 MVA; sum = series loss |I|²(R + jX) 1,040.90 kW + j11,565.55 kvar + charging j−43,740.73 kvar; loading |Sfrom|/rating = 201.6667/1,200 = 16.81 %
T1: S5→ = −392.3044 − j80.4913 MVA, S1→ = 394.8388 + j114.2829 MVA; loss = sum = |I|²(R + jX) = 2,534.37 kW + j33,791.65 kvar; loading |Sfrom|/rating = 400.4767/600 = 66.75 %
T2: S4→ = −438.0810 − j271.8929 MVA, S3→ = 440.0000 + j297.4796 MVA; loss = sum = |I|²(R + jX) = 1,919.01 kW + j25,586.77 kvar; loading |Sfrom|/rating = 515.5974/1,000 = 51.56 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 34,838.76 kW + j396,993.71 kvar; shunt Q (SHUNT elements, line charging) −265,231.18 kvar, reported separately; slack supplies P = 394.8388 MW, Q = 114.2829 Mvar. P balance: Pslack + ΣPgen = 394.8388 + 520.0000 = 914.8388 MW = ΣPload + Ploss = 880.0000 + 34.8388 = 914.8388 MW. Q balance: ΣQinj = 131,762.52 kvar = Qloss + Qshunt = 396,993.71 + (−265,231.18) = 131,762.53 kvar
Convergenceconverged after 6 iterations; largest power mismatch 1.47e-10 vs tolerance 1e-06 pu PASS
Minimum voltagelowest bus 2 at 0.83377 pu → 0.83377 vs limit 0.95000 pu FAIL
Maximum voltagehighest bus 3 at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch T1 → 66.75 vs limit 100.00 % PASS
Result3/4 checks pass → FAIL; V 0.8338–1.0500 pu, losses 34,838.8 kW; governing: minimum voltage
ReferenceGlover, Sarma & Overbye, Power System Analysis and Design, Ch. 6 five-bus example (Fig. 6.2, Tables 6.1–6.3; 100 MVA base, 15/345 kV): published V2 = 0.834∠−22.407°, V3 = 1.050∠−0.597°, V4 = 1.019∠−2.834°, V5 = 0.974∠−4.548°. Independent Newton: V2 = 0.83377∠−22.4064°, V3 = 1.05000∠−0.5973°, V4 = 1.01930∠−2.8340°, V5 = 0.97429∠−4.5479°; Q_G3 = 337.48 Mvar; total loss 34.839 MW. Branch ratings (1200 MVA lines, 600/1000 MVA transformers) are this case's own. (Textbook edition and example/figure numbers pending verification.) (validation case psas-glover-5bus-nr)

Example 27 — Five-bus system on the pandapower solver

The same transformer-coupled system through pandapower: identical voltages, flows and transformer loadings to the native Newton-Raphson.

Given: Sbase = 100 MVA, 50 Hz. Buses: 1 (15 kV, SLACK at 15 kV (1 pu) ∠0°); 2 (345 kV, PQ, load 800 MW + j280 Mvar); 3 (15 kV, PV holding 15.75 kV (1.05 pu), Pgen 520 MW, load 80 MW + j40 Mvar); 4 (345 kV, PQ); 5 (345 kV, PQ). Branches: L24 LINE 2–4: 10.7122 + j119.025 Ω; Btotal 0.00144507 S; rated 1,200 MVA; L25 LINE 2–5: 5.35612 + j59.5125 Ω; Btotal 0.00073934 S; rated 1,200 MVA; L45 LINE 4–5: 2.67806 + j29.7563 Ω; Btotal 0.00036967 S; rated 1,200 MVA; T1 XFMR 5–1: 1.78537 + j23.805 Ω; rated 600 MVA; T2 XFMR 4–3: 0.892687 + j11.9025 Ω; rated 1,000 MVA. Solver pandapower (NR); limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases345 kV: Zbase = 345² / 100 = 1190.25 Ω; 15 kV: Zbase = 15² / 100 = 2.25 Ω; powers ÷ 100 MVA
Branch impedancesL24: z = (10.7122 + j119.0250) / 1190.25 = 0.009 + j0.1 pu; y = 1/z = 0.8928 − j9.9197 pu; Btotal = 0.00144507 × 1190.25 = 1.72 pu (B/2 = 0.86 at each end)
L25: z = (5.3561 + j59.5125) / 1190.25 = 0.0045 + j0.05 pu; y = 1/z = 1.7855 − j19.8393 pu; Btotal = 0.00073934 × 1190.25 = 0.88 pu (B/2 = 0.44 at each end)
L45: z = (2.6781 + j29.7563) / 1190.25 = 0.00225 + j0.025 pu; y = 1/z = 3.5711 − j39.6786 pu; Btotal = 0.00036967 × 1190.25 = 0.44 pu (B/2 = 0.22 at each end)
T1: z = (1.7854 + j23.8050) / 1190.25 = 0.0015 + j0.02 pu; y = 1/z = 3.7290 − j49.7203 pu
T2: z = (0.8927 + j11.9025) / 1190.25 = 0.00075 + j0.01 pu; y = 1/z = 7.4580 − j99.4406 pu
Scheduled injectionsNet injection = generation − load (machines included): 2: S = (−800.000 − j280.000)/100 = −8.00000 − j2.80000 pu; 3: P = 440.000/100 = 4.4 pu at |V| = 1.05 pu; 4: S = (0.000 + j0.000)/100 = 0.00000 + j0.00000 pu; 5: S = (0.000 + j0.000)/100 = 0.00000 + j0.00000 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y1,1 = 3.7290 − j49.7203; Y2,2 = 2.6783 − j28.4590; Y3,3 = 7.4580 − j99.4406; Y4,4 = 11.9219 − j147.9589; Y5,5 = 9.0856 − j108.5782; Y1,5 = −3.7290 + j49.7203; Y2,4 = −0.8928 + j9.9197; Y2,5 = −1.7855 + j19.8393; Y3,4 = −7.4580 + j99.4406; Y4,5 = −3.5711 + j39.6786
Mismatch checkSolved voltages 1 1.00000∠0.0000°, 2 0.83377∠−22.4064°, 3 1.05000∠−0.5973°, 4 1.01930∠−2.8340°, 5 0.97429∠−4.5479° pu; Si = Vi(ΣYikVk)* from them: 1 (slack): S = 394.840 + j114.275 MVA → generation 394.839 MW + j114.283 Mvar; 2: S = −8.0000 − j2.8000 vs −8.0000 − j2.8000 pu scheduled; 3: P = 4.4001 vs 4.4000 pu scheduled, Q = 2.9750 pu (297.503 Mvar); 4: S = −0.0002 − j0.0004 vs 0.0000 + j0.0000 pu scheduled; 5: S = 0.0000 + j0.0002 vs 0.0000 + j0.0000 pu scheduled (differences in the 4th decimal are the rounding of the printed voltages)
Branch flowsSij = ViI*ij at each end: L24: S2→ = −291.8411 − j139.1054 MVA, S4→ = 303.6824 + j121.5384 MVA; sum = series loss |I|²(R + jX) 11,841.26 kW + j131,569.56 kvar + charging j−149,136.55 kvar; loading |Sfrom|/rating = 323.2979/1,200 = 26.94 %
L25: S2→ = −508.1589 − j140.8946 MVA, S5→ = 525.6621 + j263.0209 MVA; sum = series loss |I|²(R + jX) 17,503.22 kW + j194,480.19 kvar + charging j−72,353.90 kvar; loading |Sfrom|/rating = 527.3298/1,200 = 43.94 %
L45: S4→ = 134.3986 + j150.3545 MVA, S5→ = −133.3577 − j182.5297 MVA; sum = series loss |I|²(R + jX) 1,040.90 kW + j11,565.55 kvar + charging j−43,740.73 kvar; loading |Sfrom|/rating = 201.6667/1,200 = 16.81 %
T1: S5→ = −392.3044 − j80.4913 MVA, S1→ = 394.8388 + j114.2829 MVA; loss = sum = |I|²(R + jX) = 2,534.37 kW + j33,791.65 kvar; loading |Sfrom|/rating = 400.4767/600 = 66.75 %
T2: S4→ = −438.0810 − j271.8929 MVA, S3→ = 440.0000 + j297.4796 MVA; loss = sum = |I|²(R + jX) = 1,919.01 kW + j25,586.77 kvar; loading |Sfrom|/rating = 515.5974/1,000 = 51.56 %
Losses and balanceTotal series losses Σ|I|²(R + jX) = 34,838.76 kW + j396,993.71 kvar; shunt Q (SHUNT elements, line charging) −265,231.18 kvar, reported separately; slack supplies P = 394.8388 MW, Q = 114.2829 Mvar. P balance: Pslack + ΣPgen = 394.8388 + 520.0000 = 914.8388 MW = ΣPload + Ploss = 880.0000 + 34.8388 = 914.8388 MW. Q balance: ΣQinj = 131,762.52 kvar = Qloss + Qshunt = 396,993.71 + (−265,231.18) = 131,762.53 kvar
Convergencepandapower Newton-Raphson converged in 5 iterations on its own mismatch tolerance PASS
Minimum voltagelowest bus 2 at 0.83377 pu → 0.83377 vs limit 0.95000 pu FAIL
Maximum voltagehighest bus 3 at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Branch loadingmost loaded branch T1 → 66.75 vs limit 100.00 % PASS
Result3/4 checks pass → FAIL; V 0.8338–1.0500 pu, losses 34,838.8 kW; governing: minimum voltage
ReferenceGlover, Sarma & Overbye, Power System Analysis and Design, Ch. 6 five-bus example (Fig. 6.2, Tables 6.1–6.3; 100 MVA base, 15/345 kV): published V2 = 0.834∠−22.407°, V3 = 1.050∠−0.597°, V4 = 1.019∠−2.834°, V5 = 0.974∠−4.548°. Independent Newton: V2 = 0.83377∠−22.4064°, V3 = 1.05000∠−0.5973°, V4 = 1.01930∠−2.8340°, V5 = 0.97429∠−4.5479°; Q_G3 = 337.48 Mvar; total loss 34.839 MW. Branch ratings (1200 MVA lines, 600/1000 MVA transformers) are this case's own. (Textbook edition and example/figure numbers pending verification.) (validation case psas-glover-5bus-pandapower)

Example 28 — Gauss-Seidel stopped by a 5-iteration cap

Gauss-Seidel on the Saadat system cannot settle in 5 sweeps: the tool reports non-convergence, fails the convergence check and warns that the voltages are not an operating point.

Given: Sbase = 100 MVA, 50 Hz. Buses: 1 (100 kV, SLACK at 105 kV (1.05 pu) ∠0°); 2 (100 kV, PQ, load 256.6 MW + j110.2 Mvar); 3 (100 kV, PQ, load 138.6 MW + j45.2 Mvar). Branches: L12 LINE 1–2: 2 + j4 Ω; L13 LINE 1–3: 1 + j3 Ω; L23 LINE 2–3: 1.25 + j2.5 Ω. Solver Gauss-Seidel, tolerance 1e-06 pu, ≤ 5 iterations, acceleration α = 1.6; limits 0.95–1.05 pu, loading ≤ 100 %.

Per-unit bases100 kV: Zbase = 100² / 100 = 100 Ω; powers ÷ 100 MVA
Branch impedancesL12: z = (2.0000 + j4.0000) / 100 = 0.02 + j0.04 pu; y = 1/z = 10.0000 − j20.0000 pu
L13: z = (1.0000 + j3.0000) / 100 = 0.01 + j0.03 pu; y = 1/z = 10.0000 − j30.0000 pu
L23: z = (1.2500 + j2.5000) / 100 = 0.0125 + j0.025 pu; y = 1/z = 16.0000 − j32.0000 pu
Scheduled injectionsNet injection = generation − load (machines included): 2: S = (−256.600 − j110.200)/100 = −2.56600 − j1.10200 pu; 3: S = (−138.600 − j45.200)/100 = −1.38600 − j0.45200 pu
Y-busYii = Σ yik + shunts, Yik = −yik (pu): Y1,1 = 20.0000 − j50.0000; Y2,2 = 26.0000 − j52.0000; Y3,3 = 26.0000 − j62.0000; Y1,2 = −10.0000 + j20.0000; Y1,3 = −10.0000 + j30.0000; Y2,3 = −16.0000 + j32.0000
Gauss-Seidel sweep 1V2(1) = [S*/V*(0) − ΣYikVk] / Yii = [(−2.5660 + j1.1020)/1 − [(−10.0000 + j20.0000)(1.0500 + j0.0000) + (−16.0000 + j32.0000)(1.0000 + j0.0000)]] / (26.0000 − j52.0000) = 0.98254 − j0.03100 pu; accelerated V ← 1 + 1.6 × (−0.01746 − j0.03100) = 0.97206 − j0.04960 pu; sweeps repeat until the largest |ΔV| < 1e-06 pu
Iterationsstopped at the 5-iteration cap with voltages 1 1.05000∠0.0000°, 2 0.98231∠−3.9529°, 3 1.00261∠−3.1699° pu — not an operating point, so flows and losses are not reported here
ConvergenceNOT converged after 5 iterations; largest |ΔV| in the last sweep 1.66e-02 vs tolerance 1e-06 pu; power mismatch of the returned voltages 2.45e-01 pu FAIL
Minimum voltagelowest bus 2 at 0.98231 pu → 0.98231 vs limit 0.95000 pu PASS
Maximum voltagehighest bus 1 at 1.05000 pu → 1.05000 vs limit 1.05000 pu PASS
Result2/3 checks pass → FAIL; not converged in 5 iterations; governing: convergence. Not converged after 5 iterations — results are not a valid operating point. No rating_mva on L12, L13, L23: loading not checked.
ReferenceHand calculation: accelerated Gauss-Seidel (α = 1.6) from a flat start on the Saadat three-bus system; the largest voltage change per sweep is 7.31e-02, 4.07e-02, 3.88e-02, 1.66e-02, 1.66e-02 pu — still far above 1e-6 pu after 5 sweeps, so the run cannot converge. (Textbook edition and example/figure numbers pending verification.) (validation case psas-gs-iteration-cap)

Standards & References

  • IEEE Std 399 (Brown Book) — IEEE Recommended Practice for Industrial and Commercial Power Systems Analysis. Provides guidance on load flow study methods and assumptions.
  • IEC 60909 — Short-circuit currents in three-phase AC systems. Y-bus construction and per-unit conventions are consistent with this standard.
  • AS/NZS 3000:2018 — Electrical installations (Wiring Rules). General voltage regulation requirements for electrical networks.
  • Glover, Sarma & Overbye — Power Systems Analysis and Design, 6th Edition. Gauss-Seidel and SOR methods for load flow.
  • Stevenson & Grainger — Power Systems Analysis. Foundational reference for bus admittance matrix construction and iterative methods.
  • Saadat — Power System Analysis, 2nd Edition. Three-bus Gauss-Seidel and Newton-Raphson examples used in the worked examples.
Provisional citations: the expected values of the textbook-system worked examples (Saadat; Glover, Sarma & Overbye; Grainger & Stevenson) come from an independent hand solution. The edition and example/figure numbers cited for them are pending verification against the books.

Tips & Limitations

Tips
  • Start with a flat-start initial guess (1.0 pu at all PQ buses). The calculator does this automatically.
  • For systems that converge slowly, enable SOR with \(\omega = 1.2\) – \(1.6\). Values above 1.6 may cause oscillation.
  • Use the default tolerance of \(10^{-6}\) for engineering accuracy. Looser tolerances (e.g. \(10^{-4}\)) converge faster but sacrifice precision.
  • For PV buses, set realistic \(Q_{\min}\) and \(Q_{\max}\) limits based on generator capability curves. The defaults of ±999 MVAr are effectively unconstrained.
  • Line impedances must be entered in per-unit on the system base. Convert from Ω using: \(Z_{\text{pu}} = Z_{\Omega} / Z_{\text{base}}\) where \(Z_{\text{base}} = V_{\text{base}}^2 / S_{\text{base}}\).
  • The Slack bus absorbs all system losses and any power imbalance. Place it at the strongest source in the network (e.g. utility interconnection point).
  • Bus voltage magnitudes between 0.95 and 1.05 pu are typical. Warnings are generated for voltages outside 0.90 – 1.10 pu.
Limitations
  • Gauss-Seidel only — this calculator does not implement Newton-Raphson or Fast Decoupled methods. Gauss-Seidel converges more slowly and may fail on ill-conditioned systems (high R/X ratios, large networks).
  • Balanced three-phase — only positive-sequence balanced loads are modelled. Unbalanced or single-phase loads are not supported.
  • No transformer tap modelling — all lines are modelled as simple pi-sections. Off-nominal transformer taps, phase-shifting transformers, and FACTS devices are not included.
  • Maximum 50 buses — for larger systems, Newton-Raphson methods with sparse matrix techniques are recommended.
  • Steady-state only — transient stability, motor starting, and dynamic phenomena are not considered.
  • No automatic base conversion — all impedances must be entered in per-unit on the specified system base. The calculator does not convert between different voltage bases or equipment ratings.

Developer Guide

Architecture

File layout:

  • components/c0025_load_flow/component.py — Component registration, parameter schema (LOAD_FLOW_SCHEMA), SVG diagram generator
  • components/c0025_load_flow/calculations.py — LoadFlowCalculator class with all numerical logic (no Django dependencies)
  • components/c0025_load_flow/equations.py — build_load_flow_equations() — generates formatted HTML with LaTeX equations from results
  • components/c0025_load_flow/excel_generator.py — create_c0025_excel_report() — Excel export
  • components/c0025_load_flow/templates/calcs/components/c0025_load_flow/sidebar_form.html — sidebar input form template

Calculator class: LoadFlowCalculator

Key data structures:

  • Y_bus — NumPy complex matrix (np.ndarray, shape n×n)
  • voltages — NumPy complex array of bus voltages (np.ndarray, shape n)
  • bus_types — list of strings ("Slack", "PV", "PQ")
  • p_specified, q_specified — NumPy arrays of scheduled power injections in per-unit

Code Paths

Key methods in LoadFlowCalculator (calculations.py):

Function Purpose
calculate() Main entry point — orchestrates the full load flow solution
_parse_bus_data() Parse bus array, identify Slack/PV/PQ types, convert MW/MVAr to per-unit
_build_ybus() Assemble Y-bus admittance matrix from line impedances
_initialize_voltages() Set initial voltage guesses (flat start for PQ, specified for Slack/PV)
_gauss_seidel_iterations() Iterative solver with PV enforcement, SOR, and Q-limit checking
_calculate_power_injections() Compute actual \(P\) and \(Q\) at each bus from converged voltages
_calculate_line_flows() Compute power flow through each line using pi-model currents
_calculate_losses(line_flows) Sum line losses to get total system losses
_format_bus_voltages() Convert complex voltages to magnitude/angle/real/imag dict format
_generate_warnings() Check for non-convergence, voltage violations (< 0.90 or > 1.10 pu)
_generate_recommendations() Suggest SOR, higher iteration counts, or capacitor banks

Key functions in component.py:

Function Purpose
generate_load_flow_diagram_svg(parameters, results) Generate SVG network topology diagram with bus positions, line impedances, and voltage results
register_component(registry) Register calc type, schema, calculator class, and SVG generators with the component registry

Key function in equations.py:

Function Purpose
build_load_flow_equations(results) Generate HTML with LaTeX equations and result tables for the calculation report

Testing

Running tests:

pytest calcs/test_c0025_load_flow.py -v

Test coverage:

  • Component registration verification
  • 3-bus load flow (Slack + PV + PQ) — convergence, voltage magnitudes, power mismatches, losses
  • 4-bus load flow (Slack + PV + 2×PQ) — larger network validation
  • SVG network diagram generation and structure validation
  • LaTeX equation builder content validation

How to extend:

  1. Add new bus types (e.g. PV with droop) by extending the _gauss_seidel_iterations() sweep logic and adding the type to the bus_type enum in the schema.
  2. Add transformer modelling by extending _build_ybus() to include tap-ratio modified admittances.
  3. Add shunt compensation elements (capacitor banks, reactors) by extending the Y-bus diagonal elements with fixed shunt admittances at specific buses.
  4. For Newton-Raphson support, implement a separate solver method alongside the existing Gauss-Seidel and expose it via a solver_method schema parameter.
  5. Write tests covering edge cases: isolated buses, zero-impedance lines, all PQ buses (no PV), and systems that fail to converge.