ECE 421/521 Electric Energy Systems Power Systems Analysis I 7 – Optimal Dispatch of Generation Instructor: Kai Sun Fall 2013 1 Background • In a practical power system, the costs of generating and delivering electricity from power plants are different (due to fuel costs and distances to load centers) • Under normal conditions, the system generation capacity is more than the total load demand and losses. • Thus, there is room to schedule generation within capacity limits – Minimizing a cost function that represents, e.g. • Operating costs • Transmission losses • System reliability impacts • This is called Optimal Power Flow (OPF) problem • A typical problem is the Economic Dispatch (ED) of real power generation 2 Introduction of Nonlinear Function Optimization • Unconstrained parameter optimization • Constrained parameter optimization – Equality constraints – Inequality constraints 3 Unconstrained parameter optimization Minimize cost function f ( x1 , x2 , , xn ) • Necessary conditions for the solution (necessary & sufficient for local minima) ∂f ∂f ∂f Critical point – Gradient vector = ∇f ( = , , , ) 0 (f does not change) ∂x1 ∂x2 ∂xn – Hessian matrix H is positive definite Local minimum • All local minima → the Global minimum 4 • Minimize f(x, y)=x2+y2 y ∂f ∂f = ∇f ( = , ) (2 x= , 2 y) 0 ∂x ∂y H ∇f ∂2 f ∂2 f ∂x 2 ∂x∂y 2 0 = 0 2 2 ∂ f ∂ y ∂ x 2 ∂y 0 = x 0,= y 0 5 x Parameter Optimization with Equality Constraints Minimize f ( x1 , x2 , , xn ) Subject to g k ( x1 , x2 , , xn ) = 0 k = 1, 2, , K • Introduce Lagrange Multipliers λ1~ λK K L= f + ∑ λk g k i =1 • Necessary conditions for the local minima of L (also necessary for the original problem) K ∂g ∂L ∂f = + ∑ λk k = 0 ∂xi ∂xi i =1 ∂xi ∂L = g= 0 k ∂λk 6 • Minimize Subject to f(x, y)=x2+y2 (x-8)2+(y-6)2=25 → g(x, y)=(x-8)2+(y-6)2-25 y L = x 2 + y 2 + λ[( x − 8) 2 + ( y − 6) 2 − 25] ∇g ∂L =2 x + λ (2 x − 16) =0 ∂x ∇f 6 ∂L = 2 y + λ (2 y − 12) = 0 ∂y 0 ∂L = ( x − 8) 2 + ( y − 6) 2 − 25 = 0 ∂λ Solutions (from the N-R method): λ=1, x=4 and y=3 (f=25) λ=3, x=12 and y=9 (f=225) 7 8 x Parameter Optimization with Inequality Constraints Minimize f ( x1 , x2 , , xn ) Subject to : g ( x , x , , x ) = 0 1 2 k n u j ( x1 , x2 , , xn ) ≤ 0 k = 1, 2, , K j = 1, 2, , m • Introduce Lagrange Multipliers λ1~ λK and µ1~ µm K m L= f + ∑ λk g k + ∑ µ j u j = k 1 =j 1 • Necessary conditions for the local minima of L K ∂u j ∂g k m ∂L ∂f = + ∑ λk + ∑µj = 0 i = 1, , n ∂x= ∂xi i 1 = ∂xi j 1 ∂xi i ∂L = g= 0 k ∂λk Kuhn-Tucker (KKT) necessary condition k = 1, 2, , K ∂L = uj ≤ 0 ∂µ j µ ju j = 0 µj ≥ 0 j = 1, , m 8 • Minimize Subject to f(x, y)=x2+y2 (x-8)2+(y-6)2=25 → g(x, y)=(x-8)2+(y-6)2-25 2 x + y ≥ 12 u( x, y ) = 12 − 2 x − y ≤ 0 L = x 2 + y 2 + λ [( x − 8) 2 + ( y − 6) 2 − 25] + µ (12 − 2 x − y ) ∂L = 2 x + λ (2 x − 16) − 2 µ = 0 ∂x ∂L = 2 y + λ (2 y − 12) − µ = 0 ∂y ∂L = ( x − 8) 2 + ( y − 6) 2 − 25 = 0 ∂λ ∂L = 12 − 2 x − y < 0 µ = 0 ∂µ ∂L or = 12 − 2 x − y = 0 µ > 0 ∂µ Solutions: µ=0, λ=3, x=12 and y=9 (f=225) µ=5.6, λ=-0.2, x=5 and y=2 (f=29) µ=12, λ=-1.8, x=3 and y=6 (f=33) y ∇g ∇f ∇u 6 0 9 8 x Operating Cost of a Thermal Plant • Fuel-cost curve of a generator (represented by a quadratic function of real power) Ci =αi + β i Pi + γ i Pi 2 • Incremental fuel-cost curve: = λi dCi = 2γ i Pi + β i dPi 10 ED Neglecting Losses and No Generator Limits If transmission line losses are neglected, minimize the total production cost: ng n 2 α + β + γ P P ∑ i ii ii Ct = ∑ Ci = i =1 i =1 subject to ng ∑P = P i i =1 D • Apply the Lagrange multiplier method: ng L= Ct + λ ( PD − ∑ Pi ) All plants must operate at equal incremental cost ∂L =0 ∂Pi ∂Ct 0 −λ = ∂Pi ∂Ct dCi = λ= = β i + 2γ i Pi ∂Pi dPi ∂L =0 ∂λ ng i =1 ∑P = P i =1 i D λ − βi = PD ∑ 2γ i i =1 ng 11 Pi = PD + ∑ i =g1 n λ= ∑ ng i =1 βi 2γ i 1 2γ i λ − βi 2γ i i = 1, , ng Example 7.4 The fuel-cost functions for three thermal plants are C1~C2 in $/h. P1, P2 and P3 are in MW. PD=800MW. Neglecting line losses and generator limits, find the optimal dispatch and the total cost in $/h PD + ∑ i =g1 n λ= Pi = P1 P2 P3 ∑ ng i =1 βi 2γ i 1 2γ i = C1 =500 + 5.3P1 + 0.004 P12 C2 =400 + 5.5P2 + 0.006 P22 C3 =200 + 5.8P3 + 0.009 P32 5.3 5.5 5.8 + + + 1443.0555 0.008= 0.012 0.018 800 = 8.5 $ / MWh 1 1 1 263.8889 + + 0.008 0.012 0.018 800 + dC3 = 5.8 + 0.018P3 = λ dP3 λ − βi 2γ i 8.5 − 5.3 = 400.0000 2(0.004) 8.5 − 5.5 = 250.0000 2(0.006) 8.5 − 5.8 = 150.0000 2(0.009) dC2 5.5 + 0.012 P2 = = λ dP2 equal incremental cost Ct = 6682.5 $ / h 12 dC1 5.3 + 0.008P1 = = λ dP1 Solving λ by an Iterative Procedure λ − βi PD = ∑ γ 2 =i 1 =i 1 i ng = ∑ Pi ng • For a general case: ng = P ∑ f= (λ ) i =1 f (λ )( k ) + ( i PD df (λ ) ( k ) ( k ) ) ∆λ ≈ PD dλ ∆ ng ∆P ( k ) =PD − f (λ )( k ) =PD − ∑ Pi ( k ) i =1 PD − f (λ )( k ) ∆P ( k ) = ∆λ = = df (λ ) ( k ) df (λ ) ( k ) ( ) ( ) dλ dλ (k ) ∆P ( k ) dPi ( k ) ( ∑ dλ ) +1) λ ( k= λ ( k ) + ∆λ ( k ) 13 Gradient method Apply the Gradient Method in Example 7.4 Pi ( k ) = λ (k ) − βi 2γ i ∆P ( k ) = ∆λ = dPi ( k ) ∑( dλ ) (k ) ∆P ( k ) 1 ∑ 2γ i λ (1) = 6.0 = P1(1) 6.0 − 5.3 = 87.5000 2(0.004) 6.0 − 5.5 = 41.6667 2(0.006) 6.0 − 5.8 = P3(1) = 11.1111 2(0.009) = P2(1) λ (2) = 6.0 + 2.5 = 8.5 8.5 − 5.3 = 400.0000 2(0.004) 8.5 − 5.5 = P2(2) = 250.0000 2(0.006) 8.5 − 5.8 = P3(2) = 150.0000 2(0.009) = P1(2) ∆P (1) = 800 − (87.5 + 41.6667 + 11.1111) = 659.7222 ∆P (2) = 800 − (400 + 250 + 150) = 0.0 659.7222 1 1 1 + + 2(0.004) 2(0.006) 2(0.009) 659.7222 = = 2.5 263.8888 ∆λ (1) = Ct = 6682.5 $ / h 14 ED Neglecting Losses and Including Generator Limits • Considering the maximum (rating) and minimum (stability) generation limits, minimize ng n Ct = ∑ Ci = ∑ αi + β i Pi + γ i Pi 2 i =1 Subject to i =1 ng ∑P = P i =1 i D Pi (min) ≤ Pi ≤ Pi (max),i = 1, 2, , ng ng P1 P2 P3 P4 ng L= Ct + λ ( PD − ∑ Pi ) + ∑ [ µi ( Pi − Pi (max) ) + γ i ( Pi (min) − Pi )] =i 1 =i 1 ∂L =0 ∂Pi ∂L =0 ∂λ ∂L ≤0 ∂µi ∂L ≤0 ∂γ i Pi (min) ≤ Pi ≤ Pi (max) ( µi = γ i = 0) ∂Ci − λ + µi − γ i = 0 ∂Pi ng ∑P = P i =1 i D µi ( Pi − Pi (max) ) = 0, µi ≥ 0 γ i ( Pi (min) − Pi )= 0 γ i ≥ 0 dCi =λ dPi = Pi P= 0) i (max) (γ i dCi ≤λ dPi = Pi P= 0) i (min) ( µi dCi ≥λ dPi Excluding the plants that reach their Pi (min) ≤ Pi ≤ Pi (max) , i = 1,2, , ng limits, the other plants still operate at 15 equal incremental cost Example 7.6 Consider generator limits (in MW) for Example 7.4, let PD=975MW 250 ≤ P1 ≤ 450 150 ≤ P2 ≤ 350 100 ≤ P3 ≤ 225 dC3 5.8 + 0.018P3 = = λ dP3 dC2 = λ 5.5 + 0.012 P2 = dP2 PD=975MW dC1 5.3 + 0.008P1 = = λ dP1 PD=906MW PD=800MW Solution: P1=450MW P2=325MW P3=200MW λ=9.4$/MWh Ct=8236.25 $/h 16 Pi ( k ) = λ (k ) − βi 2γ i ∆P ( k ) = ∆λ = dPi ( k ) ∑( dλ ) (k ) λ (1) = 6.0 6.0 − 5.3 = P = 87.5000 2(0.004) (1) 1 6.0 − 5.5 = 41.6667 2(0.006) 6.0 − 5.8 = P3(1) = 11.1111 2(0.009) = P2(1) ∆P (1) = 975 − (87.5 + 41.6667 + 11.1111) = 834.7222 834.7222 1 1 1 + + 2(0.004) 2(0.006) 2(0.009) 834.7222 = = 3.1632 263.8888 ∆P ( k ) 1 ∑ 2γ i 250 ≤ P1 ≤ 450 150 ≤ P2 ≤ 350 100 ≤ P3 ≤ 225 λ (2) = 6.0 + 3.1632 = 9.1632 9.1632 − 5.3 = 482.8947 > P1(max) , so let P1 ≡ 450 2(0.004) 9.1632 − 5.5 = P2(2) = 305.2632 2(0.006) 9.1632 − 5.8 = P3(2) = 186.8421 2(0.009) = P1(2) ∆P (2) = 975 − ( 450 + 305.2632 + 186.8421) = 32.8947 ∆= λ (2) ∆λ (1) = 32.8947 32.8947 = = 0.2368 1 1 132.8889 + 2(0.006) 2(0.009) λ (3) = 9.1632 + 0.2368 = 9.4 P1(3) = 450 9.4 − 5.5 = 325 2(0.006) 9.4 − 5.8 = P3(3) = 200 2(0.009) = P2(3) ∆P (3) = 975 − (450 + 325 + 200) = 0.0 17 Solve the optimal dispatch for PD=550MW C1 =500 + 5.3P1 + 0.004 P12 C2 =400 + 5.5P2 + 0.006 P22 C3 =200 + 5.8P3 + 0.009 P32 250 ≤ P1 ≤ 450 or P1 = 0 150 ≤ P2 ≤ 350 or P2 = 0 100 ≤ P ≤ 225 or P3 = 0 3 dC3 5.8 + 0.018 P3 = = λ dP3 P1=0 dC2 = 5.5 + 0.012 P2 = λ dP2 Unit Commitment Problem (mixed-integer optimization) Solution 1: Solution 2: P1=280MW P1=340MW P2=170MW P2=210MW dC1 P3=100MW 5.3 + 0.008P1 = = λ dP1 P2=0 P3=0MW λ=7.54$/MWh λ=8.02$/MWh Ct=4676 $/h Ct=4584 $/h Solution 3: Solution 4: P1=0MW P1=400MW P2=340MW P2=0MW P3=210MW P3=150MW λ=9.58$/MWh λ=8.5$/MWh Ct=47785 $/h Ct=4532 $/h P3=0 18 Transmission Loss • When transmission distances are very small and load density in the system is very high – Transmission losses may be neglected – All plants operate at equal incremental production cost to achieve optimal dispatch of generation • However, in a large interconnected network – Power is transmitted over long distances with low load density areas – Transmission losses are a major factor affecting the optimal dispatch. 19 Calculation of Transmission Losses | I |= P | V | cos φ P V I 2 P = PL | I= R |2 R | V | cos φ R = P2 2 2 | V | cos φ R+jX PD PL = BP 2 P= | I1 |2 R1 + | I 2 |2 R2 + | I1 + I 2 |2 R3 L 2 P1 V1 2 P1 P2 + R 1 R2 | V1 | cos φ1 | V2 | cos φ2 2 cos α ⋅ P1 cos β ⋅ P2 + + R3 | V1 | cos φ1 | V2 | cos φ2 I1 I2 R2+jX2 R1+jX1 I3 R3+jX3 PD PL = B11 P12 + B12 P1 P2 + B22 P22 20 V2 P2 More general loss formulas: • Quadratic form ng ng PL PB i ij Pj i 1 j 1 • Kron’s loss formula ng ng ng PL PB i ij Pj B0 i Pi B00 i 1 j 1 i 1 – Bij, B0i and B00 are Loss coefficients or B-coefficients. • See Chapter 7.6 for details of calculating B-coefficients • Changes with power flows but usually assumed constant and estimated for a power-flow base case 21 Economic Dispatch Including Losses • Cost function ng ng Ct Ci i i Pi i Pi i 1 2 i 1 dCi = β i + 2γ i Pi dPi Incremental fuel cost Subject to ng P P i D PL i 1 g PL 2 Bij Pj B0i Pi j 1 n ng ng ng PL PB i ij Pj B0 i Pi B00 i 1 j 1 Pi (min) Pi Pi (max) i 1 Incremental transmission loss i 1, , ng 22 • Using Lagrange Multipliers ng ng ng ng i 1 i 1 i 1 i 1 L Ci ( PD PL Pi ) i (max) ( Pi Pi (max) ) i (min) ( Pi Pi (min) ) ng where ng ng PL PB i ij Pj B0 i Pi B00 i 1 j 1 ng ng i 1 i 1 i 1 Ct Ci i i Pi i Pi 2 ∂L =0 ∂λ ∂L =0 ∂Pi ng P P i D Penalty factor: 1 Li P 1 L Pi PL i 1 ∂Ci ∂P 0 + λ (0 + L − 1) = ∂Pi ∂Pi dCi ∂P dC Li i ,i 1, , ng λ +λ L = dPi ∂Pi dPi g PL 2 Bij Pj B0i Pi j 1 n dCi = β i + 2γ i Pi dPi ng i 2 i Pi 2 Bij Pj B0i j 1 23 g i 1 ( Bii ) Pi Bij Pj (1 B0i i ) 2 j 1 n ng i 2 i Pi 2 Bij Pj B0i j 1 j i Solve λ and Pi for the optimal dispatch: 1 B11 B21 Bng 1 B12 2 B22 Bng 2 ng P P i D B1ng B12 ng Bng ng 1 B01 1 P1 2 P 2 1 1 B02 2 P ng ng 1 B 0 ng PL i 1 Check inequality constraints: If Pi<Pi(min), let Pi ≡ Pi(min) If Pi>Pi(max), let Pi ≡ Pi(max) 24 ng f ( ) Pi PD PL • Using the Gradient Method: i 1 g i 1 ( Bii ) Pi Bij Pj (1 B0i i ) 2 j 1 n Pi (1 B0i ) i 2 1 Pi ( k ) f ( ) Pi ng (k ) i1 f ( )( k ) ( 2 P (k ) ( k ) (1 B0i ) i 2 ( k ) 3 4 j i Bij Pj( k ) 2(i ( k ) Bii ) i1 df ( ) ( k ) ) ( k ) PD PL( k ) d PD P (k ) L ng ng Pi (k ) P ( k ) df ( ) ( k ) ( ) d P ( k ) Pi ( k ) ( ) ( k 1) ( k ) ( k ) (k ) L where P i 1 (k ) Bij Pj( k ) 2( i ( k ) Bii ) ng (k ) j i Bij Pj 2(i Bii ) j i ( k ) (1 B0i ) i 2 ( k ) j i ng Pi Bij P (k ) i 1 j 1 (k ) P where i i 1 ng 25 (k ) j ng i 1 ng B0i Pi ( k ) B00 i 1 i (1 B0i ) Bii i 2i 2( i ( k ) Bii )2 j i Bij Pj( k ) Example 7.7 Solve the optimal dispatch of three thermal plants in a power system. The total system load is 150MW. The base for per unit values is 100MVA. C1 200 7.0 P1 0.008 P12 $ / h C2 180 6.3P2 0.009 P22 $ / h C3 140 6.8P3 0.007 P32 $ / h 10 MW P1 85 MW 10 MW P2 80 MW 10 MW P3 70 MW PL ( pu) 0.0218P1(2pu) 0.0228P2(2 pu) 0.0179 P3(2 pu) (only Bii ≠0) P P P PL 0.0218( 1 ) 2 0.0228( 2 ) 2 0.0179( 3 ) 2 100 MW 100 100 100 0.000218P12 0.000228P22 0.000179 P32 MW 26 i 2( i ( k ) Bii ) (k ) Pi ( k ) ng (k ) Pi i 1 ng i 1 i Bii i 2( i ( k ) Bii ) 2 λ (1) = 8.0 (k ) 8.0 7.0 51.3136 MW 2(0.008 0.8 0.000218) 8.0 6.3 78.5292 MW 2(0.008 0.8 0.000228) 8.0 6.8 71.1575 MW 2(0.007 0.8 0.000179) P2(1) P2(4) P3(4) 0.000179(52.4767) 2 1.699 0.000179(71.1575)2 2.886 P (4) 0.0001 P (1) 150 2.8864 (51.3136 78.5292 71.1575) 48.1139 (1) 10 MW P3 70 MW PL(4) 0.000218(35.0907) 2 0.000228(64.1317) 2 PL(1) 0.000218(51.3136)2 0.000228(78.5292)2 P ( i) i 1 10 MW P2 80 MW 7.6789 7.0 35.0907 MW 2(0.008 7.679 0.000218) 7.6789 6.3 64.1317 MW 2(0.009 7.679 0.000228) 7.6789 6.8 52.4767 MW 2(0.007 7.679 0.000179) P1(4) 3 10 MW P1 85 MW (4) 7.6789 P1(1) P3(1) P ( k ) P ( i )( k ) (1) Ct 1592.65 $/h 152.4924 48.1139 0.31552 152.4924 27 Homework 8 • ECE521: 6.12, 6.13, 7.9, 7.11 • ECE421: 6.12(a)-(b), 6.13(a), 7.9, 7.11 • Due date: Dec 9 (Monday) 28