Skip to content

Interactive explainer

DC power flow, the linear model of an AC network

Drop the resistances, hold every voltage at 1 pu, take small angles, and the power flow of an AC network becomes one linear equation, P = B′θ. On the network below, send a transfer from one bus to another and read each line's share of it, take a line out and see which lines pass their limits, and compare every flow with the full AC solution.

From the courses Power Systems (UPC Barcelona), Power System Analysis (FTN Novi Sad), Energy Markets (UPC Barcelona), Power System Analysis (Prof. dr Andrija T. Sarić), Power System Operation (Prof. dr Andrija T. Sarić) and Power System Planning (Prof. dr Andrija T. Sarić).

What to do with the network

The network, 100 MVA base

85.4 MW39.6 MW24.3 MW27.4 MW53.7 MW18.9 MW6.3 MW1slack +125.0 MWθ = 0.00°2+20.0 MWθ = −2.94°3−45.0 MWθ = −5.44°4−40.0 MWθ = −5.77°5−60.0 MWθ = −6.63°

P = B′θ, bus 1 struck out

P = B′θ for buses 2 to 5: each bus's injection in pu, the reduced B′ matrix in pu, and the angles in radians
busP, puB′, puθ, rad
20.20036.11−5.56−5.56−8.33−0.0513
3−0.450=−5.5643.06−33.330.00·−0.0950
4−0.400−5.56−33.3343.06−4.17−0.1006
5−0.600−8.330.00−4.1712.50−0.1157
20 MW
45 MW
40 MW
60 MW
Lines in service (or click a line)

Slack: 125.0 MW by DC, 130.5 MW by AC, the difference the 5.5 MW of losses DC leaves out. The largest line error is 4.0 MW; the lowest voltage 0.937 pu, at bus 5.

Each line, DC against AC

Each line's active power from its first bus to its second, by the DC model and by the AC power flow, in MW, against its limit
linex, pulimit, MWDC, MWAC, MWDC − AC
1–20.0615085.489.4−4.0
1–30.246039.641.1−1.5
2–30.186024.324.7−0.5
2–40.186027.428.0−0.6
2–50.128053.755.1−1.3
3–40.038018.918.9−0.1
4–50.24406.36.3−0.1

DC AC, with resistance and the voltages it finds

The five-bus network in three modes. Flows: each line as thick as its flow, P = B′θ written out with the case's numbers, and each flow by DC beside the full AC power flow. Transfer: a transfer from one bus to another, each line's share of it (its PTDF) and the megawatts it adds, against the limits. Outage: one line out, each other line's LODF and its flow after, checked against a fresh solve, and all seven outages in a row.

What it is

The DC power flow, also called the DC load flow, gives the active power on every line of an AC network from the buses' injections alone. No direct current is involved: the name says its equations look like a DC circuit's, with angles for voltages and reactances for resistances. Each line is its reactance xikx_{ik} in per unit, every voltage is 1 pu, the angles are in radians in the equations (degrees on the figure), and a bus's injection PiP_i is its generation less its load. Then a line carries power in proportion to the angle across it, from its first bus to its second, and the injections are a linear function of the angles:

Pik=θi−θkxik,P=B′θ,Bii′=∑k1xik,Bik′=−1xikP_{ik} = \frac{\theta_i - \theta_k}{x_{ik}}, \qquad P = B'\theta, \qquad B'_{ii} = \sum_{k} \frac{1}{x_{ik}}, \quad B'_{ik} = -\frac{1}{x_{ik}}
(1)

B′B' is built like the admittance matrix with only the lines' reactances, positive on its diagonal, and it is singular: its rows sum to zero, because the angles are only defined against each other. So one bus, the slack, is given θ=0\theta = 0, its row and column are struck out, and

θr=Br′−1Pr=XPr,Pslack=−∑i≠slackPi\theta_r = B_r'^{-1} P_r = X P_r, \qquad P_{\text{slack}} = -\sum_{i \ne \text{slack}} P_i
(2)

The slack is only where the angles are measured from. Put it at another bus and every angle moves by the same amount, while no flow changes, since a flow depends only on a difference of two angles. With the slack at bus 2 instead of bus 1, bus 1 sits at 2.94° and bus 5 at −3.69°, and line 1–2 still carries 85.43 MW.

The five angles of the book's case on one scale, and the seven flows. Move the slack: the angles slide together, the flows stay. Under it, bus 5's shift factor on line 1–2, which changes with the slack, and the PTDF of a transfer from bus 1 to bus 5, which doesn't.

Shift factors and PTDFs (power transfer distribution factors)

Because (2) is linear, each line's flow is a fixed matrix times the injections. Write each line's flow with the angles from (2) and you get the shift factors HH, one row a line, one column a bus:

Pline=H P,Hℓb=Xib−Xkbxikfor line ℓ from i to kP_{\text{line}} = H\,P, \qquad H_{\ell b} = \frac{X_{ib} - X_{kb}}{x_{ik}} \quad \text{for line } \ell \text{ from } i \text{ to } k
(3)

HℓbH_{\ell b} is the megawatts line ℓ\ell carries for each megawatt injected at bus bb and taken out at the slack. They go by several names: generation or injection shift factors, and in Prof. Andrija Sarić's lecture on security and distribution factors the factors aℓia_\ell^i. The slack's column is zero, and the whole matrix depends on which bus is the slack: bus 5's factor on line 1–2 is −0.786, +0.057, −0.157, −0.114, 0.000 with the slack at bus 1, 2, 3, 4 and 5.

A transfer from bus mm to bus nn, a megawatt more at one and a megawatt less at the other, is one column less another, and the slack drops out of it:

