Optimal Power Flow (DC-OPF and AC-OPF) DTU Summer School 2018 Spyros Chatzivasileiadis
What is optimal power flow? 2 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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. 3 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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. min s.t. costs, losses,... supply=demand generation limits voltage, line limits, etc. 3 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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. Disclaimer: min s.t. costs, losses,... supply=demand generation limits voltage, line limits, etc. Realistic OPF implementations include thousands of variables and constraints Here we focus on the most fundamental formulations of OPF 3 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Outline Economic Dispatch DC-OPF AC-OPF 4 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Outline Economic Dispatch used in Power Pools and Power Exchanges Supply must meet demand Generator limits 1 M.B.Cain, R. P. O Neill, Anya Castillo, History of Optimal Power Flow and Formulations Optimal Power Flow Paper 1 5 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Outline Economic Dispatch used in Power Pools and Power Exchanges Supply must meet demand Generator limits DC-OPF used in Nodal and Zonal Pricing markets (e.g. US and Europe) considers line limits and the power flows! (linearized) only active power; no losses 1 M.B.Cain, R. P. O Neill, Anya Castillo, History of Optimal Power Flow and Formulations Optimal Power Flow Paper 1 5 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Outline Economic Dispatch used in Power Pools and Power Exchanges Supply must meet demand Generator limits DC-OPF used in Nodal and Zonal Pricing markets (e.g. US and Europe) considers line limits and the power flows! (linearized) only active power; no losses AC-OPF Security-Constrained AC-OPF: ultimate goal for market software 1 not only markets: minimize losses, optimize voltage profile, and others full AC power flow equations active and reactive power flow, current, voltage, losses 1 M.B.Cain, R. P. O Neill, Anya Castillo, History of Optimal Power Flow and Formulations Optimal Power Flow Paper 1 5 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Economic Dispatch Find the cheapest generators that can cover the total demand! How? 6 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Economic Dispatch Find the cheapest generators that can cover the total demand! How? min i c i P Gi subject to: PG min i P Gi P max G i P Gi = P D i The Economic Dispatch does not consider any network flows or network constraints! 6 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Economic Dispatch Find the cheapest generators that can cover the total demand! How? min i c i P Gi subject to: PG min i P Gi P max G i P Gi = P D 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. 6 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Can we solve the economic dispatch problem without using an optimization solver? 7 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Can we solve the economic dispatch problem without using an optimization solver? Yes! With the help of the merit order curve. 7 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
The Merit-Order Curve price c G4 c G3 c G2 c G1 A = P max G1 B = A + P max G2 C = B + P max G3 D = C + P max G4 0 A B C D power 8 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
The Merit-Order Curve price c G4 c G3 c G2 c G1 A = P max G1 B = A + P max G2 C = B + P max G3 D = C + P max G4 0 A B C D P D power 8 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
The Merit-Order Curve price c G4 c G3 c G2 c G1 0 A B C D P D power c G3 is the system marginal price G1 and G2 fully dispatched G4 not dispatched G3 partially dispatched: marginal generator 9 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
The Merit-Order Curve: An Example Merit-Order of the German conventional generation in 2008 Source: Forschungsstelle für Energiewirtschaft e. V. 10 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Line Congestion and Marginal Generators 11 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Line Congestion and Marginal Generators price c G4 c G3 c G2 c G1 0 A B C D P D power Although G3 has enough capacity, it cannot produce enough to cover the demand due to line congestion Instead G4, a more expensive gen, must produce the missing power 11 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Line Congestion and Marginal Generators price c G4 c G3 c G2 c G1 0 A B C D P D power Although G3 has enough capacity, it cannot produce enough to cover the demand due to line congestion Instead G4, a more expensive gen, must produce the missing power In a DC-OPF context, there is no longer a single system marginal price (we will observe different nodal prices in different nodes) 11 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
DC-OPF vs Economic Dispatch What is the difference? 12 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
DC-OPF vs Economic Dispatch What is the difference? DC-OPF includes the line flow constraints! So how do I do that? 12 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
DC-OPF vs Economic Dispatch What is the difference? DC-OPF includes the line flow constraints! So how do I do that? 12 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Linearized power flow equations V i θ i V j θ j x ij simplified model of the line P ij = V iv j x ij sin(θ i θ j ) linearize P ij = 1 x ij (θ i θ j ) 13 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Linearized power flow equations V i θ i V j θ j x ij simplified model of the line P ij = V iv j x ij sin(θ i θ j ) linearize P ij = 1 x ij (θ i θ j ) 1 What are my assumptions for linearizing the power flow? 2 How do I include the line flow constraint in the DC-OPF? 13 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Linearized power flow equations V i θ i V j θ j x ij simplified model of the line P ij = V iv j x ij sin(θ i θ j ) linearize P ij = 1 x ij (θ i θ j ) 1 What are my assumptions for linearizing the power flow? V i = V j = 1p.u and sin(θ i θ j ) θ i θ j 2 How do I include the line flow constraint in the DC-OPF? 13 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
DC-OPF min i c i P Gi subject to: P Gi PG max i 1 (θ i θ j ) x ij P ij,max P min G i The line flow constraints must include both directions! 14 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
DC-OPF min i c i P Gi subject to: P Gi PG max i 1 (θ i θ j ) x ij P ij,max P min G i B θ = P G P D The line flow constraints must include both directions! The DC-OPF with the standard power flow equations contains both the power generation P G and the voltage angles θ in the vector of the optimization variables. 14 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Exercise c G1 = 60 $/MWh, c G2 = 120 $/MWh P load = 150 MW 1 2 3 P max G1 = 100 MW, P max G2 = 200 MW X 12 = 0.1 pu, X 13 = 0.3 pu, X 23 = 0.1 pu, BaseMVA = 100 MVA P max 13 = 40 MW (line limit) 1 What are the optimization variables? Form the optimization vector 2 Formulate the objective function 3 Formulate the constraints 15 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
DC-OPF in Matlab How would you transfer your problem formulation to Matlab? How do you calculate the nodal prices? 16 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Discussion Points sin δ δ δ is in rad! 17 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Discussion Points sin δ δ δ is in rad! B θ = P B is in p.u. θ is in rad, dimensionless P must be in p.u. 17 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 b ij = 1 x ij positive all off-diagonal elements are non-positive (zero or negative) all diagonal elements are positive AC-OPF: This differs from the case where z ij = r ij + jx ij. In that case, it is y ij = g ij + jb ij with b ij is negative. 17 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 b ij = 1 x ij positive all off-diagonal elements are non-positive (zero or negative) all diagonal elements are positive AC-OPF: This differs from the case where z ij = r ij + jx ij. In that case, it is y ij = g ij + jb ij with b ij is negative. If the DC-OPF does not converge, check that the admittance matrix B is correct! 17 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 18 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 18 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 25, 2018
Convex vs. Non-convex Problem Cost Convex Problem f(x) Non-convex problem f(x) Cost x One global minimum Several local minima x 20 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 1% The total electric energy cost in the US is 400 Billion$/year Cost f(x) 1% amounts to 4 billion US$ in economic losses per year Convexifying AC-OPF 1 guarantees that we find a global minimum or 2 at least determines how far we are from the global minimum x 21 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Convexifying the Optimal Power Flow problem (OPF) Convex relaxations transform the OPF to a convex Semi-Definite Program (SDP) Cost f(x) x Convex Relaxation 2 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 25, 2018
Convexifying the Optimal Power Flow problem (OPF) Convex relaxations transform the OPF to a convex Semi-Definite Program (SDP) Cost f(x) f(x) Convex Relaxation x 2 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 25, 2018
Convexifying the Optimal Power Flow problem (OPF) Convex relaxations transform the OPF to a convex Semi-Definite Program (SDP) Cost f(x) f(x) Under certain conditions, the obtained solution is the global optimum to the original OPF problem 2 Convex Relaxation x 2 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 25, 2018
Break is over... More in 1 hour and in Pascal s talk tomorrow! Be patient :) 23 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
AC-OPF Minimize subject to: 24 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
AC-OPF Minimize Costs, Line Losses, other? subject to: 24 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
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 25, 2018
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 Line Current Limits Apparent Power Flow 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 25, 2018
AC-OPF 3 obj.function min c T P G Gen. Active Power Gen. Reactive Power Voltage Magnitude Voltage Magnitude Voltage Angle 0 P G P G,max Q G,max Q G Q G,max V min V V max V min V V max θ min θ θ max 3 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 25, 2018
AC-OPF 3 obj.function min c T P G Line Current or Apparent Flow Gen. Active Power Gen. Reactive Power Voltage Magnitude Voltage Magnitude Voltage Angle Y line,i j V I line,max Y line,j i V I line,max V i Y line,i j,i-rowv S i j,max V j Y line,j i,j-rowv S j i,max 0 P G P G,max Q G,max Q G Q G,max V min V V max V min V V max θ min θ θ max 3 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 25, 2018
AC-OPF 3 obj.function AC flow Line Current or Apparent Flow Gen. Active Power Gen. Reactive Power Voltage Magnitude Voltage Magnitude Voltage Angle min c T P G S G S L = diag(v )Y busv Y line,i j V I line,max Y line,j i V I line,max V i Y line,i j,i-rowv S i j,max V j Y line,j i,j-rowv S j i,max 0 P G P G,max Q G,max Q G Q G,max V min V V max V min V V max θ min θ θ max 3 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 25, 2018
Current flow along a line V i jb ij 2 r ij + jx ij jb ij 2 V j It is: 1 y ij = r ij + jx ij y sh,i = j b ij + 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 25, 2018
Current flow along a line V i jb ij 2 r ij + jx ij jb ij 2 π-model of the line V j It is: 1 y ij = r ij + jx ij y sh,i = j b ij + other shunt 2 elements connected to that bus i j : I i j = y sh,i V i + y ij (V i V j ) I i j = [ ] [ ] V y sh,i + y ij y i ij V j 26 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Current flow along a line V i jb ij 2 r ij + jx ij jb ij 2 π-model of the line V j It is: 1 y ij = r ij + jx ij y sh,i = j b ij + other shunt 2 elements connected to that bus i j : I i j = y sh,i V i + y ij (V i V j ) I i j = [ ] [ ] V y sh,i + y ij y i ij V j j i : I j i = y sh,j V j + y ij (V j V i ) I j i = [ ] [ ] V y ij y sh,j + y i ij V j 26 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Line Admittance Matrix Y line Y line 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: Y line,ki = y sh,i + y ij Y line,kj = y ij y ij = 1 r ij + jx ij is the admittance of line ij y sh,i is the shunt capacitance jb ij /2 of the π-model of the line We must create two Y line matrices. One for i j and one for j i 27 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Bus Admittance Matrix Y bus S i = V i I i I i = k I ik, where k are all the buses connected to bus i Example: Assume there is a line between nodes i m, and i n. It is: I i = I im + I in = (ysh,i i m = (ysh,i i m + y im )V i y im V m + (y i n sh,i + y im + y i n sh,i + y in )V i y in V n + y in )V i y im V m y in V n I i = [y sh,im + y im + y sh,in + y in }{{} Y bus,ii y im }{{} Y bus,im y }{{} in ][V i V m V n ] T Y bus,in 28 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Bus Admittance Matrix Y bus Y bus is an N N matrix, where N is the number of nodes diagonal elements: Y bus,ii = y sh,i + k y ik, where k are all the buses connected to bus i off-diagonal elements: Y bus,ij = y ij if nodes i and j are connected by a line 4 Y bus,ij = 0 if nodes i and j are not connected y ij = 1 r ij + jx ij is the admittance of line ij y sh,i are all shunt elements connected to bus i, including the shunt capacitance of the π-model of the line 4 If there are more than one lines connecting the same nodes, then they must all be added to Y bus,ij, Y bus,ii, Y bus,jj. 29 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
AC Power Flow Equations For all buses S = [S 1... S N ] T : S i = V i I i = V i Y busv S gen S load = diag(v )Y busv 30 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Further reading 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 DTU Lecture slides: Optimization in modern power systems http://www.chatziva.com/teaching/2017/31765.html Line Congestion, Nodal Prices, and Marginal Generators S. Chatzivasileiadis, T. Krause, and G. Andersson. HVDC line placement for maximizing social welfare - an analytical approach. In IEEE Powertech 2013, pages 1-6, June 2013. 31 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
but DC-OPF market clearing uses DC-OPF (at the moment) convex can solve fast; can be applied in very large problems only active power flow no losses and no voltage limits DC approximations more suitable for transmission systems (not distribution) but AC-OPF primarily used for optimization of operation and control actions future: use in markets full AC power flow equations non-convex (in its original form) no guarantee that we find the global optimum computationally expensive and intractable for very large systems efforts to decrease computation time and increase system size 32 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Thank you! spchatz@elektro.dtu.dk www.chatziva.com 33 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
Appendix 34 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
From AC to DC Power Flow Equations The power flow along a line is: S ij = V i I ij = V i (y sh,iv i + y ij(v i V j )) Assume a negligible shunt conductance: g sh,ij = 0 y sh,i = jb sh,i. Given that R << X in transmission systems, for the DC power flow we assume that z ij = r ij + jx ij jx ij. Then y ij = j 1 x ij. Assume: V i = V i 0 and V j = V j δ, with δ = θ j θ i. I ij = jb sh,i V i + j 1 x ij (V i (V j cos δ jv j sin δ)) = jb sh,i V i + j 1 x ij V i j 1 x ij V j cos δ 1 x ij V j sin δ 35 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018
From AC to DC Power Flow Equations (cont.) Since V i is a real number, it is: With δ = θ j θ i, it is: P ij =R{S ij } = V i R{I ij} = 1 x ij V i V j sin δ P ij = 1 x ij V i V j sin(θ i θ j ) We further make the assumptions that: V i, V j are constant and equal to 1 p.u. sin θ θ, θ must be in rad Then P ij = 1 x ij (θ i θ j ) 36 DTU Electrical Engineering Optimal Power Flow (DC-OPF and AC-OPF) Jun 25, 2018