Professional Documents
Culture Documents
to Optimal
Power Flow
Outline
• Introduction to the optimal power flow problem
Motivation
Basic formulation
Challenges and solution techniques
• Security constrained optimal power flow
DC formulation
Solution by relaxation
Examples
Motivation
l
• Recall the economic dispatch problem F min Ci gi
i 1
l
Subject to: g
i 1
i d dloss 0
Subject to:
G u, x, y 0
H u, x, y 0
f(.) is the objective function
Any Examples?
G(.) represents the constraints imposed by the network power flow
H(.) represents all other constraints imposed on control and state variables
• Any examples on constraints on control variables?
• Any examples on constraints on state variables?
Other Choices for OPF: Minimum Losses
min (Pg Pd )
Pg ,V pv ,t
• Equivalent to minimizing the net system active power injection
• Pg , Vpv and t are control variables
• Vpq and θ are state variables
• Pd , Qd are parameters
• H(.) includes restrictions on voltage, line flows, active/reactive power generations
Other Choices for OPF: SCOPF
min f(Pg (0), y(0))
Pg (k),V (k),t
Subject to: (for k = 0,1,…K)
Pg (k) Pd (k) G p (t, V(k), (k), y(k)) 0
Qg (k) Qd (k) Gq (t, V(k), (k), y(k)) 0
H (Pg (k), Qg (k), V(k), (k), y(k)) 0
• Minimizing system pre‐contingency generation cost f(Pg (0), y(0)) using active/reactive
dispatch and tap/phase changers such that
Active and reactive power will balance in both pre (k = 0) and post (k = 1… K)
contingency conditions
All generation and network limits are met under pre and post contingency conditions
• Contingency conditions are modelled through the parameters y(k)
Other Choices for OPF: Max. power transfer
min
, Pg ,V pv ,t
Subject to Pg Pd B / 0
H (Pg , , y) 0
Subject to: (for k = 0,1,…K)
Pg (k) Pd (k) G p (V(k), (k), k) 0
Qg (k) Qd (k) Gq (V(k), (k), k) 0
H (Pg (k), Qg (k), V(k), (k), k) 0
Subject to: (for k = 0,1,…K)
Pg (k) Pd (k) B / (k) (k) 0
C (k) (k) f max 0
C (k) (k) f min 0
H (Pg (k), k) 0
r (k) 0
• Minimize the pre‐contingency generation dispatch cost subject to
Active power balance at every bus
Line flow limits (sending and receiving)
All other generation dispatch constraints
Fix the reference bus angle to zero
For all pre and post contingency scenarios (k = 0,1, … K )
Solution by relaxation
Basic procedure
• Solve an economic dispatch ignoring network constraints and
contingent states
• Calculate the line flows in the intact network using a DC power flow
• Correct line flow violations in the intact network one‐by‐one by re‐
dispatching generators in the most economic way
• Correct post‐contingency security violations one‐by‐one by re‐
dispatching generators in the most economic way
Fundamental principle: Use pre‐calculated linear shift factors to model
the effects of the changes in generation and network topology on all
line flows
Generation Shift Factors (GSF)
Definition
A generation shift factor ℎ is the ratio of the power flow in line 𝑙 with respect to
the power injection at bus 𝑖. Mathematically, we have
∆𝑓
ℎ
∆𝑃
Out of necessity imposed by the power balance requirement, the change in
generation to be compensated by an equal and opposite change in generation at
the reference bus.
In the limit as ∆𝑃 → 0, we have
𝜕𝑓
ℎ
𝜕𝑃
Generation shift factors ‐ Usage
• The goal is to determine how changes in the generation pattern can
lead to changes in the network pattern
• For example, what would happen to the flow in line 𝑙 if the
generation at bus 𝑖 were suddenly disconnected?
Assume that the lost generation is picked up by the generation at the
reference bus
If the generator was originally providing 𝑃 , then the change in injection as
bus 𝑖 is ∆𝑃 𝑃
The resulting flow in any line 𝑙 would then be
𝑓 𝑓 ℎ ∆𝑃 𝑓 ℎ 𝑃
where 𝑓 are the pre‐outage line flows in lines 𝑙 = 1,2, … L
Generation shift factors ‐ Usage
• In general, when the impact of simultaneous shifts in generation all buses
are considered,
𝑓 𝑓 ℎ ∆𝑃
• We note that ∆𝑃 ∑ ∆𝑃 and ℎ 0
• In vector matrix notation, 𝐟 𝐟𝟎 𝐇∆𝐏
• Recall that, ℎ 𝑏 𝑋 𝑋
𝐟
• In matrix form, 𝐇 𝑪𝜽 𝑪𝑿
𝐏 𝐏
where we recall that 𝐟 𝑪𝜽 and 𝑪 𝑑𝑖𝑎𝑔 𝒃 𝑨
Line Outage Distribution Factors
Definition
The line outage distribution factor 𝑑 | is the ration of the change in
flow in line 𝑙 following the outage of line k (∆f ) to the pre‐outage flow
in the line k (f )
∆f
𝑑|
f
Hence, if the line flows on lines 𝑙 and k are known (f and f ), the post‐
contingency flow on line 𝑙 following the failure of line k is
𝑓 𝑓 𝑑| f
Line Outage Distribution Factors: Usage
Line outage distribution factors have two main uses
• Rapidly detect post outage line flow violations
No need to form matrices B’(k) and C(k) for each contingency k = 1,…K
The information provided by the pre‐outage case k = 0 is enough
No need to recalculate (B’)‐1 for each contingency
• Form “compensated generation shift factors” used in determining
marginal flow contributions of generators on remaining lines when a
line in out of service
Will be later used to compute optimal generation dispatch
corrections in making system secure from overloads.
Line Outage Distribution Factors: Modeling
There are two ways of modeling line outages
• Calculate matrices B’(k) and C(k) for each line outage (k=1,…,K) and
solve for the corresponding power flow solutions
Tedious and time consuming
• Mimic the fact that no power flows on an outaged line using artificial
power injections at both its ends
No need to drop the line from the various healthy network representations
and compute k‐versions of them.
Which one to choose?
Line Outage Distribution Factors: Modeling
Model outage of line k (linking bus n and bus m)
using artificial power injections
• Pre‐outage, non‐zero fk = Pnm is flowing
Line Outage Distribution Factors: Modeling
Model outage of line k using artificial power
injections
• Post‐outage, CBs interrupt power flow such
that 𝑃nm = 0
• As CBs operate, the topology of the
network changes
• Line k is completely isolated from the rest
of the network and no current flows
through the CBs
Line Outage Distribution Factors: Modeling
Pn
Model outage of line k using artificial power
injections
• Injecting the appropriate equal and
opposite power at buses n and m, can
Pnm mimic network conditions with line k on
outage
𝑃
• If ΔPn = ‐ ΔPm = there is still no
current flowing through the CBs even
though they are closed
• From the network’s point of view it is as if
the line is disconnected
Pm
Line Outage Distribution Factors: Modeling
By injecting ΔPn and ΔPm , we have
∆𝜃 𝑋 ∆𝑃 𝑋 ∆𝑃
∆𝜃 𝑋 ∆𝑃 𝑋 ∆𝑃
Hence, by superposition, the post‐contingency flow 𝑃 is the sum of the pre‐
contingency flow Pnm and those created by the injections ΔPn and ΔPm
𝑃nm 𝑃 𝑏 ∆𝜃 ∆𝜃
𝑃 𝑏 𝑋 𝑋 2𝑋 ∆𝑃
∆𝑃 𝑃 1 𝑏 𝑋 𝑋 2𝑋
Line Outage Distribution Factors: Modeling
We consider four separate cases
Buses n and m are not the reference buses
Bus n is the reference bus
Bus m is the reference bus
Bus i is the reference bus (trivial case ∅ | = 0)
Line Outage Distribution Factors: Modeling
When buses m and n are not the reference buses
i
i | nm
Pnm
X in Pn X im Pm
Pnm
Pn
( X in X im )
Pnm
( X in X im )
1 bk (X nn X mm 2 X nm )
Line Outage Distribution Factors: Modeling
Other two cases
When bus n is the reference When bus m is the reference
i
i | nm
Pnm i
i | nm
X im Pm Pnm
X in Pn
Pnm
Pnm
Pn
X im X in
Pnm
1 bk X nn
X im
1 bk X mm
Line Outage Distribution Factors: Calculation
We recall the definition of line outage distribution factor 𝑑 | applicable to line 𝑙 (linking
buses i and j) when line k is out
f l bl (i j )
d l |k 0
fk f k0
i j
bl
Pnm
bl ( i | nm j | nm )
For the special case where neither i nor j is the reference bus
X in X im X jn X jm
d l | k bl
1 bk (X nn X mm 2 X nm )
Compensated Generation Shift Factors
What if we want to know the impact on the flow in line l when modify
the generation at bus i when line k is opened?
The flow in line l is influenced by the change in injection at i, ΔPi
Directly through hli
Indirectly through the power flowing in line k, which affects the flow in i
when it is out
That is
fl hli Pi d l | k f k
f k hki Pi
But since , we get
f l (hli d l | k hki )Pi
Compensated Generation Shift Factors
Definition
𝜓 |
The compensated generation shift factor is the sensitivity of the
flow in line l to changes in power injection at bus i under the outage of
line k
f l
l i|k hli d l | k hki
Pi k
Application: Optimal correction of generation dispatches to avoid post‐
outage overloads
Example: 3‐bus, 4‐line Network
Line data (Sbase = 100 MVA)
Line no, l bl (p u) fl max (MW)
1 5 100
2 5 100
3 5 60
4 5 80
Generator data
Gen no. gi min (MW) gi max (MW) Ci ($/MWh)
1 100 250 20
2 20 100 40
3 0 50 50 What is the most economic N‐1 secure
dispatch assuming we approximate the
network with a DC power flow?
Solution‐ Relaxation Approach
• Handling the full mathematical program corresponding to this OPF
would not be simple
• Solving a relaxation of an OPF requires solving the same OPF while
ignoring some of the complicating aspects (constraints) of the original
problem
Solution‐ Relaxation Approach
The basic procedure:
• Solve an economic dispatch ignoring network constraints and
contingent states
• Calculate the line flows in the intact network using a DC power flow
• Correct line flow violations in the intact network by redispatching
generators in the most economic way
• Correct post‐contingency security violations by redispatching
generators in the most economic way
Solution‐ Relaxation Approach
• Solve an economic dispatch ignoring network constraints and
contingent states
min F = 20g1 + 40g2 + 50g3
subject to
g1 + g2 + g3 = 250 = Pdem
g1 100
gi min (MW) gi max (MW)
‐g1 ‐250
g2 20 100 250
‐g2 ‐100 20 100
g3 0 0 50
‐g3 ‐50
Solution‐ Relaxation Approach
• Solve an economic dispatch ignoring network constraints and
contingent states
Since generator 1 is the cheapest
we maximize its output
By inspection, we get
g1[0] = 230 MW
g2[0] = 20 MW
g3[0] = 0 MW
F[0] = 5400 $/h
In the g2‐g3 plane we only have
upper/ lower generation limits
Solution‐ Relaxation Approach
• Calculate the line flows in the intact network using a DC power flow
By inspection, B’ and C matrices are
5 5 0
15 10 5 5
5 0
B ' 10 15 5 C
5 0 5
5 5 10
0 5 5
Assigning Bus 1 as the reference bus, the X and H matrices are
0 0.4 0.2
0 0 0 0 0.4 0.2
X 0 0.08 0.04 H
0 0.2 0.6
0 0.04 0.12
0 0.2 0.4
Solution‐ Relaxation Approach
• Calculate the line flows in the intact network using a DC power flow
The bus voltage angles corresponding to the economic dispatch are
0 0 0 2.3 0
0 XP 0 0 0.08 0.04 1.8 0.164
0 0.04 0.12 0.5 0.132
The corresponding line flows are
0 0.4 0.2 82
0 0.4 2.3
0.2 1.8 82
f = C HP 100
0 0 0
66
0 0.2 0.6
0.5
0 0.2 0.4 16
Solution‐ Relaxation Approach
• Calculate the line flows in the intact network using a DC power flow
Line 3 is overloaded!
How can we mitigate this
overload ?
We will redispatch the generation
ensuring that f3 60 MW
In other words, we will “tighten”
the relaxation
Solution‐ Relaxation Approach
• Correct the line flow violations in the intact network by redispatching generations
in the most economic way
How do we tighten the relaxation to impose f3 60 MW ?
o We determine the effect of redispatching on f3 through generation shift factors h3i
f 3 f 3[0] h31P1 h32 P2 h33 P3
70 0.2g 2 0.6g3 60
o We append the constraint to relieve flow limit violation in line 3
Solution‐ Relaxation Approach
• Correct the line flow violations in the intact network by redispatching generations
in the most economic way
The tighter version of the economic dispatch is
min F = 20g1 + 40g2 + 50g3
subject to
2g2 + 6g3 100
g1 + g2 + g3 = 250 = Pdem
g1 100
‐g1 ‐250
g2 20
‐g2 ‐100
g3 0
‐g3 ‐50
Solution‐ Relaxation Approach
• Correct the line flow violations in the intact network by redispatching
generations in the most economic way
In the g2‐g3 plane, we see
o Upper/lower generation limits
o The flow limit on line 3 cutting off
the previous solution
Which generator should we use to
relieve this overload?
Generator Rate of g2 (MW) g3 (MW) Cost of line
providing line relief relief ($/h)
relief (MW/MW)
2 ‐0.2 50 0 600
3 ‐0.6 20 10 300
Solution‐ Relaxation Approach
• Correct the line flow violations in the intact network by redispatching
generations in the most economic way
We choose the cheaper option
where generator 3 provides relief
The optimal dispatch is now
g1[1] = 220 MW
g2[1] = 20 MW
g3[1] = 10 MW
F[1] = 5700 $/h
Solution‐ Relaxation Approach
• Correct the line flow violations in the intact network by redispatching
generations in the most economic way
Verify that this dispatch meets all line
flow limits
Indeed!
What is cost of imposing the line
flow limits?
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching generations in
the most economic way
We perform N‐1 security analysis
Take lines out one at a time and evaluate corresponding impacts on remaining
lines
Can we do so without recalculating everything ?
Yes! Using line outage distribution factors, dl|k
Starting with line 1, we find the immediate impact of losing this line using the
factors dl|k for K =1 and l = 2, 3, 4
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching generations in
the most economic way
First we get for buses i = 1, 2, 3 and n =1 and m=2, the values of 𝜑 |
1|12 0
X 22
2|12 0.1333
1 b1 X 22
X 32
3|12 0.0667
1 b1 X 22
And then the line outage distribution factors dl|1 , l = 2, 3, 4
d 2|1 b2 (1|12 2|12 ) 0.6667
d3|1 b3 (1|12 3|12 ) 0.3333
d 4|1 b4 (2|12 4|12 ) 0.3333
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
We then find flows associated to the
failure of line k = 1 (or equally k =2)
For example, in l = 2 (or equally l =1)
f 2|1 f 2[1] d 2|1f1[1]
80 0.6667x 80
=133.3 MW > f 2max
Similarly, for in l = 3 and 4
where is the flow on line l
f| after the failure of line k prior to redispatching
Solution‐ Relaxation Approach
The outage of line k =1 (or k =2), implies two flow violations. One on l = 2
(l =1) and the other on l = 3
Starting with k = 1 and l =2 , we have
2 i |1
So, we need to calculate the values of for i = 1, 2, and 3
By inspection, we get
2 1
21|1 0 22|1 23|1
3 3
Solution‐ Relaxation Approach
Hence, with k =1 and l =2 ,we have
2 1
f̂ 2 133.33 (g 2 20) (g 3 10)
3 3
Limiting the line flow to 100 MW and simplifying, we obtain
2 g 2 g3 150
What next?
We add this constraint to the original economic dispatch along with
the constraint limiting the pre‐fault flow on line 3
Solution‐ Relaxation Approach
That is min F = 20g1 + 40g2 + 50g3
subject to
2g2 + g3 ≥ 150
2g2 + 6g3 ≥ 100
g1 + g2 + g3 = 250
g1 ≥ 100
‐g1 ≥ ‐250
g2 ≥ 20
‐g2 ≥ ‐100
g3 ≥ 0
‐g3 ≥ ‐50
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
The “tighter” optimal dispatch is now
g1[2] = 175 MW
g2[2] = 75 MW
g3[2] = 0 MW
F[2] = 6500 $/h
Verify that the pre‐fault limits are satisfied
Is the l =2 post‐fault flow due to the failure
of line k =1 within limits?
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
Now looking at the effect of the failure of line k =1 (or k =2 ), on line l = 3
Limiting the post‐fault flow to 60 MW thus requires
g 2 2 g3 120
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
min F = 20g1 + 40g2 + 50g3
subject to
g2 + 2g3 ≥ 120
2g2 + g3 ≥ 150
2g2 + 6g3 ≥ 100
g1 + g2 + g3 = 250
g1 ≥ 100
‐g1 ≥ ‐250
g2 ≥ 20
‐g2 ≥ ‐100
g3 ≥ 0
‐g3 ≥ ‐50
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
Another “tighter” optimal dispatch is now
g1[3] = 160 MW
g2[3] = 60 MW
g3[3] = 30 MW
F[3] = 7100 $/h
Verify that the pre‐fault limits are
satisfied
Is the l =3 post‐fault flow due to the
failure of line k =1 (k =2) within limits?
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
We calculate the values of for i
𝜓 | = 1, 2, and 3
By inspection, we get
1 1
11|3 0 12|3 13|3
2 2
Limiting the post‐fault flow to 100 MW thus requires
g 2 g3 50
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
min F = 20g1 + 40g2 + 50g3
subject to
g2 + g3 ≥ 50
g2 + 2g3 ≥ 120
2g2 + g3 ≥ 150
2g2 + 6g3 ≥ 100
g1 + g2 + g3 = 250
g1 ≥ 100
‐g1 ≥ ‐250
g2 ≥ 20
‐g2 ≥ ‐100
g3 ≥ 0
‐g3 ≥ ‐50
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
What is the optimal dispatch here?
It is the same as we found by correcting for the loss of line 1 (or equally 2)!
Constraints on post‐fault flows in line 1 and 2 after the loss of line 3 are
inactive
That is, they are redundant
So is the pre‐fault flow limit on line 3!
Observation
We call the failure of line 1 (or equally 2) an umbrella contingency
because it covers for other, less stringent, failures
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
Is the final economic dispatch • Pre‐fault limits √
secure with respect to
Pre‐fault line flow limits?
Post‐fault line flow limits?
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
• Post‐fault flows: Loss of line 1 or 2 √
Is the final economic dispatch
secure with respect to
Pre‐fault line flow limits?
Post‐fault line flow limits?
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
• Post‐fault flows: Loss of line 3 √
Is the final economic dispatch
secure with respect to
Pre‐fault line flow limits?
Post‐fault line flow limits?
Solution‐ Relaxation Approach
• Correct post‐contingency security violations by redispatching
generations in the most economic way
• Post‐fault flows: Loss of line 4 √
Is the final economic dispatch
secure with respect to
Pre‐fault line flow limits?
Post‐fault line flow limits?
All limits are met! The algorithm
terminates
What is the cost of security?