The Load-Flow Problem: Bus Types and the Y-Bus
Before a new wind farm is connected, a line taken out for maintenance or tomorrow's peak load is accepted, a control-room engineer asks: with these generators and these loads, what will every bus voltage and every line flow be? Are any voltages outside to , any lines overloaded? That calculation is the load flow (or power flow), the most-run calculation in power engineering. It looks like circuit analysis, but with a twist: the loads and generators are specified as powers, not impedances or currents, so the equations are nonlinear. This lesson sets the problem up; the next three solve it.
Safety. The network in this lesson is a transmission system: calculation and simulation only. The bench analogue at the end is a resistor network on a current-limited supply.
The course network N4
Network N4 is used for the rest of the load-flow and dispatch lessons: four buses on a , base, five lines with series impedance and total charging susceptance (pu): 1–2 , 1–3 , 2–3 , 2–4 , 3–4 .
Bus types
Each bus has four quantities: , , and the angle . Two are specified, two are unknown:
| Bus type | Specified | Unknown | Typical bus |
|---|---|---|---|
| slack (swing, reference) | , | , | one large generator; it supplies whatever the losses turn out to be |
| PV (generator) | , | , | generators with voltage control (AVR); must stay within the generator's limits |
| PQ (load) | , | , | loads, and buses with nothing connected () |
Why a slack bus? The total losses are unknown until the voltages are known, so one generator's output must be left free to balance the books. It also provides the angle reference: only angle differences matter physically.
In N4, bus 1 is the slack, bus 2 a PV bus (, ), buses 3 and 4 are PQ loads. Unknowns: : five unknowns, five equations ( at buses 2, 3, 4 and at 3, 4).
The bus admittance matrix
Nodal analysis (Nodal Analysis) writes the injected currents as . Each line is a model (Short and Medium Lines): a series admittance and half the charging at each end. The rules:
The diagonal is the sum of everything connected to bus , the off-diagonal minus the series admittance between and , and zero when no line connects them. Real grids have thousands of buses but each bus connects to only two to four others, so is more than zeros for large systems: sparse-matrix techniques make load flow fast (Sparse Matrices). A transformer with an off-nominal tap ratio enters as an asymmetric ; phase-shifting transformers even make non-symmetric.
The power-flow equations
Complex power injected at bus is , and with :
In polar form, with and :
These are linear in currents but quadratic in voltages: a load of fixed power draws more current when the voltage sags. There is no closed-form solution, so we iterate: Gauss–Seidel or Newton–Raphson. The injections use the generator convention, : a load bus has negative .
Worked example: two entries of the Y-bus
Given: N4's line data above.
Find: and .
Solve:
Check: the row sum of is just the shunt (charging) admittance at that bus: . With no shunts, rows would sum to zero, as for any network of series branches. The diagonal susceptance is negative (inductive network) and is the largest entry of its row, close in size to the sum of the off-diagonal magnitudes (the line charging makes it slightly smaller here: against ). This near diagonal dominance is what helps the iterative methods converge.
In Python: build the Y-bus and check a solution
import numpy as np
np.set_printoptions(precision=3, suppress=True, linewidth=110)
# N4: (from, to, r, x, total charging b), pu on 100 MVA
lines = [(1, 2, 0.01, 0.05, 0.04), (1, 3, 0.02, 0.08, 0.05), (2, 3, 0.015, 0.06, 0.04),
(2, 4, 0.02, 0.08, 0.05), (3, 4, 0.025, 0.10, 0.06)]
def ybus(lines, n):
Y = np.zeros((n, n), dtype=complex)
for i, k, r, x, b in lines:
i, k = i - 1, k - 1
y = 1 / complex(r, x)
Y[i, i] += y + 0.5j * b
Y[k, k] += y + 0.5j * b
Y[i, k] -= y
Y[k, i] -= y
return Y
Y = ybus(lines, 4)
print("Ybus (pu):")
print(Y)
print("row sums (shunts):", np.round(Y.sum(axis=1), 4))
# A candidate solution (from Newton-Raphson, next lessons): |V| and angle in degrees
Vm = np.array([1.04, 1.02, 0.99163, 0.97922])
th = np.radians([0.0, -1.43918, -3.79072, -4.82641])
V = Vm * np.exp(1j * th)
S = V * np.conj(Y @ V) # injected complex power at every bus
for i, s in enumerate(S, 1):
print(f"bus {i}: P = {s.real:+.4f} pu, Q = {s.imag:+.4f} pu")
print(f"losses = sum of P = {S.real.sum():.4f} pu = {100*S.real.sum():.2f} MW")Ybus (pu):
[[ 6.787-30.95j -3.846+19.231j -2.941+11.765j 0. +0.j ]
[-3.846+19.231j 10.709-46.617j -3.922+15.686j -2.941+11.765j]
[-2.941+11.765j -3.922+15.686j 9.216-36.788j -2.353 +9.412j]
[ 0. +0.j -2.941+11.765j -2.353 +9.412j 5.294-21.121j]]
row sums (shunts): [ 0.+0.045j 0.+0.065j 0.+0.075j -0.+0.055j]
bus 1: P = +1.5504 pu, Q = +0.6731 pu
bus 2: P = +1.0000 pu, Q = +0.2898 pu
bus 3: P = -1.5000 pu, Q = -0.6001 pu
bus 4: P = -1.0000 pu, Q = -0.4000 pu
losses = sum of P = 0.0504 pu = 5.04 MW
Interactive: a DC grid is a conductance matrix
A resistor network with a DC source is the same nodal problem with real numbers: . The lab is N4's topology with resistors proportional to the line reactances (, , , and for lines 1–2, 1–3, 2–3, 2–4, 3–4), a source as the "slack" at node n1, and load resistors of at n3 and at n4. It shows , and at n2, n3, n4, and the source delivers . Lower RL3 (more load at node 3) and watch every voltage sag, most at node 3: the same pattern a load increase gives in the AC load flow, except that here the "load" is an impedance, so the problem stays linear.
Guided lab: measure a conductance matrix
Hand calculation. For the DC grid above, write (a matrix in siemens, with the load conductances on the diagonal), delete the source row and column, and solve for the three node voltages. You should get the numbers the lab shows.
Simulation. Run the ybus function with r set to the resistances and x = 0 (or write a real-valued version) and compare.
What you would measure. Build the network on a breadboard with resistors rated at least , supplied at from a bench supply with its current limit set to . A DMM should read the node voltages within about of the prediction (resistor tolerance plus meter accuracy), and the supply about . The largest dissipation is in the load at node 3, then in the load; among the lines the most is in the resistor of line 1–3. Lowering the node-3 load on the bench raises these quickly (at the supply would need , above its limit, and line 1–3 would dissipate ), so explore that in the lab rather than on the breadboard. Then measure one column of directly: drive only node 2 with , short the other nodes to ground through an ammeter each, and read the currents ( for each neighbour).
Hazards and safe setup. DC, current-limited: no shock hazard. Resistors can still get hot if a wrong value (e.g. instead of ) ends up across the supply, which is what the current limit is for.
Pitfalls
- Forgetting half the charging at each end. Each line's total is split, to each bus.
- Using impedances instead of admittances. Off-diagonals are , not .
- Load sign. In the generator convention a load bus has negative and injection.
- Two slack buses. Exactly one bus per connected network is the slack; an islanded part needs its own.
- Mixing bases. All impedances must be on the same base and the voltage base of their zone (Per Unit for Multi-Voltage Networks).
Practice
- Find of N4 by hand.
- Line 2–3 is switched out. Which entries of change, and how?
- A capacitor bank is connected at bus 4. How does change?
Answer
- , ; .
- and each lose ; become . Nothing else changes, which is why outages are cheap to model.
- A capacitor rated at voltage is a susceptance added to .
Test yourself
At a PV bus, which two quantities are unknown in the load flow?
- and
- and the voltage angle
- and the angle
- and
Why does a load flow need a slack bus?
- to model the largest load
- the losses are unknown beforehand, and one bus also fixes the angle reference
- to make the Y-bus invertible by adding a shunt
- because generators cannot control voltage
Two buses are connected by a line of series admittance . The off-diagonal Y-bus entry is…
Why are the load-flow equations nonlinear?
- lines are nonlinear
- loads and generators are given as powers, so currents depend on the unknown voltages
- the Y-bus changes every iteration
- because of the slack bus