TExcelTAD
Home › Power Systems: Three-Phase, Generation, Grids & Protection › The Load-Flow Problem: Bus Types and the Y-Bus

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 0.950.95 to 1.05 pu1.05\ \text{pu}, 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 132 kV132\ \text{kV} transmission system: calculation and simulation only. The bench analogue at the end is a resistor network on a current-limited 12 V12\ \text{V} supply.

The course network N4

1234 ~slack, 1.04 pu, angle 0 ~PV: 100 MW, 1.02 pu PQ: 150 MW + 60 MvarPQ: 100 MW + 40 Mvar 0.01 + j0.050.02 + j0.08 0.02 + j0.080.025 + j0.100.015 + j0.06

Network N4 is used for the rest of the load-flow and dispatch lessons: four buses on a 132 kV132\ \text{kV}, 100 MVA100\ \text{MVA} base, five lines with series impedance r+jxr + jx and total charging susceptance bb (pu): 1–2 (0.01,0.05,0.04)(0.01, 0.05, 0.04), 1–3 (0.02,0.08,0.05)(0.02, 0.08, 0.05), 2–3 (0.015,0.06,0.04)(0.015, 0.06, 0.04), 2–4 (0.02,0.08,0.05)(0.02, 0.08, 0.05), 3–4 (0.025,0.10,0.06)(0.025, 0.10, 0.06).

Bus types

Each bus has four quantities: PP, QQ, ∣V∣\lvert V \rvert and the angle θ\theta. Two are specified, two are unknown:

Bus type Specified Unknown Typical bus
slack (swing, reference) ∣V∣\lvert V \rvert, θ=0\theta = 0 PP, QQ one large generator; it supplies whatever the losses turn out to be
PV (generator) PP, ∣V∣\lvert V \rvert QQ, θ\theta generators with voltage control (AVR); QQ must stay within the generator's limits
PQ (load) PP, QQ ∣V∣\lvert V \rvert, θ\theta loads, and buses with nothing connected (P=Q=0P = Q = 0)

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 (PG=1.0 puP_G = 1.0\ \text{pu}, ∣V∣=1.02\lvert V \rvert = 1.02), buses 3 and 4 are PQ loads. Unknowns: θ2,θ3,θ4,∣V3∣,∣V4∣\theta_2, \theta_3, \theta_4, \lvert V_3 \rvert, \lvert V_4 \rvert: five unknowns, five equations (PP at buses 2, 3, 4 and QQ at 3, 4).

The bus admittance matrix

Nodal analysis (Nodal Analysis) writes the injected currents as I=YbusV\mathbf{I} = \mathbf{Y}_\text{bus}\mathbf{V}. Each line is a π\pi model (Short and Medium Lines): a series admittance y=1/(r+jx)y = 1/(r + jx) and half the charging jb/2jb/2 at each end. The rules:

Yii=∑k(yik+jbik2),Yik=−yik (i≠k)Y_{ii} = \sum_{k} \left( y_{ik} + j\frac{b_{ik}}{2} \right), \qquad Y_{ik} = -y_{ik} \ (i \ne k)

The diagonal is the sum of everything connected to bus ii, the off-diagonal minus the series admittance between ii and kk, and zero when no line connects them. Real grids have thousands of buses but each bus connects to only two to four others, so Ybus\mathbf{Y}_\text{bus} is more than 99 %99\ \% zeros for large systems: sparse-matrix techniques make load flow fast (Sparse Matrices). A transformer with an off-nominal tap ratio tt enters as an asymmetric π\pi; phase-shifting transformers even make Ybus\mathbf{Y}_\text{bus} non-symmetric.

The power-flow equations

Complex power injected at bus ii is Si=ViIi∗S_i = \mathbf{V}_i \mathbf{I}_i^*, and with I=YV\mathbf{I} = \mathbf{Y}\mathbf{V}:

Si=Pi+jQi=Vi∑k=1nYik∗Vk∗S_i = P_i + jQ_i = \mathbf{V}_i \sum_{k=1}^{n} Y_{ik}^* \mathbf{V}_k^*