PTDFℓ(m→n)=Hℓm−Hℓn,ΔPℓ=PTDFℓ(m→n)⋅ΔP\text{PTDF}_\ell(m \to n) = H_{\ell m} - H_{\ell n}, \qquad \Delta P_\ell = \text{PTDF}_\ell(m \to n)\cdot \Delta P
(4)

That is the power transfer distribution factor: each line's share of the transfer, the same for any slack and any size. Of a transfer from bus 1 to bus 5, 78.6 % leaves on line 1–2 and 21.4 % on 1–3, and 69.8 % arrives on 2–5 and 30.2 % on 4–5; at every bus in between the shares in and out cancel. A negative share is a counterflow: a transfer from bus 2 to bus 4 puts −17.1 % on line 1–2, which takes load off it, though the transfer never touches bus 1. And with each line's limit, the factors say how far a transfer can go before a line reaches its limit, the least over the lines of (limit − flow)/PTDF: from bus 1 to bus 5, 37.6 MW, set by line 2–5.

A line out: LODFs (line outage distribution factors)

When line kk, from bus mm to bus nn, goes out, its flow PkP_k has to find another way. Think of it as a transfer from mm to nn that the network makes up for itself: of a transfer Δt\Delta t between its own ends, the line would carry PTDFk Δt\text{PTDF}_k\,\Delta t and the rest of the network the other (1−PTDFk) Δt(1 - \text{PTDF}_k)\,\Delta t. The line is gone when the rest carries all of its old flow, so Δt=Pk/(1−PTDFk)\Delta t = P_k/(1 - \text{PTDF}_k), and every other line moves by its own share of that:

dℓk=PTDFℓ(m→n)1−PTDFk(m→n),Pℓ′=Pℓ+dℓk Pk,dkk=−1d_{\ell k} = \frac{\text{PTDF}_\ell(m \to n)}{1 - \text{PTDF}_k(m \to n)}, \qquad P_\ell' = P_\ell + d_{\ell k}\,P_k, \qquad d_{kk} = -1
(5)

dℓkd_{\ell k} is the line outage distribution factor; Prof. Sarić's lecture finds the same dℓkd_\ell^k by the matrix inversion lemma. For the DC model it is exact, not an estimate: line 2–5 out gives, by (5), the flows a fresh solve without it gives, to the last digit (the figure's Outage mode checks it every time). On line 4–5 the factor is exactly 1, because bus 5 has only two lines: everything 2–5 carried, 53.7 MW, comes in on 4–5, which goes to 60.0 MW. Where 1−PTDFk=01 - \text{PTDF}_k = 0, the line is a bus's only way to the rest, its loss cuts the bus off, and there is no factor: with 1–2 out, line 1–3 is bus 1's only line. A transfer after an outage moves line ℓ\ell by PTDFℓ+dℓkPTDFk\text{PTDF}_\ell + d_{\ell k}\text{PTDF}_k, the outage transfer factors. A generator's loss is a transfer too, from the lost unit to whichever units take up its output (the slack, in the simplest case), so it needs only a column of HH.

Limits and N−1

A network is N−1 secure if no single outage puts a line past its limit. With the factors, seven outages times six remaining lines are 42 flows from one matrix and the base case, with no new solve. On the figure's network, with limits of 150, 60, 60, 60, 80, 80, 40 MW in the order 1–2 to 4–5, the base case is within all of them, and two outages are not:

Each line out of the book's case in turn, by its LODFs (5); the flows are the same as seven fresh solves.
Line outMost loaded line after itIts flow, MWLoading
1–21–3125.0 of 60208 %, over
1–31–2125.0 of 15083 %
2–31–347.7 of 6079 %
2–41–346.9 of 6078 %
2–54–560.0 of 40150 %, over
3–42–560.0 of 8075 %
4–52–560.0 of 8075 %

With 1–2 out the DC model puts 125.0 MW on line 1–3, and the AC power flow of the same network has no solution at all; with 2–5 out it finds 64.8 MW on 4–5 against DC's 60.0, and a lowest voltage of 0.788 pu. That is how the model is used: it screens every outage fast, and the few it flags, or comes close to flagging, are checked with a full AC power flow.

Who writes it which way

The model and its factors come in several conventions, and the numbers only agree once the slack, the sign of BB and the meaning of "PTDF" match:

WhoThe modelThe factorsTo map it onto this page
This pageP=B′θP = B'\theta, B′B' positive on the diagonal, 1/x1/x a line, bus 1 the slack, pu and radiansshift factor HH (a bus to the slack), PTDF (a transfer, source to sink), LODF dℓkd_{\ell k} (row the line watched, column the line out, diagonal −1)
Prof. Andrija Sarić, Proračun tokova snaga, and his lectures on optimal power flow and planningPr=−BrθrP_r = -B_r\theta_r, BB taken from the admittance matrixturn BB's sign
Prof. Sarić, Sigurnost EES, faktori raspodelePr=BrθrP_r = B_r\theta_raℓia_\ell^i for a change of injection, dℓkd_\ell^k for a branch outaa is the shift factor, dd the LODF
Overbye's lectures, PowerWorldB′B' with the admittance matrix's sign, θ=−B−1P\theta = -B^{-1}Pinjection shift factor ψ\psi, PTDF φ\varphi of a transaction (in %), LODF dℓkd_\ell^kturn BB's sign; the factors are the same
Kekatos; Chatzivasileiadisas here (Chatzivasileiadis writes δ\delta for θ\theta)SℓnS_{\ell n}; PTDFij,m\text{PTDF}_{ij,m} and PTDFij,mn\text{PTDF}_{ij,mn}the same
MATPOWER, PyPSA, PowerNetworkMatrices.jl1/x1/x a branch (with taps)"PTDF" is the bus-to-slack matrix, this page's HH; LODF indexed [monitored, outaged], diagonal −1 (PyPSA calls it BODF)subtract two of their PTDF's columns to get this page's PTDF
US market operatorsshift factor, GSF; a PTDF with the sink namedname the reference bus before comparing numbers
Flow-based market coupling (Europe)a zone's PTDF times its net export, against a line's remaining margina zone in place of a bus
Textbooks of power-system analysisP≈XR2+X2 U2 ΔθP \approx \dfrac{X}{R^2 + X^2}\,U^2\,\Delta\thetathe line's susceptance where this page writes 1/x1/x: the same at r=0r = 0, 0.99 of it at r/x=0.1r/x = 0.1, 0.90 at 1/31/3

