Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

Optimal Power Flow (DC-OPF and AC-OPF)

DTU Summer School 2017

Spyros Chatzivasileiadis
What is optimal power flow?

2 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Optimal Power Flow (OPF)
• In its most realistic form, the OPF is a non-linear, non-convex problem,
which includes both binary and continuous variables.
• Goal: minimize an objective function, respecting all physical, operational,
and technical constraints, such as:
• Ohm’s law and Kirchhoff laws
• Operational limits of generators
• Loading limits of transmission lines
• Voltage levels
• and many, many others

• Disclaimer:
• Realistic OPF implementations include thousands of variables and
constraints
• Here we focus on the most “fundamental” formulations of OPF
• These can be extended with several additional constraints to
accurately model the problem and/or system at hand
3 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Use of OPF in the industry
• RTE, France: they invented the OPF! (Carpentier,
1962)
• Their focus is mostly on the optimization of the
system operation and not so much on markets
• They are working on the application of convex
relaxations of OPF on their system (see Dan
Molzahn’s talk!)

• CAISO, California, USA


• Electricity markets: An OPF runs every day
(Day-Ahead), every hour, every 15 minutes, and
every 5 minutes.
• Depending on the problem they run a DC-OPF
with unit commitment, a standard DC-OPF, or
just Economic Dispatch

4 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Use of OPF in the industry

• PJM, East Coast, USA


• Security-Constrained Economic Dispatch every 5 minutes
• final test phase of optimal voltage control every 5 minutes (they use
AC-OPF as well)

• EUPHEMIA
• one common algorithm to calculate electricity prices across Europe, and
allocate cross border capacity on a day-ahead basis
• 19 European countries, over 150 million EUR in matched trades daily

• PLEXOS
• June 2000: PLEXOS was first-to-market with electric power market
simulation based entirely on mathematical programming
• Features: generation capacity expansion planning, transmission expansion
planning, hydro-thermal coordination, ancillary services

5 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Summarizing
• DC-OPF
• market clearing uses DC-OPF (at the moment)
• convex
• can solve fast; can be applied in very large problems

• AC-OPF
• primarily used for optimization of operation and control actions
• non-convex (in its original form)
• continuous efforts to decrease computation time and increase system
size
• Trends
• Incorporating uncertainty
• Decomposition (and other) methods to solve very large problems
• Guarantees for a global minimum (convex relaxations)
• Market design
• Coupled energy networks and markets, e.g. gas and electricity

6 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Outline

• Economic Dispatch

• DC-OPF

• AC-OPF

7 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Outline
• Economic Dispatch
• used in power exchanges, e.g. EPEX, etc.
• Supply must meet demand
• Generator limits

8 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Outline
• Economic Dispatch
• used in power exchanges, e.g. EPEX, etc.
• Supply must meet demand
• Generator limits

• DC-OPF
• extends Economic Dispatch
• considers the power flows! (in a linearized form)
• includes the power flow limits of the lines
• only active power; no losses

8 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Outline
• Economic Dispatch
• used in power exchanges, e.g. EPEX, etc.
• Supply must meet demand
• Generator limits

• DC-OPF
• extends Economic Dispatch
• considers the power flows! (in a linearized form)
• includes the power flow limits of the lines
• only active power; no losses

• AC-OPF
• full AC power flow equations
• active and reactive power flow
• current, voltage
• losses

8 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Economic Dispatch

min c i P Gi
i

subject to:

PGmin ≤ PGi ≤ PGmax


i
∑ i

PGi = PD
i

9 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Economic Dispatch

min c i P Gi
i

subject to:

PGmin ≤ PGi ≤ PGmax


i
∑ i

PGi = PD
i

• The Economic Dispatch does not consider any network flows or network
constraints!

9 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Economic Dispatch

min c i P Gi
i

subject to:

PGmin ≤ PGi ≤ PGmax


i
∑ i

PGi = PD
i

• The Economic Dispatch does not consider any network flows or network
constraints!

• We assume a copperplate network, i.e. a lossless and unrestricted flow of


electricity from A to B.

9 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Can we solve the economic dispatch problem without using an
optimization solver?

10 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Can we solve the economic dispatch problem without using an
optimization solver?

Yes! With the help of the merit order curve.

10 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
The Merit-Order Curve

price

cG4
max
A = PG1
cG3
max
B = A + PG2
max
C = B + PG3
cG2
max
D = C + PG4
cG1

0 A B C D power

11 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
The Merit-Order Curve

price

cG4
max
A = PG1
cG3
max
B = A + PG2
max
C = B + PG3
cG2
max
D = C + PG4
cG1

0 A B C D power
PD

