DC Load Flow and Contingency Screening
A control room must answer, every few minutes, a harder question than "is the grid fine now?": would it still be fine if any one line or generator tripped? This is the N−1 security criterion, required by every transmission operator's grid code (in Europe by the System Operation Guideline, Regulation (EU) 2017/1485). A real grid has thousands of possible outages, each needing its own load flow. The trick that makes it fast enough is the DC load flow: a linear approximation of the Newton–Raphson equations that gives active-power flows within a few percent with a single matrix solve, and turns outages into simple sensitivity factors. It is also the network model inside most electricity-market clearing engines (Energy Markets).
Safety. Grid-level analysis: calculation and simulation only. The bench analogue is a resistor network on a current-limited supply.
Three assumptions
Start from and assume, as holds well on HV transmission:
- : drop , so each line has susceptance .
- Flat voltages: all .
- Small angle differences: .
Then the flow on a line and the bus balance become linear:
where is built like from the line susceptances alone (no charging, no resistance). Delete the slack row and column (its angle is the zero reference) and solve once. Losses are ignored, so the slack supplies exactly the load minus the other generation, and reactive power and voltage magnitudes are not computed at all.
The equations are exactly those of a resistor network: angle is voltage, reactance is resistance, injected power is current. That analogy is the lab below.
Sensitivities: PTDF and LODF
Because the model is linear, every flow is a weighted sum of injections. The power transfer distribution factor is the change of flow on line when is injected at bus and taken out at the slack. Superposition then gives the effect of any trade or redispatch.
When line trips, its pre-outage flow redistributes. The line outage distribution factor gives the share that lands on each other line :
where is the flow on for a transfer of from bus to bus , the ends of line . With all LODFs precomputed, screening every single-line outage is one multiply per pair. Outages that look dangerous are then rechecked with a full AC load flow.
Worked example: N4 by hand
Given: N4's reactances (Bus Types and the Y-Bus): 1–2 , 1–3 , 2–3 , 2–4 , 3–4 ; injections , , .
Find: the angles and the flow on line 1–3.
Solve: the susceptances are , , , and . With bus 1 as reference:
.
Check: the AC load flow gave on line 1–3 and against here. The DC flows are to low mostly because they ignore the of losses; angles are off by more, because the real voltages are below . For screening overloads, that accuracy is usually enough, with a margin.
In Python: DC flows, PTDFs and an outage
import numpy as np
# N4: (from, to, x) and AC flows from the Newton-Raphson lesson (MW, sending end)
lines = [(1, 2, 0.05), (1, 3, 0.08), (2, 3, 0.06), (2, 4, 0.08), (3, 4, 0.10)]
ac_flow = [59.37, 95.67, 76.78, 82.17, 19.45]
P = np.array([0.0, 1.0, -1.5, -1.0]) # injections, pu (slack's value unused)
n, m = 4, len(lines)
A = np.zeros((m, n)) # branch-bus incidence matrix
for l, (i, k, x) in enumerate(lines):
A[l, i - 1], A[l, k - 1] = 1, -1
Bd = np.diag([1 / x for _, _, x in lines]) # branch susceptances
Bbus = A.T @ Bd @ A # DC "B-bus" (no resistance, no charging)
def dc_flows(Bbus, Bd, A, P):
th = np.zeros(n)
th[1:] = np.linalg.solve(Bbus[1:, 1:], P[1:]) # bus 1 = slack, angle 0
return th, Bd @ A @ th
th, f = dc_flows(Bbus, Bd, A, P)
print("angles (deg):", np.round(np.degrees(th), 3))
for l, (i, k, x) in enumerate(lines):
print(f"line {i}-{k}: DC {100*f[l]:6.2f} MW AC {ac_flow[l]:6.2f} MW")
print(f"slack supplies {100*(f[0]+f[1]):.1f} MW in DC (no losses)")
# PTDF: flow change on each line per 1 pu injected at a bus and taken at the slack
X = np.zeros((n, n)); X[1:, 1:] = np.linalg.inv(Bbus[1:, 1:])
PTDF = Bd @ A @ X
print("PTDF (rows = lines, columns = buses 1..4):")
print(np.round(PTDF, 3))
# LODF for the outage of line 1-3, then check by re-solving without it
o = 1
ptdf_o = PTDF @ A[o] # flow change per 1 pu transferred across line o's ends
lodf = ptdf_o / (1 - ptdf_o[o])
f_post = f + lodf * f[o]; f_post[o] = 0
keep = [l for l in range(m) if l != o]
_, f_chk = dc_flows(A[keep].T @ Bd[np.ix_(keep, keep)] @ A[keep], Bd[np.ix_(keep, keep)], A[keep], P)
rating = 120.0
print("outage of line 1-3:")
for j, l in enumerate(keep):
i, k, _ = lines[l]
flag = " OVERLOAD" if abs(100 * f_post[l]) > rating else ""
print(f" line {i}-{k}: LODF {lodf[l]:+.3f}, post-outage {100*f_post[l]:6.2f} MW (re-solved {100*f_chk[j]:6.2f}){flag}")angles (deg): [ 0. -1.637 -4.256 -5.348]
line 1-2: DC 57.14 MW AC 59.37 MW
line 1-3: DC 92.86 MW AC 95.67 MW
line 2-3: DC 76.19 MW AC 76.78 MW
line 2-4: DC 80.95 MW AC 82.17 MW
line 3-4: DC 19.05 MW AC 19.45 MW
slack supplies 150.0 MW in DC (no losses)
PTDF (rows = lines, columns = buses 1..4):
[[ 0. -0.714 -0.457 -0.6 ]
[ 0. -0.286 -0.543 -0.4 ]
[ 0. 0.214 -0.343 -0.033]
[ 0. 0.071 -0.114 -0.567]
[ 0. -0.071 0.114 -0.433]]
outage of line 1-3:
line 1-2: LODF +1.000, post-outage 150.00 MW (re-solved 150.00) OVERLOAD
line 2-3: LODF +0.750, post-outage 145.83 MW (re-solved 145.83) OVERLOAD
line 2-4: LODF +0.250, post-outage 104.17 MW (re-solved 104.17)
line 3-4: LODF -0.250, post-outage -4.17 MW (re-solved -4.17)
Assume every N4 line is rated . In the intact network the most loaded line, 1–3, is at . If line 1–3 trips, all of its moves to line 1–2 (LODF : the slack's power must now leave through 1–2), which reaches , and three quarters of it onto 2–3 (): two post-contingency overloads, so the intact state is not N−1 secure. The operator must act before the outage happens: redispatch generation (more output at bus 2, less at the slack) or reconfigure. The LODF prediction matches a full re-solution without the line exactly, as it must for a linear model. Flow on 3–4 even reverses.
Interactive: N4 as a resistor network
The netlist lab is the DC load flow itself. Bus 1 (the slack, angle ) is the ground node; resistors equal to the reactances stand for the lines; current sources inject at n2 and draw and at n3 and n4. Node voltages read directly as angles in radians: n3 shows , i.e. , and the currents are the flows in pu: (negative because it flows from ground, bus 1, into n3, against the element's node order), . Slide the reactance of line 1–3 up to to simulate its outage: becomes and , the overloads found above (not exactly and because is not quite an open circuit).
Guided lab: an N−1 study on the bench
Hand calculation. Scale the analogue so that of reactance is (the lines become , , , and ) and of power is . A "voltage" of is then an angle of . Predict the node voltages and branch currents intact and with line 1–3 removed, using the factors above.
Simulation. Run the program with the scaled values (flows scale with the injections, angles with the resistances), or set the netlist lab's resistors to the scaled values.
What you would measure. Keep node 1 as the reference, drive node 2 from a second current-limited supply set to constant-current mode () and model the loads at nodes 3 and 4 as constant-current electronic-load channels ( and ). Expect node voltages of about , and relative to node 1 (so put node 1 at a positive potential, e.g. , and read differences), and branch currents within about (resistor and current-setting tolerance). Pull out the 1–3 resistor and the 1–2 current rises from to .
Hazards and safe setup. Low voltage and milliamperes from current-limited instruments; no hazard beyond wiring errors. Set every source's voltage compliance to .
Pitfalls
- Using the DC flow on distribution networks. With near or above 1, assumption 1 fails badly.
- Expecting voltages or reactive power. The DC model has neither; a contingency that causes low voltages is invisible to it.
- Forgetting losses. Flows are typically a few percent low; add a margin or a loss estimate.
- Islanding outages. If a line outage splits the network, and the LODF is undefined: the outage must be handled as an island.
Practice
- Using the PTDF table, how much does the flow on line 1–3 change if bus 2's generator raises its output by (and the slack lowers by the same)?
- Using the same table, by how much must bus 2 raise its output to bring line 1–2's post-outage flow (line 1–3 tripped) down to ? Hint: after the outage, all slack power goes through line 1–2.
- Why is LODF in N4?
Answer
- : the flow on 1–3 falls by , to .
- After the outage the slack's output equals the flow on 1–2: falls to if bus 2 generates more (130 MW total), and the slack less.
- Bus 1 has only two lines. When one trips, everything the slack produces must leave through the other.
Test yourself
Which assumption is NOT part of the DC load flow?
- line resistance neglected
- all voltage magnitudes 1 pu
- small angle differences
- loads modelled as constant impedances
In the DC load flow, the flow on a line from bus to bus is…
An LODF of 0.75 for line A with respect to the outage of line B means…
- line A trips with probability 0.75
- 75 % of line B's pre-outage flow appears on line A after B trips
- line A is loaded to 75 %
- line A carries 75 % of the total load
The N4 network with every line rated 120 MW is not N−1 secure because…
- line 1–3 is overloaded now
- losing line 1–3 overloads lines 1–2 and 2–3
- the slack bus is overloaded
- the voltages are below 0.95 pu