In polar form, with Yik=Gik+jBikY_{ik} = G_{ik} + jB_{ik} and θik=θi−θk\theta_{ik} = \theta_i - \theta_k:

Pi=∣Vi∣∑k∣Vk∣(Gikcos⁡θik+Biksin⁡θik)Qi=∣Vi∣∑k∣Vk∣(Giksin⁡θik−Bikcos⁡θik)\begin{aligned} P_i &= \lvert V_i \rvert \sum_k \lvert V_k \rvert \left( G_{ik}\cos\theta_{ik} + B_{ik}\sin\theta_{ik} \right) \\ Q_i &= \lvert V_i \rvert \sum_k \lvert V_k \rvert \left( G_{ik}\sin\theta_{ik} - B_{ik}\cos\theta_{ik} \right) \end{aligned}

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, Si=(PGi−PDi)+j(QGi−QDi)S_i = (P_{Gi} - P_{Di}) + j(Q_{Gi} - Q_{Di}): a load bus has negative PiP_i.

Worked example: two entries of the Y-bus

Given: N4's line data above.

Find: Y11Y_{11} and Y12Y_{12}.

Solve:

y12=10.01+j0.05=0.01−j0.050.0026=3.846−j19.231 puy13=10.02+j0.08=0.02−j0.080.0068=2.941−j11.765 puY11=y12+y13+j0.04+0.052=6.787−j30.950 puY12=−y12=−3.846+j19.231 pu\begin{aligned} y_{12} &= \frac{1}{0.01 + j0.05} = \frac{0.01 - j0.05}{0.0026} = 3.846 - j19.231\ \text{pu} \\ y_{13} &= \frac{1}{0.02 + j0.08} = \frac{0.02 - j0.08}{0.0068} = 2.941 - j11.765\ \text{pu} \\ Y_{11} &= y_{12} + y_{13} + j\frac{0.04 + 0.05}{2} = 6.787 - j30.950\ \text{pu} \\ Y_{12} &= -y_{12} = -3.846 + j19.231\ \text{pu} \end{aligned}

Check: the row sum of Ybus\mathbf{Y}_\text{bus} is just the shunt (charging) admittance at that bus: Y11+Y12+Y13=j0.045Y_{11} + Y_{12} + Y_{13} = j0.045. 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: ∣Y11∣=31.69\lvert Y_{11} \rvert = 31.69 against ∣Y12∣+∣Y13∣=31.74\lvert Y_{12} \rvert + \lvert Y_{13} \rvert = 31.74). This near diagonal dominance is what helps the iterative methods converge.

In Python: build the Y-bus and check a solution

python · try it yourself
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: I=GV\mathbf{I} = \mathbf{G}\mathbf{V}. The lab is N4's topology with resistors proportional to the line reactances (5050, 8080, 6060, 8080 and 100 Ω100\ \Omega for lines 1–2, 1–3, 2–3, 2–4, 3–4), a 12 V12\ \text{V} source as the "slack" at node n1, and load resistors of 240 Ω240\ \Omega at n3 and 360 Ω360\ \Omega at n4. It shows 10.36 V10.36\ \text{V}, 9.49 V9.49\ \text{V} and 8.88 V8.88\ \text{V} at n2, n3, n4, and the source delivers 64.2 mA64.2\ \text{mA}. 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.

node voltages (to ground 0)n112.00 Vn210.36 Vn39.493 Vn48.877 VnetlistV1 n1 0 12R12 n1 n2 50R13 n1 n3 80R23 n2 n3 60R24 n2 n4 80R34 n3 n4 100RL3 n3 0 240RL4 n4 0 360element currents (node 1 to node 2 through it)V1n1>0-64.2 mAR12n1>n232.9 mAR13n1>n331.3 mAR23n2>n314.4 mAR24n2>n418.5 mAR34n3>n46.16 mARL3n3>039.6 mARL4n4>024.7 mA