11 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
The Merit-Order Curve
• cG3 is the system
marginal price
price
• Gens G1 and G2
cG4
are fully
cG3 dispatched

• Gen G4 is not
dispatched at all
cG2
• Gen G3 is partially
cG1 dispatched
• G3 is the
0 A B C D power
PD “marginal
generator”

12 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
The Merit-Order Curve: An Example

Merit-Order of the German conventional generation in 2008. Source:


Forschungsstelle für Energiewirtschaft e. V.

13 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Merit-Order Curve, Marginal Generators,
and Line Congestion
• Although G3 has
price enough capacity,
it cannot produce
cG4 enough to cover
cG3
the demand due
to line congestion

• Instead G4, a
cG2 more expensive
gen that does not
cG1
contribute to the
line congestion,
0 A B C D power must produce the
PD
missing power

• In a DC-OPF context, there is no longer a single system marginal price


(we will observe different nodal prices Optimal
14 DTU Electrical Engineering
in different nodes)
Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
DC-OPF

min c i P Gi
i

subject to:
PGmin
i
≤ PGi ≤ PGmax
i

15 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
DC-OPF

min c i P Gi
i

subject to:
PGmin
i
≤ PGi ≤ PGmax
i

B · θ = PG − PD
1
(θi − θj ) ≤ Pij,max
xij

15 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
DC-OPF

min c i P Gi
i

subject to:
PGmin
i
≤ PGi ≤ PGmax
i

B · θ = PG − PD
1
(θi − θj ) ≤ Pij,max
xij

• The DC-OPF with the standard power flow equations contains both the
power generation PG and the voltage angles θ in the vector of the
optimization variables.

15 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Exercise
cG1 = 60 $/MWh, cG2 = 120 $/MWh

Pload = 150 MW

1 2 max = 100 MW, P max = 200 MW


PG1 G2

X12 = 0.1 pu, X13 = 0.3 pu, X23 = 0.1


pu, BaseMVA = 100 MVA
max = 40 M W (line limit)
P13

3
1 What are the optimization variables? Form
the optimization vector

2 Formulate the objective function

3 Formulate the constraints

16 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
DC-OPF in Matlab

How would you transfer your


problem formulation to Matlab?

17 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Discussion Points
• sin δ ≈ δ
• δ is in rad!

18 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Discussion Points
• sin δ ≈ δ
• δ is in rad!
•B·θ =P
• B is in p.u.
• θ is in rad, ⇒ dimensionless
• P must be in p.u.

18 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Discussion Points
• sin δ ≈ δ
• δ is in rad!
•B·θ =P
• B is in p.u.
• θ is in rad, ⇒ dimensionless
• P must be in p.u.

• Bus Admittance Matrix B in DC-OPF


• bij = x1ij ⇒ positive
• all off-diagonal elements are non-positive (zero or negative)
• all diagonal elements are positive
• AC-OPF: This differs from the case where zij = rij + jxij . In that
case, it is yij = gij + jbij with bij is negative.

18 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Discussion Points
• sin δ ≈ δ
• δ is in rad!
•B·θ =P
• B is in p.u.
• θ is in rad, ⇒ dimensionless
• P must be in p.u.

• Bus Admittance Matrix B in DC-OPF


• bij = x1ij ⇒ positive
• all off-diagonal elements are non-positive (zero or negative)
• all diagonal elements are positive
• AC-OPF: This differs from the case where zij = rij + jxij . In that
case, it is yij = gij + jbij with bij is negative.
• If the DC-OPF does not converge, check that the admittance matrix B is
correct!
18 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
4-slide “break”
DC-OPF: linear program = convex

AC-OPF: non-linear non-convex problem in its original form


⇒ recent efforts to convexify the problem
Why?

19 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Convex vs. Non-convex Problem

Convex Problem Non-convex problem


Cost f (x)
f (x) Cost

x x
One global minimum Several local minima

20 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Several local minima: So what?
Example: Optimal Power Flow Problem
• Assume that the difference in the
cost function of a local minimum
versus a global minimum is 5%
f (x)
• The total electric energy cost in Cost
the US is ≈ 400 Billion$/year

• 5% amounts to 20 billion US$ in


economic losses per year

• Even 1% difference is huge

• Convex problems guarantee that x


we find a global minimum ⇒
convexify the OPF problem

21 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Convexifying the Optimal Power Flow problem
(OPF)

f (x)
Cost
• Convex relaxations transform the
OPF to a convex Semi-Definite
Program (SDP)

Convex Relaxation

1 Javad Lavaei and Steven H Low. “Zero duality gap in optimal power flow problem”. In:

IEEE Transactions on Power Systems 27.1 (2012), pp. 92–107


22 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Convexifying the Optimal Power Flow problem
(OPF)

f (x)
Cost f˜(x)
• Convex relaxations transform the
OPF to a convex Semi-Definite
Program (SDP)

Convex Relaxation

1 Javad Lavaei and Steven H Low. “Zero duality gap in optimal power flow problem”. In:

IEEE Transactions on Power Systems 27.1 (2012), pp. 92–107


22 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Convexifying the Optimal Power Flow problem
(OPF)

f (x)
Cost f˜(x)
• Convex relaxations transform the
OPF to a convex Semi-Definite
Program (SDP)

• Under certain conditions, the


obtained solution is the global
optimum to the original OPF
problem1 x

Convex Relaxation

1 Javad Lavaei and Steven H Low. “Zero duality gap in optimal power flow problem”. In:

IEEE Transactions on Power Systems 27.1 (2012), pp. 92–107


22 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Break is over... More in Dan Molzahn’s lecture tomorrow!

23 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC-OPF
• Minimize

• subject to:

24 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC-OPF
• Minimize

Costs, Line Losses, other?

• subject to:

24 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC-OPF
• Minimize

Costs, Line Losses, other?

• subject to:

AC Power Flow equations


Line Flow Constraints
Generator Active Power Limits
Generator Reactive Power Limits
Voltage Magnitude Limits
(Voltage Angle limits to improve solvability)
(maybe other equipment constraints)

24 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC-OPF
• Minimize

Costs, Line Losses, other?

• subject to:

AC Power Flow equations


Line Flow Constraints
Line Current Limits
Generator Active Power Limits
Apparent Power Flow limits
Generator Reactive Power Limits
Voltage Magnitude Limits Active Power Flow limits

(Voltage Angle limits to improve solvability)


(maybe other equipment constraints)

• Optimization vector: [P Q V θ]T


24 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC-OPF2
obj.function min cT PG
∗ ∗
AC flow SG − SL = diag(V )Y bus V
Line Current |Y line,i→j V | ≤ Iline,max
|Y line,j→i V | ≤ Iline,max
∗ ∗
or Apparent Flow |V i Y line,i→j,i-row V | ≤ Si→j,max
∗ ∗
|V j Y line,j→i,j-row V | ≤ Sj→i,max
Gen. Active Power 0 ≤ PG ≤ PG,max
Gen. Reactive Power − QG,max ≤ QG ≤ QG,max
Voltage Magnitude Vmin ≤ V ≤ Vmax
Voltage Magnitude Vmin ≤ V ≤ Vmax
Voltage Angle θmin ≤ θ ≤ θmax
2 All shown variables are vectors or matrices. The bar above a variable denotes complex

numbers. (·)∗ denotes the complex conjugate. To simplify notation, the bar denoting a complex
number is dropped in the following slides. Attention! The current flow constraints are defined as
vectors, i.e. for all lines. The apparent power line constraints are defined per line.
25 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Current flow along a line

Vi Vj
It is:
1
Rij + jXij yij =
Rij + jXij
jBij jBij
Bij
2 2 ysh,i = j + other shunt
2
elements connected to that bus

π-model of the line

26 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Current flow along a line

Vi Vj
It is:
1
Rij + jXij yij =
Rij + jXij
jBij jBij
Bij
2 2 ysh,i = j + other shunt
2
elements connected to that bus

π-model of the line


[ ]
[ ] Vi
i→j: Ii→j = ysh,i Vi + yij (Vi − Vj ) ⇒ Ii→j = ysh,i + yij −yij
Vj

26 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Current flow along a line

Vi Vj
It is:
1
Rij + jXij yij =
Rij + jXij
jBij jBij
Bij
2 2 ysh,i = j + other shunt
2
elements connected to that bus

π-model of the line


[ ]
[ ] Vi
i→j: Ii→j = ysh,i Vi + yij (Vi − Vj ) ⇒ Ii→j = ysh,i + yij −yij
Vj
[ ]
[ ] Vi
j→i: Ij→i = ysh,j Vj + yij (Vj − Vi ) ⇒ Ij→i = −yij ysh,j + yij
Vj
26 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Line Admittance Matrix Yline

• Yline is an L × N matrix, where L is the number of lines and N is the


number of nodes

• if row k corresponds to line i − j:


• Yline,ki = ysh,i + yij
• Yline,kj = −yij

1
• yij = is the admittance of line ij
Rij + jXij
• ysh,i is the shunt capacitance jBij /2 of the π-model of the line

• We must create two Yline matrices. One for i → j and one for j → i

27 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Bus Admittance Matrix Ybus