Why a linear model is worth so much

A solution takes one sparse linear solve and never fails to converge, and the factors turn a change (a transfer, an outage, a new dispatch) into a multiplication. So thousands of cases, every line out in turn, every hour of a year, every bid in a market, cost almost nothing. The price is the error against AC, which the next section measures.

If lines are taken out until a bus can't reach the slack, Br′B'_r becomes singular and the angles have no answer: the network is two networks. The figure says so instead of solving.

Where it comes from

The full AC flow on a line of resistance rr and reactance xx, entering at bus ii on its way to bus kk, is

Pik=Vi2r−ViVk (rcos⁡θik−xsin⁡θik)r2+x2,θik=θi−θkP_{ik} = \frac{V_i^2 r - V_iV_k\,\big(r\cos\theta_{ik} - x\sin\theta_{ik}\big)}{r^2 + x^2}, \qquad \theta_{ik} = \theta_i - \theta_k
(6)

Three assumptions turn it into (1), and each costs something of its own:

  • r≪xr \ll x: drop rr, and Pik=ViVksin⁡θik/xP_{ik} = V_iV_k\sin\theta_{ik}/x. With rr go the losses, and the line's two ends carry the same power. At 10° with both voltages at 1 pu, it puts the flow 7.96 % too high on a line of r/x=1/3r/x = 1/3 and 0.12 % on one of 0.1.
  • Vi=Vk=1V_i = V_k = 1 pu: the flow is wrong by 1/(ViVk)−11/(V_iV_k) - 1, 5.26 % with one end at 0.95 pu.
  • Small angles, sin⁡θ≈θ\sin\theta \approx \theta: the flow is too high by θ/sin⁡θ−1\theta/\sin\theta - 1, 0.51 % at 10°, 4.72 % at 30° and 11.1 % at 45°.
One line of x = 0.1 pu: its active power against the angle across it by (6), at the sending end and, fainter, the receiving end, and the model with the assumptions you switch on; all three on is the straight line θ/x of the DC model.

Together, on a line of r/x=1/3r/x = 1/3 with the far end at 0.95 pu and 20° across it, (6) gives 3.25 pu at the sending end and 2.89 at the receiving end, and the DC model says 3.49: 7.5 % above the sending end. The errors don't simply add: the resistance and the low voltage pull the true flow one way, the angle another.

The same in matrices

Let AA be the incidence matrix, one row a line with +1+1 at its first bus and −1-1 at its second, and BdB_d the diagonal of the lines' 1/x1/x. The line flows are BdAθB_dA\theta, and each bus's injection is what its lines take away, ATA^{\mathsf T} times the flows:

P=ATBdA θ=B′θ,Pline=BdA θ=BdA XP=HPP = A^{\mathsf T} B_d A\,\theta = B'\theta, \qquad P_{\text{line}} = B_dA\,\theta = B_dA\,X P = H P
(7)

So H=BdAXH = B_dAX, with XX the inverse of B′B' without the slack's row and column and zeros put back for it: (3) is one row of it. The same factors can be found from the network's loops instead of its buses: a transfer sent along a tree of the network, then corrected by a flow round each loop until the angles close round every one. A ring has one loop, so with any line out the rest is a chain and every LODF is ±1; a triangle is the smallest ring.

How far to trust it

On the book's five-bus case, whose lines all have r/x=1/3r/x = 1/3 (high for transmission), the worst line is 4.02 MW off, 4.5 % of its AC flow, and 2.2 % on average over the seven. At twice the load the worst is 10.2 %. Give the same lines an r/xr/x of 0.1 and the book's case is 1.4 % off. Past 2.95 times the book's load (3.61 times with the less resistive lines) the AC power flow has no solution, and the DC model keeps answering.

The worst line's error, DC against AC, as a share of its AC flow, as every load of the five-bus case is scaled up, for the book's lines and for lines of r/x = 0.1. Each curve stops where the AC power flow stops having a solution.

On real grids the evidence is similar. On a 37-bus case Overbye, Cheng and Sun found the DC flows 4.6 % from AC on average, the same line congested and the average price about 1 % apart; on a grid of some 13,000 buses the mean difference was 1.9 MW and the largest 85 MW, and DC found 12 of the 23 binding constraints AC found, about 60 times faster. In Overbye's lectures, the LODFs of the first outages of the North American blackout of 14 August 2003 predicted 179, 545, 48 and 68 MW of change where 176, 527, 54 and 64 MW moved. Fast and close, for active power on a well-supported grid; least trustworthy where the voltages sag, the lines are resistive or the loading is near the edge.

What the model can't say at all: the losses (the slack gives 125.00 MW by DC and 130.50 by AC), the reactive power, and the voltages, which it assumes. A network can pass every DC check and still have a voltage problem, which only an AC power flow will show.

