Es 5 Power - Flow
Es 5 Power - Flow
Unless otherwise stated, graphics and text are Copyright ©Tom Brown, 2018-2024. Material for which no other
attribution are given are licensed under a Creative Commons Attribution 4.0 International Licence. cb
Table of Contents
1. Graph Theory
1
Graph Theory
The goal of power flow analysis
2
Definition of a network
More precise definition (Bollobàs): An undirected graph G is an ordered pair of disjoint sets
(V , E ) such that E (the edges) is a subset of the set V (2) of unordered pairs of V (the
vertices).
3
Edge list representation
Vertices:
1,2,3,4,5,6
Edges:
(1,2), (1,3), (1,6), (2,3), (3,4),
(4,5), (4,6)
Definition from graph theory:
4
Adjacency matrix A
(
1 if there is an edge between vertices i and j
Aij =
0 otherwise.
0 1 1 0 0 1
1 0 1 0 0 0
1 1 0 1 0 0
A=
0 0 1 0 1 1
0 0 0 1 0 0
1 0 0 1 0 0
0 1 1 0 0 3
1 0 2 0 0 0
1 2 0 1 0 0
A=
0 0 1 0 1 1
0 0 0 1 0 0
3 0 0 1 0 0
6
Self-edges
7
Weighted networks
0 1.4 0.4 0 0 0.8
1.4 0 1.2 0 0 0
0.4 1.2 0 0.2 0 0
A=
0 0 0.2 0 0.2 0
0 0 0 0.2 0 0
0.8 0 0 0.4 0 0
8
Components of networks
Disconnected network
Subgroups: components
9
Directed Networks (Digraphs)
A graph is directed if each edge is pointing from one vertex to another (directed edge).
(
1 if there is an edge from j to i
Aij =
0 otherwise.
0 0 0 0 0 0
1 0 0 0 0 0
1 1 0 0 0 0
A=
0 0 1 0 0 0
0 0 0 1 0 0
1 0 0 1 0 0
k5 = 1
k2 = k6 = 2
k1 = k3 = k4 = 3
⟨k⟩ = 2.33
11
Examples
12
Source: Network Science (2015) by Albert-László Barabási
Degree matrix D
(
ki if i = j
Dij =
0 otherwise.
13
Laplacian L
−1 −1 −1
3 0 0
−1 2 −1 0 0 0
−1 −1 3 −1 0 0
L=
−1 −1 −1
0 0 3
0 0 0 −1 1 0
−1 0 0 −1 0 2
The columns (and rows) sum to zero, since for each node,
the degree equals the number of adjacent nodes.
The number of eigenvectors with zero eigenvalues equals the number of connected components.
For our connected graph, the single zero eigenvector is (1, 1, . . . 1):
3 −1 −1 −1
1 0 0 1 0
1 −1 2 −1 0 0 0 1 0
1 −1 −1 3 −1 0 0 1 0
L = =
1 0 0 −1 3 −1 −1 1 0
1 0 0 0 −1 1 0 1 0
1 −1 0 0 −1 0 2 1 0
15
Eigenvalues and eigenvectors of Laplacian L
For a graph with two connected components, the Laplacian becomes block diagonal for the
components, since there are no edges linking the components in the adjacency matrix:
1 2
−1 −1
2
−1 2 −1 4
−1 −1 2
L=
2 −1 −1
3
−1 2 −1
−1 −1 2 5 6
Verify that the two zero eigenvectors are (1, 1, 1, 0, 0, 0) and (0, 0, 0, 1, 1, 1) corresponding to
the connected components.
16
The incidence matrix
For a directed graph (every edge has an orientation) G = (V , E ) with N nodes and L edges,
the node-edge incidence matrix K ∈ RN×L has components
1 if edge ℓ starts at node i
Kiℓ = −1 if edge ℓ ends at node i
0 otherwise
1
1 0 0 0
−1 1 1 0 4 3 2
K=
−1 0
0 1
0 0 −1 −1 4 2
3 17
Incidence matrix properties
Let’s verify: X
Lij = Kiℓ Kjℓ
ℓ
For i = j we get X 2
Lii = (Kiℓ )
ℓ
The summands are only non-zero if the line ℓ is attached to i, so we get the degree
Lii = ki
Correct!
For i ̸= j we have X
Lij = Kiℓ Kjℓ
ℓ
If there is no line between i and j, then both sides are zero.
If there is a line between i and j one of Kiℓ and Kjℓ is +1, while the other is −1, so we get
19
Lij = −1. Correct!
The kernel of the incidence matrix
The kernel of Kiℓ , i.e. particular combinations of edges which are annihilated by K , has a very
special meaning.
Consider the combination of edges (0, 1, −1, 1)t
0 1 0 0 0 0 0
1 −1 1 1 0 1 0
K = =
−1 0 −1 0 1 −1 0
1 0 0 −1 −1 1 0
This corresponds to a cycle in the graph. A cycle is a path through the network that returns to
its starting node. Each node in the cycle has an edge that ends there and an edge that starts
there, so is annihilated by K .
20
A cycle
4 3 2
4 2 3
21
Cycle matrix
We can organise the cycles in a matrix Cℓc , where c labels each cycle.
We have
KC = 0
by definition of C being in the kernel.
The image of K has dimension N − 1 (i.e. the rank of K ) for a connected graph, since the
space spanned by the columns of K can only reach differences between nodes and never then
N-length vector (1, 1, . . . 1)t .
By the rank-nullity theorem for K we have
L = dim imK + dim kerK
so the number of cycles, i.e. the dimension of the kernel (nullity) of K is L − N + 1. If the
connected graph has no cycles, i.e. it is a tree, then L = N − 1.
In our case L = 4, N = 4 so there is only 1 cycle
C = (0, 1, −1, 1)t 22
Independent basis of cycles
f1
f4 f2 c1
c2
f5
f3
24
Planar networks
A planar network is a network that can be drawn on a plane without having any edges cross.
Examples:
Trees
25
Computing the Linear Power
Flow
The goal of power flow analysis
26
Framing the load flow problem
Suppose we have N nodes labelled by i, and L edges labelled by ℓ forming a directed graph G .
Suppose at each node we have a power imbalance pi (pi > 0 means its generating more than
it consumes and pi < 0 means it is consuming more than it).
Since we cannot create or destroy energy (and we’re ignoring losses):
X
pi = 0
i
Question: How do the flows fℓ in the network relate to the nodal power imbalances?
Answer: According to the reactances (generalisation of resistance for oscillating
voltage/current) and the corresponding voltages.
27
Ohm’s Law
28
Analogy DC circuits to linear power flow
The equations for DC circuits and linear power flow in AC circuits are analogous:
Vi − Vj θi − θj
I = ↔ fℓ =
R xℓ
The simplifications that lead to the linear power flow will be explained later in the lecture.
29
Kirchhoff’s Current Law (KCL)
KCL inforces energy conservation at each vertex (the power imbalance equals what goes out
minus what comes in).
+12
+5
12
+5 −2
7 3
−5
−7 −3
30
Kirchhoff’s Current Law (KCL)
KCL says (in this linear setting) that the nodal power imbalance at node i is equal to the sum
of direct flows arriving at the node. This can be expressed compactly with the incidence matrix
X
pi = Kiℓ fℓ ∀i
ℓ
P
Only N − 1 of these equations are independent for a connected network, since i Kiℓ = 0.
31
Kirchhoff’s Voltage Law (KVL)
KCL isn’t enough to determine the flow as soon as there are closed cycles in the network. For
this we need Ohm’s law in combination with KVL: voltage differences around each cycle add up
to zero.
+6 ? 0 +6 2 0
? ? −4 2
−6 −6
KVL says that the sum of voltage differences across edges for any closed cycle must add up to
zero.
If the voltage angle at any node is given by θi then the voltage difference across edge ℓ is
X
Kiℓ θi
i
And Kirchhoff’s law can be expressed using the cycle matrix encoding of independent cycles
X X
Cℓc Kiℓ θi = 0 ∀c
ℓ i
33
Kirchhoff’s Voltage Law (KVL)
Physics gives us the expression of the flow fℓ on each line ℓ with reactance xℓ in terms of the
voltage angles at the nodes θi (a relative of V = IR)
θi − θj 1 X
fℓ = = Kiℓ θi (1)
xℓ xℓ
i
[NB: This restricts the L variables fℓ to depend only on the N voltage angles θi . Since the flow
doesn’t change under a constant shift θi → θi + c, we can choose a slack or reference node
such that θ1 = 0, so there are only N − 1 independent variables.]
[NB: Equations (1) and (2) are equivalent and both restrict our L variables fℓ to an N − 1
dimensional subspace.]
34
Solving the equations via the line flows
35
Solving 3-node example
In the 3-node example energy conservation at each vertex (Kirchhoff’s Current Law, KCL) was
not enough information to solve the power flow, since there are multiple paths in the network.
Assume equal reactances xℓ = x on each edge.
+6 ? 0 1 1 2
3 2
? ?
3
−6
P
We have pi = (6, 0, −6). (Check i pi = 0.)
Goal is to find fℓ for ℓ = 1, 2, 3.
36
Solving 3-node example: Kirchhoff’s Current Law (KCL)
1 1 2 So we get:
p1 = 6 = f1 − f3
3 2
p2 = 0 = f2 − f1
3 p3 = −6 = f3 − f2
1 1 2
One formulation of Kirchhoff’s Voltage Law Together with KCL equations we now have 3
gives us L − N + 1 equations for cycles: independent equations for 3 unknowns. Solve:
X
Cℓc xℓ fℓ = 0 ∀c f1 = 2
ℓ
f2 = 2
The cycle matrix C is given by:
f3 = −4
1
Cℓc = 1
1 38
Solving 3-node example: Solution
Solution:
39
Solving the equations via the voltage angles
If we combine
1 X
fℓ = Kiℓ θi (3)
xℓ
i
with Kirchhoff’s Current Law we get
X X 1 X
pi = Kiℓ fℓ = Kiℓ Kjℓ θj
xℓ
ℓ ℓ j
1
This is a weighted Laplacian. If we write Bkℓ for the diagonal matrix with Bℓℓ = xℓ then
L = KBK t
and we get a discrete Poisson equation for the θi sourced by the pi
X
pi = Lij θj
j
P
This is a set of N − 1 sparse linear equations for the θj (N − 1 since i Lij = 0). We can solve
this for the θi and then find the flows using equation (3). Polynomial complexity in N.
40
Solving the equations via the PTDF
If we are repeating the calculation for a fixed network multiple times with different power
injections, it can make sense to do the full matrix inversion.
Given pi at every node, we want to find the flows fℓ . We have the equations
X
pi = Lij θj
j
1 X
fℓ = Kiℓ θi
xℓ
i
There is one small catch: L is not invertible since it has (for a connected network) one zero
P
eigenvalue, with eigenvector (1, 1, . . . 1), since by construction j Lij = 0.
This is related to a gauge freedom to add a constant to all voltage angles
θi → θi + c
42
Inverting Laplacian L
Two solutions:
PN
1. Since θ1 = 0 and p1 is not independent of the other power injections ( i=1 pi = 0 implies
PN
p1 = − i=2 pi ), we can ignore these elements and invert the lower-right (N − 1) × (N − 1)
part of L (which doesn’t have zero eigenvalues) to find the remaining {θi }i=2,...N in terms of
the {pi }i=2,...N .
2. Use the Moore-Penrose pseudo-inverse.
Write L in terms of its basis of orthonormal eigenvectors ein ( j Lij ejn = λn ein , i ein ein = 1
P P
P n m
and i ei ei = 0 if n ̸= m): X
Lij = λn ein ejn
n
then the Moore-Penrose pseudo-inverse is:
1 n n
L†ij =
X
e e
λn i j
n|λn ̸=0
43
Check the Moore-Penrose pseudo-inverse
45
4-node example
+50
0 −1 −1 −1 50
X 0 0 −2/3 −1/3 50
50
PTDFℓi pi =
−1/3 −2/3 0
0 0
i
0 0 1/3 −1/3 −100 -100 66.7 +50
50
33.3
=
33.3 33.3
66.7
33.3 0
46
PTDF as sensitivity
Can also ‘experimentally’ determine the Power Transfer Distribution Factors (PTDF) by
choosing a slack node (in this case node 1).
Each column (labelled by i) is then the resulting line flows if we have a simple power transfer
from node i to the slack pi = 1 and p1 = −1.
1
1
0 −1 −1 −1
0 0 −2/3 −1/3 4 3 2
PTDFℓi =
−1/3 −2/3
0 0
0 0 1/3 −1/3 4 2
47
PTDF as sensitivity: example of 3rd column for node 3
-1
Focus on 3rd column of PTDF and look at
power flow with p3 = +1 and slack p1 = −1. -1
Coefficients determined by resulting flow:
0 -1/3 0
−1
−2/3
PTDFℓ3 =
1/3 -2/3
−1/3
1/3
+1
48
Consequences of Limiting Power
Transfers
Line loading limits
49
Adjusting generator dispatch to avoid overloading
To avoid overloading the power lines, we must adjust our generator output (or the demand) so
that the power imbalances do not overload the network.
We will now generalise and adjust our notation.
From lecture 3 we had for a single node:
where pt was the nodal power balance, mt was the mismatch (load dt minus wind Wwt and
solar Sst ), bt was the backup power and ct was curtailment.
We generalised this to multiple nodes labelled by i
50
Adjusting generator dispatch to avoid overloading
Now we write the dispatch of all generators at node i (wind, solar, backup) labelled by
technology s as gi,s,t (i labels node, s technology and t time) so that we have a relation
between load di,t , generation gi,s,t and network flows fℓ,t
X X
pi,t = gi,s,t − di,t = Kiℓ fℓ,t
s ℓ
Where s runs over the wind, solar and backup capacity generators (e.g. hydro or natural gas)
at the node.
A dispatchable generator’s gi,s,t output can be controlled within the limits of its power capacity
Gi,s
0 ≤ gi,s,t ≤ Gi,s
51
Variable generation constraints
For a renewable generator we have time series of availability 0 ≤ Gi,s,t ≤ 1 (the st and wt
before; W and S are the capacity Gi,s ):
0 ≤ gi,s,t ≤ Gi,s,t Gi,s ≤ Gi,s
Curtailment corresponds to the case where gi,s,t < Gi,s,t Gi,s :
Gi,s
Gi,s,t Gi,s
gi,s,t
52
Germany curtailment example
See https://pypsa.readthedocs.io/en/latest/examples/scigrid-lopf-then-pf.html.
53
European transmission versus backup energy
Transmission lines
Country nodes
54
DE versus EU backup energy from last time
Mismatch [GW]
50
100
0 20 40 60 80
Percentage of time during year
Europe needed backup generation for only 24% of the total load:
400 backup
curtailment
200
Mismatch [GW]
200
400
0 20 40 60 80
55
Percentage of time during year
European transmission versus backup energy
56
Full Power Flow Equations
Goal: Understand the physical origin of these equations
We said we can (in the linear approximation) express the flow fℓ on each line in terms of the
voltage angles θi at the nodes for a line ℓ with reactance xℓ as
θi − θj 1 X
fℓ = = Kiℓ θi
xℓ xℓ
i
V1 −V2
This is a relative of Ohm’s Law in DC circuits, I = R .
Now we explain the physics of where this comes from, and the linear approximation that leads
to it.
This is also useful when we consider the synchronisation of oscillators later.
57
Alternating Current
The majority of electrical power, including what you get out of a wall plug, is transmitted as
Alternating Current (AC), i.e. both the voltage and current are sinusoidal waves.
[Some power is transmitted as Direct Current (DC) under bodies of water and indeed many
electronic devices require DC (must convert AC to DC).]
58
Source: Wikipedia
Why alternating current?
Battle of currents! Edison versus Westinghouse/Tesla in late 1880s, early 1890s, etc.
https://en.wikipedia.org/wiki/War of Currents
AC won, because it’s easy to transform AC to a higher voltage, so you can transmit a given
power P = VI with a lower current and thus avoid the I 2 R resistive losses in power lines.
d
Reason: dt in E = dΦdt ; use a solenoid to induce a fluctuating magnetic field in another
solenoid with a different number of turns, giving different potential difference.
Frequency of 50 Hz is uniform across Europe (except for train-electricity, e.g. in Germany
16.7 Hz). 60 Hz in USA, western half of Japan, etc.
59
Frankfurt: Home of Long-Distance AC Transmission
60
Source: Wikipedia
Sinuisoidal waves
The voltage is usually written in terms of the angular frequency ω = 2πf (radians per second)
rather than frequency f (Hertz) and the Root-Mean-Squared (RMS) voltage magnitude Vrms
√
V (t) = Vpeak sin(ωt) = 2Vrms sin(ωt)
61
Resistive loads
V (t) = RI (t)
√ √
and thus for a voltage of V (t) = 2Vrms e jωt (NB: for engineers j = −1 to avoid confusion
with the current i) we have
√ Vrms jωt 1
I (t) =2 e = V (t)
R R
or in terms of the RMS value and phase shift
1
Irms =Vrms
R
φ=0
62
Resistive loads
In terms of the waveforms, the current has no phase shift from the voltage.
V(t)
0
I(t) = 1R V(t)
time t 63
Capacitive loads
dV (t)
I (t) = C
dt
√
and thus for a voltage of V (t) = 2Vrms e jωt we get
√
I (t) = 2jωCVrms e jωt = jωCV (t)
Irms = ωCVrms
π
φ=−
2
1
We write XC = ωC for the capacitive reactance.
64
Capacitive loads
Current peaks before the voltage (it leads the voltage), since first charge must accumulate on
the plates; once the charge is on the plates, the current drops to zero and the voltage peaks.
V(t)
0
I(t) = C dV
dt
time t
65
Inductive loads
dI (t)
V (t) = L
dt
√
and thus for a voltage of V (t) = 2Vrms e jωt we get
√ Vrms jωt 1
I (t) = 2 e = V (t)
jωL jωL
or in terms of the RMS value and phase shift
1
Irms = Vrms
ωL
π
φ=
2
We write XL = ωL for the inductive reactance, in analogy to the resistance.
66
Inductive loads
Now current peaks after the voltage (it lags the voltage), since the flow of current in the
solenoid resists the changing voltage.
V(t)
I(t) = 1L Vdt
0
time t
67
General loads
General loads will have a combination of resistive, capacitive and inductive parts. For an RLC
circuit in series the voltage across the components is additive
1 t
Z
dI (t)
V (t) = RI (t) + L + I (τ )dτ
dt C −infty
68
Impedances and admittances
A simple model for a transmission line ℓ between nodes i and j is a resistance R in series with
an (inductive) reactance X .
[Typical values are for a 380 kV overhead transmission line e.g. R = 0.03 Ohm/km and
X = 0.3 Ohm/km.]
√
The voltage at each node (compared to ground) is given by Vi (t) = 2Vi e j(ωt+θi ) where θi is
the phase offset for each node and Vi is the RMS voltage magnitude.
Now the current in the transmission line is given by
1 √
1 j(ωt+θi ) Vj j(θj −θi )
I (t) = [Vj (t) − Vi (t)] = 2Vi e e −1
R + jX R + jX Vi
70
Active versus reactive power
Now let’s consider the power injection at the first node. This is simply the voltage there
multiplied by the current in the transmission line.
It’s convenient to eliminate the time-dependent part e jωt by multiplying the voltage with the
complex conjugate of the current
1
S = P + jQ = V (t)I ∗ (t)
2
For a resistive load with V (t) = RI (t) this reproduces the active power P.
For loads where the I (t) is not in phase with the voltage, we get a flow of reactive power Q.
S = P + jQ is called the apparent power.
71
Linearisation: Assumption 1/3
This is the full non-linear equation for the power flow. Now let’s linearise by making some
simplifying assumptions.
1. Assume the voltage magnitudes are the same everywhere in the network Vi = Vj
1 h i
Pi + jQi = Vi2 e j(θi −θj ) − 1
R + jX
This means power flows primarily according to angle differences in this approximation.
72
Linearisation: Assumption 2/3
2. Now assume that the voltage angle differences across the transmission line are small enough
that sin(θi − θj ) ∼ (θi − θj )
1 h i
Pi + jQi = Vi2 e j(θi −θj ) − 1
R + jX
1
∼ V 2 [j(θi − θj )]
R + jX i
This assumption is usually valid, since for stability reasons, we usually have in the transmission
network (θi − θj ) ≤ π6 (30 degrees).
73
Linearisation: Assumption 3/3
Note that ignoring R means that we ignore resistive losses in the transmission lines and also
since Qi ∼ 0, we ignore the flow of reactive power. Finally we absorb the voltage into the
definition of the per unit reactance xℓ = VX2 to get
i
θi − θj
fℓ = Pi = −Pj =
xℓ
74
Three-phase power
In your plug, you only see one phase, but your oven may use all three phases. Source: Wikipedia
75
Three-phase power
for N > 1.
3. Why N = 3 rather than N = 2? Allows directional rotating fields for induction motors
(thanks Tesla!).
76
Roots of unity for N = 3
77
Source: brilliant.org
Rotating field in a three-phase induction motor
A brilliant insight (credited to Tesla, but the history is complicated) was that with three-phase
power, you can place your wires spaced at 2π/3 to create a rotating magnetic field
https://www.youtube.com/watch?v=LtJoJBUSe28
which can then induce a current in a rotor cage, which then experiences a torque thanks to the
magnetic field: this is the principle of the induction motor.
It would not be possible to create such a rotating field with a single-phase or two-phase system.
78
Three-phase power
79
Source: Wikipedia