Guided lab: measure a conductance matrix

Hand calculation. For the DC grid above, write G\mathbf{G} (a 4×44 \times 4 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 1 %1\ \% resistors rated at least 1 W1\ \text{W}, supplied at 12.0 V12.0\ \text{V} from a bench supply with its current limit set to 100 mA100\ \text{mA}. A DMM should read the node voltages within about ±1 %\pm 1\ \% of the prediction (resistor tolerance plus meter accuracy), and the supply about 64 mA64\ \text{mA}. The largest dissipation is 375 mW375\ \text{mW} in the 240 Ω240\ \Omega load at node 3, then 219 mW219\ \text{mW} in the 360 Ω360\ \Omega load; among the lines the most is 79 mW79\ \text{mW} in the 80 Ω80\ \Omega resistor of line 1–3. Lowering the node-3 load on the bench raises these quickly (at 60 Ω60\ \Omega the supply would need 129 mA129\ \text{mA}, above its limit, and line 1–3 would dissipate 0.37 W0.37\ \text{W}), so explore that in the lab rather than on the breadboard. Then measure one column of G\mathbf{G} directly: drive only node 2 with 1 V1\ \text{V}, short the other nodes to ground through an ammeter each, and read the currents (−1/R-1/R for each neighbour).

Hazards and safe setup. 12 V12\ \text{V} DC, current-limited: no shock hazard. Resistors can still get hot if a wrong value (e.g. 5 Ω5\ \Omega instead of 50 Ω50\ \Omega) 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 bb is split, b/2b/2 to each bus.
  • Using impedances instead of admittances. Off-diagonals are −1/z-1/z, not −z-z.
  • Load sign. In the generator convention a load bus has negative PP and QQ 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 100 MVA100\ \text{MVA} base and the voltage base of their zone (Per Unit for Multi-Voltage Networks).

Practice

  1. Find Y44Y_{44} of N4 by hand.
  2. Line 2–3 is switched out. Which entries of Ybus\mathbf{Y}_\text{bus} change, and how?
  3. A 20 Mvar20\ \text{Mvar} capacitor bank is connected at bus 4. How does Ybus\mathbf{Y}_\text{bus} change?
Answer
  1. y24=2.941−j11.765y_{24} = 2.941 - j11.765, y34=1/(0.025+j0.10)=2.353−j9.412y_{34} = 1/(0.025 + j0.10) = 2.353 - j9.412; Y44=5.294−j21.176+j(0.05+0.06)/2=5.294−j21.121 puY_{44} = 5.294 - j21.176 + j(0.05 + 0.06)/2 = 5.294 - j21.121\ \text{pu}.
  2. Y22Y_{22} and Y33Y_{33} each lose y23+j0.02y_{23} + j0.02; Y23=Y32Y_{23} = Y_{32} become 00. Nothing else changes, which is why outages are cheap to model.
  3. A capacitor rated 0.2 pu0.2\ \text{pu} at 1 pu1\ \text{pu} voltage is a susceptance +j0.2 pu+j0.2\ \text{pu} added to Y44Y_{44}.

Test yourself

At a PV bus, which two quantities are unknown in the load flow?

  1. PP and QQ
  2. QQ and the voltage angle
  3. ∣V∣\lvert V \rvert and the angle
  4. PP and ∣V∣\lvert V \rvert

Why does a load flow need a slack bus?

  1. to model the largest load
  2. the losses are unknown beforehand, and one bus also fixes the angle reference
  3. to make the Y-bus invertible by adding a shunt
  4. because generators cannot control voltage

Two buses are connected by a line of series admittance yy. The off-diagonal Y-bus entry is…

  1. yy
  2. −y-y
  3. 1/y1/y
  4. y+jb/2y + jb/2

Why are the load-flow equations nonlinear?

  1. lines are nonlinear
  2. loads and generators are given as powers, so currents depend on the unknown voltages
  3. the Y-bus changes every iteration
  4. because of the slack bus