Try this

  1. Switch to Transfer. It opens on 50 MW from bus 1 to bus 5. 78.6 % leaves on line 1–2 and 21.4 % on 1–3, and 2–5 goes to 88.6 of its 80 MW. Pull the size back to 35 MW and every line is within its limit; at 40, line 2–5 is past it again: 37.6 MW is the most that can go. Now move bus 3's load: every megawatt changes, no share does.
  2. Still in Transfer, send it from bus 2 to bus 4. Line 1–2 gets −17.1 % of it, a counterflow, though the transfer never touches bus 1; line 3–4 takes the largest share, 45.7 %.
  3. Switch to Outage. It opens with line 2–5 out; then try 3–4. With 2–5 out, line 4–5 takes all its 53.7 MW (LODF 1: bus 5 has no other line) and carries 60.0 of its 40. With 3–4 out, 4–5 falls to exactly 0: its LODF is −1/3, and a third of 3–4's 18.86 MW is 6.29.
  4. Pick 1–2 in Outage, then go back to Flows and take line 1–2 out there. Outage puts 125.0 MW on 1–3, more than twice its 60. In Flows the AC power flow of that network has no solution at all, while DC answers calmly. With every line back, set all three loads to 150 MW: AC still solves, DC is off by more; at 200 each, AC has no solution again.

Worked examples

The five-bus network of Stagg and El-Abiad's textbook, its lines' charging left out. Bus 2 generates 40 MW and serves 20, so it injects +20+20 MW; buses 3, 4 and 5 take 45, 40 and 60 MW. On 100 MVA, Pr=[0.20,−0.45,−0.40,−0.60]P_r = [0.20, -0.45, -0.40, -0.60] pu. Bus 2 has lines to 1, 3, 4 and 5, so B22′=1/0.06+1/0.18+1/0.18+1/0.12=36.11B'_{22} = 1/0.06 + 1/0.18 + 1/0.18 + 1/0.12 = 36.11, and the whole reduced matrix and its solution are

[36.11−5.56−5.56−8.33−5.5643.06−33.330.00−5.56−33.3343.06−4.17−8.330.00−4.1712.50] θr=[0.20−0.45−0.40−0.60]⇒θr=[−0.0513−0.0950−0.1006−0.1157] rad=[−2.94−5.44−5.77−6.63]∘\begin{bmatrix} 36.11 & −5.56 & −5.56 & −8.33 \\ −5.56 & 43.06 & −33.33 & 0.00 \\ −5.56 & −33.33 & 43.06 & −4.17 \\ −8.33 & 0.00 & −4.17 & 12.50 \end{bmatrix}\,\theta_r = \begin{bmatrix} 0.20 \\ −0.45 \\ −0.40 \\ −0.60 \end{bmatrix} \quad\Rightarrow\quad \theta_r = \begin{bmatrix} −0.0513 \\ −0.0950 \\ −0.1006 \\ −0.1157 \end{bmatrix}\ \text{rad} = \begin{bmatrix} −2.94 \\ −5.44 \\ −5.77 \\ −6.63 \end{bmatrix}^\circ

Each line's flow is its angle difference over its reactance. Line 1–2, for one: P12=(0−(−0.0513))/0.06=0.8543P_{12} = (0 - (−0.0513))/0.06 = 0.8543 pu, 85.43 MW. All seven:

Flows from each line's first bus to its second. AC is the full Newton-Raphson power flow of the same case, with resistances, the loads' reactive power and the slack at 1 pu.
Linexx, puDC, MWAC, MWDC − AC
1–20.0685.4389.45−4.02
1–30.2439.5741.05−1.48
2–30.1824.2924.74−0.46
2–40.1827.4328.00−0.57
2–50.1253.7155.05−1.34
3–40.0318.8618.92−0.06
4–50.246.296.34−0.06

The slack gives −∑Pi=125-\sum P_i = 125 MW by DC and 130.50 MW by AC: the 5.50 MW between them are the losses, which DC doesn't know. Every DC flow is a little under its AC one, at most by 4.02 MW. Every line here has r/x=1/3r/x = 1/3, high for a transmission line (0.1 is more usual), so this is the model on a bad day; on a high-voltage grid it does better.

50 MW from bus 1 to bus 5, by the PTDFs

Invert the reduced B′B' of the first example once, and every factor follows from its entries. With bus 1 the slack, XX in pu, buses 2 to 5:

X=Br′−1=[0.050570.037710.040290.047140.037710.089140.078860.051430.040290.078860.095140.058570.047140.051430.058570.13095]X = B_r'^{-1} = \begin{bmatrix} 0.05057 & 0.03771 & 0.04029 & 0.04714 \\ 0.03771 & 0.08914 & 0.07886 & 0.05143 \\ 0.04029 & 0.07886 & 0.09514 & 0.05857 \\ 0.04714 & 0.05143 & 0.05857 & 0.13095 \end{bmatrix}

Bus 1's row and column of XX are zero, so by (3) and (4) the share of line 1–2 is (0−0−0+X25)/x12=0.04714/0.06=0.7857(0 - 0 - 0 + X_{25})/x_{12} = 0.04714/0.06 = 0.7857, and of line 2–5 (X25−X55)/x25(X_{25} - X_{55})/x_{25} with the sign of a transfer into bus 5, (0.13095−0.04714)/0.12=0.6984(0.13095 - 0.04714)/0.12 = 0.6984. All seven, and what 50 MW does:

The book's case with 50 MW more at bus 1 and 50 MW less at bus 5. A fresh solve gives the same flows.
LinePTDFBefore, MWAdds, MWAfter, MWLimit, MW
1–2+0.785785.43+39.29124.71150
1–3+0.214339.57+10.7150.2960
2–3+0.023824.29+1.1925.4860
2–4+0.063527.43+3.1730.6060
2–5+0.698453.71+34.9288.63, over80
3–4+0.238118.86+11.9030.7680
4–5+0.30166.29+15.0821.3740

The shares out of bus 1 sum to 1 (0.7857 + 0.2143), and so do those into bus 5 (0.6984 + 0.3016). Line 2–5 passes its 80 MW. It had 80−53.71=26.2980 - 53.71 = 26.29 MW of room and takes 0.6984 of each megawatt, so the most that can go is 26.29/0.6984 = 37.6 MW; no other line is closer to its limit for this transfer.