Si = Vi Ii∗

Ii = Iik , where k are all the buses connected to bus i
k

Example: Assume there is a line between nodes i − m, and i − n. It is:

Ii = Iim + Iin
i→m
= (ysh,i + yim )Vi − yim Vm + (ysh,i
i→n
+ yin )Vi − yin Vn
i→m
= (ysh,i i→n
+ yim + ysh,i + yin )Vi − yim Vm − yin Vn

Ii = [ysh,im + yim + ysh,in + yin −yim −yin ][Vi Vm Vn ]T


| {z } | {z } |{z}
Ybus,ii Ybus,im Ybus,in

28 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Bus Admittance Matrix Ybus
• Ybus is an N × N matrix, where N is the number of nodes


• diagonal elements: Ybus,ii = ysh,i + k yik , where k are all the buses
connected to bus i
• off-diagonal elements:
• Ybus,ij = −yij if nodes i and j are connected by a line3
• Ybus,ij = 0 if nodes i and j are not connected

1
• yij = is the admittance of line ij
Rij + jXij
• ysh,i are all shunt elements connected to bus i, including the shunt
capacitance of the π-model of the line
3 If there are more than one lines connecting the same nodes, then they must all be added to

Ybus,ij , Ybus,ii , Ybus,jj .


29 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC Power Flow Equations

Si = Vi Ii∗

= Vi Ybus V∗

For all buses S = [S1 . . . SN ]T :



Sgen − Sload = diag(V )Ybus V∗

30 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
From AC to DC Power Flow Equations
• The power flow along a line is:

Sij = Vi Iij∗ = Vi (ysh,i



Vi∗ + yij∗ (Vi∗ − Vj∗ ))

• Assume a negligible shunt conductance: gsh,ij = 0 ⇒ ysh,i = jbsh,i .


• Given that R << X in transmission systems, for the DC power flow we
1
assume that zij = rij + jxij ≈ jxij . Then yij = −j .
xij

• Assume: Vi = Vi ∠0 and Vj = Vj ∠δ, with δ = θj − θi .

1
Iij∗ = − jbsh,i Vi + j (Vi − (Vj cos δ − jVj sin δ))
xij
1 1 1
= − jbsh,i Vi + j Vi − j Vj cos δ − Vj sin δ
xij xij xij
31 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
From AC to DC Power Flow Equations (cont.)
• Since Vi is a real number, it is:

1
Pij =ℜ{Sij } = Vi ℜ{Iij∗ } = − Vi Vj sin δ
xij

• With δ = θj − θi , it is:

1
Pij = Vi Vj sin(θi − θj )
xij
• We further make the assumptions that:
• Vi , Vj are constant and equal to 1 p.u.
• sin θ ≈ θ, θ must be in rad
Then
1
Pij = (θi − θj )
xij
32 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Some additional points...

• Nodal prices
In a market context, the nodal prices are:
• the lagrangian multipliers of the equality constraints Bθ = P
• of a DC-OPF (at the moment)
• with objective function the minimization of costs

33 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Some additional points...

• Nodal prices
In a market context, the nodal prices are:
• the lagrangian multipliers of the equality constraints Bθ = P
• of a DC-OPF (at the moment)
• with objective function the minimization of costs

• Power Transfer Distribution Factors (PTDFs)


• PTDFs are linear sensitivies that relate the line flows to the power
injections
• the DC-OPF can be formulated with respect to PTDFs
• PTDFs eliminate the need of θ as optimization variable
• In the zonal pricing in Europe PTDFs are used to model the flows
between the zones

33 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
AC-OPF

• Resources about AC-OPF from the US Federal Energy Regulatory


Commission (FERC)

https://www.ferc.gov/industries/electric/indus-act/
market-planning/opf-papers.asp

• Overview paper on Economic Dispatch and DC-OPF:

R.D. Christie, B. F. Wollenberg, I. Wangesteen, Transmission


Management in the Deregulated Environment, Proceedings of the IEEE,
vol. 88, no. 2, February 2000

34 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Wrap-up
DC-OPF AC-OPF
• market clearing uses DC-OPF (at • primarily used for optimization of
the moment) operation and control actions
• convex • full AC power flow equations
• can solve fast; can be applied in but
very large problems
• non-convex (in its original form) →
but no guarantee that we find the
global optimum
• only active power flow
• computationally expensive and
• no losses and no voltage levels
possibly intractable for very large
systems

DC approximations more suitable efforts to decrease computation


for DTU
35 transmission systems
Electrical Engineering
time and increase system size
Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017
Thank you!

spchatz@elektro.dtu.dk

36 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 12, 2017

You might also like