Line 2–5 out, without solving again

Line 2–5 carries 53.71 MW. Its own PTDF, for a transfer from bus 2 to bus 5, is H2–5,2−H2–5,5=0.7270H_{2\text{–}5,2} - H_{2\text{–}5,5} = 0.7270, so the rest of the network carries 1−0.7270=0.27301 - 0.7270 = 0.2730 of such a transfer, and line 4–5's share of it is 0.2730. By (5), d4–5, 2–5=0.2730/0.2730=1.0000d_{4\text{–}5,\,2\text{–}5} = 0.2730/0.2730 = 1.0000. Every line:

The flows after the outage by the factors, and by a fresh solve of the network without line 2–5: the same.
LineLODFBefore, MWAfter by (5), MWSolved again, MWLimit, MW
1–2−0.209385.4374.1974.19150
1–3+0.209339.5750.8150.8160
2–3+0.348824.2943.0243.0260
2–4+0.441927.4351.1651.1660
2–5−153.710.000.0080
3–4+0.558118.8648.8448.8480
4–5+1.00006.2960.00, over60.0040

Line 4–5 is now at 60.0 of its 40 MW: the outage is not secure. Line 1–2 out goes the same way in two lines: bus 1 has only lines 1–2 and 1–3, so the LODF of 1–3 is 1 and it takes all 85.43 MW, 125.00 on a line of 60. The AC power flow of that network has no solution: the DC answer is a warning, not a state the network can be in.

Three buses by hand

Three buses in a triangle, each line 0.1 pu, bus 1 the slack, bus 3 taking 150 MW. Without bus 1's row and column, and with 1/x=101/x = 10 a line,

Br′=[20−10−1020],X=1300[20101020],θr=X[0−1.5]=[−0.05−0.10] radB_r' = \begin{bmatrix} 20 & -10 \\ -10 & 20 \end{bmatrix}, \quad X = \frac{1}{300}\begin{bmatrix} 20 & 10 \\ 10 & 20 \end{bmatrix}, \quad \theta_r = X\begin{bmatrix} 0 \\ -1.5 \end{bmatrix} = \begin{bmatrix} −0.05 \\ −0.10 \end{bmatrix}\ \text{rad}

So P12=0.05/0.1=0.5P_{12} = 0.05/0.1 = 0.5 pu, P13=0.10/0.1=1.0P_{13} = 0.10/0.1 = 1.0 and P23=0.05/0.1=0.5P_{23} = 0.05/0.1 = 0.5: 50, 100 and 50 MW. Two thirds go straight down 1–3 and one third round by bus 2, because the way round has twice the reactance. Those are the PTDFs of a transfer from 1 to 3: 0.3333, 0.6667, 0.3333.

Now let bus 2 give 60 MW, so bus 1 gives 90. By superposition each bus's power takes its own paths: bus 2's transfer to bus 3 has shares −0.3333, +0.3333, +0.6667, so the flows are 90×(1/3,2/3,1/3)+60×(−1/3,1/3,2/3)=(10,80,70)90 \times (1/3, 2/3, 1/3) + 60 \times (-1/3, 1/3, 2/3) = (10, 80, 70) MW. Bus 2's power takes 20 MW off line 1–2. At 75 MW from bus 2 line 1–2 carries nothing, and past it the flow turns round.

The triangle of three 0.1 pu lines, bus 3 taking 150 MW: each flow and its two parts, bus 1's power and bus 2's. Move bus 2's generation, or take a line out.

Take 1–3 out and the other two are in series: everything it carried goes round, so both LODFs are 1. With bus 2 at 60 MW, line 1–2 goes from 10 to 90 MW and 2–3 from 70 to 150. In general the straight line 1–3 takes the share (x12+x23)/(x12+x23+x13)(x_{12} + x_{23})/(x_{12} + x_{23} + x_{13}) of a transfer from 1 to 3, a current divider: 0.8 if 1–3 had 0.05 pu, 0.5 at 0.2 pu.

A line limit splits the price

Two buses and one line, the market of the linear programming page: generator 1 at bus 1 offers up to 300 MW at 30 €/MWh, generator 2 at bus 2 up to 250 MW at 70 €/MWh, and 400 MW of load sits at bus 2. A radial line needs no angles: its flow is whatever generator 1 sends. With 350 MW allowed, generator 1 runs flat out at 300 MW, generator 2 gives the other 100, and one more megawatt anywhere comes from generator 2: one price, 70 €/MWh at both buses.

With 200 MW allowed, generator 1 stops at 200, the line's limit, and generator 2 gives 200. One more megawatt at bus 1 comes from generator 1, at 30 €/MWh; one more at bus 2 can't cross the line and comes from generator 2, at 70. The price at a bus is what one more megawatt there costs, so the two buses now have different prices, and the 40 €/MWh between them is the limit's shadow price, what one more megawatt of line would save. The cost is 20000 €/h, and the line earns the price difference on every megawatt it carries, 40 × 200 = 8000 €/h: the congestion rent, or merchandising surplus.

Two buses and one limited line, the linear programming page's market: who runs, the flow against the limit and the price at each bus. Move the limit below generator 1's output and the price splits.

In a meshed network Kirchhoff's law decides how the power splits, so a limit reaches every bus. Take the triangle of the last example with generator 1 at bus 1 offering 30 €/MWh, generator 2 at bus 2 offering 70, and 80 MW allowed on line 1–3. Two thirds of whatever bus 1 sends to bus 3 goes by 1–3, so bus 1 can send only 90 MW, and bus 2 gives 60: the flows are 10, 80, 70 MW, the dispatch of the three-bus figure at 60 MW. The prices are 30, 70, 110 €/MWh. Bus 3 pays more than either offer: one more megawatt there needs two more from generator 2 and one less from generator 1 to keep line 1–3 at its limit, 2×70−30=1102 \times 70 - 30 = 110.

Each price is the slack's price less the limit's shadow price times the bus's shift factor on the line, λb=λ−μH13,b\lambda_b = \lambda - \mu H_{13,b}: here μ=120\mu = 120 €/MWh and the shift factors on 1–3 are 0, −1/3 and −2/3. That formula is how the markets that price by bus write a nodal price, and the dispatch behind it is a linear programme with the DC flows as its constraints.

A 220 kV ring from my course project

The network of my Power Systems group project at UPC: seven 220 kV buses in one ring, on 100 MVA. Bus 3 generates 1300 MW against 913 of load, buses 5 and 6 import, bus 7 takes 77 MW, and the lines have r/xr/x of 0.025 to 0.061, a fifth to a thirteenth of the five-bus case's. The DC flows, and the AC power flow of the same network with its generators holding their voltages at 1.00 to 1.05 pu and the lines' charging in:

Flows from each line's first bus to its second; a minus runs the other way round the ring. AC by Newton-Raphson, bus 1 the slack at 1.03 pu.
LineDC, MWAC, MWDC against AC
1–2−232.05−225.16+3.1 %
2–3−156.05−150.69+3.6 %
3–4230.95235.45−1.9 %
4–5230.95234.25−1.4 %
5–692.9594.62−1.8 %
6–7−34.05−32.57+4.6 %
7–1−111.05−109.60+1.3 %

The lines are far less resistive than the book's, and DC is still 1.3 to 4.6 % off. The resistance is not what does it: take it out of the AC run and the gaps don't shrink. What DC leaves out here is the voltages, held at 1.03 to 1.05 pu where it assumes 1, the lines' charging, and the angle: line 4–5 has 17° across it. The largest share is on 6–7, the most lightly loaded line, where 1.5 MW is 4.6 %. The slack gives 2.0 MW by DC and 7.8 by AC, the difference the losses. A ring has one loop, so any line out leaves a chain, and every LODF is ±1.

Mistakes people make

  1. The mistake

    Degrees in P=B′θP = B'\theta: P12=(0−(−2.94))/0.06=49P_{12} = (0 - (−2.94))/0.06 = 49 pu.

    Why it's wrong

    That is 4895 MW for a line that carries 85.4: 180/π too large.

    The right one

    Angles in radians in the equations, (0−(−0.0513))/0.06=0.8543(0 - (−0.0513))/0.06 = 0.8543 pu; degrees only for showing them.

  2. The mistake

    Entering the injections in MW as if they were per unit.

    Why it's wrong

    The "angles" come out at −294° to −663°, and the flows come out right as numbers, which hides the mistake until an angle is used for something.

    The right one

    P in per unit on the base the reactances are on (100 MVA here), and the flows back to MW at the end.

  3. The mistake

    Taking BB as the imaginary part of the admittance matrix and solving θ=B−1P\theta = B^{-1}P.

    Why it's wrong

    Its diagonal is negative, so every angle and flow turns round: bus 2 at +2.94°, and 85.4 MW flowing into the slack on line 1–2.

    The right one

    Either B′=−Im YB' = -\text{Im}\,Y with P=B′θP = B'\theta, or P=−BθP = -B\theta. Prof. Sarić's lecture on distribution factors writes the first, his lecture on power flow the second.

  4. The mistake

    Inverting the whole B′B', or keeping the slack's injection in PP.

    Why it's wrong

    The whole B′B' is singular: its rows sum to zero and its rank is one less than its size.

    The right one

    Strike the slack's row and column, leave its injection out of PP, and find it last, as −∑Pi-\sum P_i.

  5. The mistake

    Calling an HVDC link's flow "DC power flow".

    Why it's wrong

    An HVDC link's power is set by its converters, and no angle drives it. The DC power flow is a model of the AC network, named for the shape of its equations.

    The right one

    DC power flow (or DC load flow) for the linear model; an HVDC link enters it as a fixed injection at each end.

  6. The mistake

    Reading a transfer's PTDF from one column of the shift factors.

    Why it's wrong

    A column is a transfer to the slack. For a transfer from bus 2 to bus 5, bus 5's column alone gives 78.6 % on line 1–2; the true share is −5.7 %. The reverse slip is saying a PTDF depends on the slack: a shift factor does, a difference of two doesn't.

    The right one

    PTDF(m→n)=H⋅m−H⋅n\text{PTDF}(m \to n) = H_{\cdot m} - H_{\cdot n}, one column less the other.

  7. The mistake

    Multiplying an LODF by the lost line's flow read the other way round.

    Why it's wrong

    With 3–4 out, line 2–4 becomes 27.43+0.6667×18.86=40.027.43 + 0.6667 \times 18.86 = 40.0 MW. Read 3–4 from bus 4 to bus 3 and keep the factor's sign, and it gives 14.9.

    The right one

    The lost line's flow before the outage, signed in the direction its own factors were found.

  8. The mistake

    Computing an LODF for a line that is a bus's only way out.

    Why it's wrong

    Its own PTDF is 1, and 1−1=01 - 1 = 0 under the fraction: no factor exists, and a code that swaps the zero for anything returns a number without meaning.

    The right one

    Find the islanding first (1 − PTDF = 0), and report a bus cut off, as the figure does with 1–3 once 1–2 is out.

  9. The mistake

    Believing an answer because the model gave one.

    Why it's wrong

    It always answers: with 1–2 out it puts 125 MW on 1–3 where the AC power flow has no solution, and at three times the book's load it still gives flows.

    The right one

    Screen with DC, then confirm the worst cases, and anything near a limit, with an AC power flow.

  10. The mistake

    Expecting the PTDFs to change with the dispatch, or the slack to differ from −ΣP by rounding.

    Why it's wrong

    The factors depend only on the lines and their reactances, not on the loads or the generation. And the model has no losses, so the slack is exactly −ΣP; a "loss" in a DC result is an error in the injections.

    The right one

    Recompute the factors only when the network changes (a line or a transformer in or out, a reactance); recompute the flows for every new dispatch.

The same in Python

import numpy as np

lines = [(1, 2, 0.06), (1, 3, 0.24), (2, 3, 0.18), (2, 4, 0.18),
         (2, 5, 0.12), (3, 4, 0.03), (4, 5, 0.24)]        # from, to, x in pu
P = np.array([0, 20, -45, -40, -60]) / 100                # injections, pu on 100 MVA
limit = np.array([150, 60, 60, 60, 80, 80, 40])           # MW
A = np.array([[(b == i) - (b == k) for b in range(1, 6)] for i, k, _ in lines], float)
Bd = np.diag([1 / x for *_, x in lines])                  # incidence A, 1/x on Bd's diagonal
X = np.zeros((5, 5))
X[1:, 1:] = np.linalg.inv((A.T @ Bd @ A)[1:, 1:])         # bus 1 is the slack
H = Bd @ A @ X                                            # shift factors, 7 x 5
flow = H @ P * 100
print("flows, MW: ", np.round(flow, 2))
ptdf = H[:, 0] - H[:, 4]                                  # a transfer from bus 1 to bus 5
print("PTDF 1->5: ", np.round(ptdf, 4), "\nwith 50 MW:", np.round(flow + 50 * ptdf, 2))
own = H[:, 1] - H[:, 4]                                   # line 2-5 (row 4) as a transfer
lodf = np.where(np.arange(7) == 4, -1, own / (1 - own[4]))
after = flow + lodf * flow[4]
print("LODF, 2-5 out:", np.round(lodf, 4), "\nflows after:  ", np.round(after, 2) + 0)
print("over a limit: ", [f"{i}-{k}" for (i, k, _), f, m in zip(lines, after, limit) if abs(f) > m])

It prints:

flows, MW:  [85.43 39.57 24.29 27.43 53.71 18.86  6.29]
PTDF 1->5:  [0.7857 0.2143 0.0238 0.0635 0.6984 0.2381 0.3016]
with 50 MW: [124.71  50.29  25.48  30.6   88.63  30.76  21.37]
LODF, 2-5 out: [-0.2093  0.2093  0.3488  0.4419 -1.      0.5581  1.    ]
flows after:   [74.19 50.81 43.02 51.16  0.   48.84 60.  ]
over a limit:  ['4-5']

B′ built as AᵀB_dA, the shift factors H = B_dAX, the flows, the PTDF of a transfer from bus 1 to bus 5 and what 50 MW of it does, then line 2–5 out by its LODFs and the line that passes its limit: the numbers of the figure and the worked examples.

Questions people ask

What is the DC power flow, and is the DC load flow the same thing?

The same thing under two names: a linear model of an AC network that gives each line's active power from the buses' injections, P=B′θP = B'\theta, with resistances dropped, voltages at 1 pu and sin⁡θ≈θ\sin\theta \approx \theta. On the five-bus case it solves in one step and lands within 4.02 MW of the full AC power flow.

Why is it called DC when the network is AC?

Because its equations have the form of a DC resistor network: angles play the voltages, reactances the resistances and active power the current. No direct current is involved, and it says nothing about HVDC links.

What are the assumptions of the DC power flow?

Three: resistance much smaller than reactance, every voltage at 1 pu, and small angles, sin⁡θ≈θ\sin\theta \approx \theta and cos⁡θ≈1\cos\theta \approx 1. Alone they cost 0.12 % (r/x = 0.1, 10°), 5.3 % (0.95 pu) and 0.5 % (10°); Where it comes from shows each.

How accurate is the DC power flow compared with the AC power flow?

A few per cent on a healthy grid: 4.5 % on the worst line of the five-bus case with its resistive lines, 1.4 % with lines of r/x = 0.1. It worsens as the loading rises (10.2 % at twice the load) and keeps answering past the point where AC has no solution.

Does the DC power flow account for losses?

No. The slack gives exactly −∑P-\sum P, 125 MW on the five-bus case, where the AC power flow needs 130.50: the 5.50 MW of losses are missing. Studies that need them add an estimate as extra load, or iterate with loss factors.

Why are the slack bus's row and column removed, and does the slack change the flows?

B′B' is singular, because only differences of angles matter, so one angle is fixed at 0 and its equation dropped. The choice moves every angle by one amount and no flow: with the slack at bus 2, line 1–2 still carries 85.43 MW. The shift factors do change with it; the PTDFs don't.

Are the angles in radians or degrees?

Radians, in P=(θi−θk)/xP = (\theta_i - \theta_k)/x, with xx and PP in per unit. Degrees there make every flow 57.3 times too large: line 1–2 would carry 4895 MW instead of 85.4.

What is a PTDF, and how is the PTDF matrix calculated?

The power transfer distribution factor is a line's share of a transfer from one bus to another. Invert the reduced B′B' to get XX, form the shift factors H=BdAXH = B_dAX, and take one column less another: of 1 MW from bus 1 to bus 5, line 2–5 carries 0.6984.

What is the difference between a PTDF and a shift factor?

A shift factor (generation or injection shift factor) is a line's share of a transfer from a bus to the slack, so it depends on the slack; a PTDF is for a transfer between any two buses and doesn't. MATPOWER and PyPSA call the bus-to-slack matrix "PTDF": subtract two of its columns to get a transfer's.

What is an LODF, and what is its formula?

The line outage distribution factor is the share of a lost line's flow that another line picks up: dℓk=PTDFℓ/(1−PTDFk)d_{\ell k} = \text{PTDF}_\ell/(1 - \text{PTDF}_k), both for a transfer between the lost line's ends. With 2–5 out, line 4–5's is 1, and its flow becomes 6.29 + 53.71 = 60.00 MW.

Do the PTDFs change when the dispatch or the load changes?

No: they depend only on which lines are in service and their reactances. A new dispatch changes the flows, H PH\,P, not HH; a line out changes the factors, which the LODFs give without a new inversion.

How do I run a DC power flow in MATPOWER, pandapower or PyPSA?

MATPOWER: rundcpf for the flow, makePTDF for the shift factors (for one slack bus, or weights you give) and makeLODF from them. pandapower: pandapower.rundcpp(net), and run_ptdf and run_lodf in pandapower.sensitivity. PyPSA: n.lpf() for the linear power flow, and on a sub-network calculate_PTDF() and calculate_BODF(), its name for the LODFs.

Where it's used

Electricity markets: the security-constrained economic dispatch that sets the price at each bus in most US markets is a DC optimal power flow, the shift factors written into its constraints, and the flow-based market coupling of continental Europe limits trade between zones by zone-to-zone PTDFs against each line's remaining margin. Security analysis: contingency screening takes every line out in turn with the outage distribution factors and checks only the worst cases with a full AC power flow. Planning: years of hourly cases, and transmission expansion studies that would be too slow in AC. And its B′B', built from the reactances alone, is the matrix Stott's fast decoupled AC power flow iterates with. In a control centre, contingency screening starts from the state estimate, the voltages worked out from the network's meters: my master's thesis works them out on a distribution feeder, by weighted least squares and by a graph neural network.

It belongs to six courses, three of them mine; their materials are linked below. Energy Markets, my UPC course, is the one that names the model. In T2: Optimization of electricity market operations, "2. Market Clearing Models.pdf" (in Course site too, as "OEMO 2 market clearing models r13.pdf") puts "the DC-OPF model (or DC load flow)" inside the network-constrained auction: a balance at every bus, each line's flow from the angle across it and its reactance, a capacity a line, the price at a bus as the multiplier of its balance, and the money a congested line leaves between two prices as the merchandising surplus; then it couples markets by available transfer capacity or by the flow-based model, whose constraints are zone PTDFs. In Course site, "T1_3_Electricity_markets_2025.pdf" writes a line's flow as a weighted sum of the buses' injections, the shift factors without their name. In Exercise solutions, exercise 6 clears a generator and a load on two buses across one limited line in GAMS, the problem of the price example; and in Exams, Part 2's papers with a network ask the same on two buses and on a triangle. Power Systems teaches the AC load flow (in Retake, "T3_02b-PS transmission_2023.pdf" and the Matpower introduction), and Group project: optimizing power system operation holds my group's report, whose chapter 3 is the load flow of the 220 kV ring in the last worked example. Power System Analysis, my FTN course, never names the model but teaches what it rests on: in Textbook and lectures, the four lectures on power system control open with the Pθ and QV couplings (the angle moves active power, the voltage reactive), and "Glava 5 - Tokovi snaga.pdf" is the Newton-Raphson power flow, the AC method this page checks DC against.

Andrija T. Sarić taught it in three courses, whose lectures are on the site as text in Serbian. In Power System Analysis, Lectures, lecture 03, Proračun tokova snaga: the model beside the AC methods, the flows through the incidence matrix, and why it can say nothing about voltages. In Power System Operation, Lectures, lectures 07 and 08, Sigurnost EES, faktori raspodele: the shift factors aℓia_\ell^i, the outage factors dℓkd_\ell^k by the matrix inversion lemma, and a generator and a line lost together; lecture 13, Optimalni tokovi snaga, the DC model inside the optimal power flow, for security and for the price at each bus; and Static security: a MATLAB program, which runs the DC model's base flows, shift factors and line outages on the IEEE 14-bus system. In Power System Planning, Lectures, lectures 05 and 06, Planiranje prenosnih mreža: the model and its factors for checking a planned network. Also in the Classroom: the topic, every course and page on power flow in one place, and the calculator Tokovi snaga, the AC power flow of a network you type in, each iteration written out.

Further reading

References

  • G. W. Stagg, A. H. El-Abiad, Computer Methods in Power System Analysis, McGraw-Hill, 1968
  • A. J. Wood, B. F. Wollenberg, G. B. Sheblé, Power Generation, Operation, and Control, 3rd ed., Wiley, 2013
  • B. Stott, J. Jardim, O. Alsaç, “DC Power Flow Revisited”, IEEE Transactions on Power Systems, 24(3), 2009
  • B. Stott, O. Alsaç, “Fast Decoupled Load Flow”, IEEE Transactions on Power Apparatus and Systems, 93(3), 1974
  • K. Purchala, L. Meeus, D. Van Dommelen, R. Belmans, “Usefulness of DC power flow for active power flow analysis”, IEEE PES General Meeting, 2005
  • T. J. Overbye, X. Cheng, Y. Sun, “A comparison of the AC and DC power flow models for LMP calculations”, 37th Hawaii International Conference on System Sciences, 2004
  • J. Guo, Y. Fu, Z. Li, M. Shahidehpour, “Direct Calculation of Line Outage Distribution Factors”, IEEE Transactions on Power Systems, 24(3), 2009
  • H. Ronellenfitsch, M. Timme, D. Witthaut, “A Dual Method for Computing Power Transfer Distribution Factors”, IEEE Transactions on Power Systems, 2016, doi:10.1109/TPWRS.2016.2589464
  • D. Kirschen, G. Strbac, Fundamentals of Power System Economics, 2nd ed., Wiley, 2018
  • J. D. Glover, T. J. Overbye, M. S. Sarma, Power System Analysis and Design, 6th ed., Cengage, 2017