ECE 476 Power System Analysis Lecture 12: Power Flow Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign overbye@illinois.edu Announcements • Read Chapter 6 • H6 is 6.19, 6.30, 6.31, 6.34, 6.38, 6.45. It does not need to be turned in, but will be covered by an in-class quiz on Oct 15. 1 Transmission Line Corridors from the Air Image Source: Jamie Padilla Slack Bus • In previous example we specified S2 and V1 and then solved for S1 and V2. • We can not arbitrarily specify S at all buses because total generation must equal total load + total losses • We also need an angle reference bus. • To solve these problems we define one bus as the "slack" bus. This bus has a fixed voltage magnitude and angle, and a varying real/reactive power injection. 3 Stated Another Way • From exam problem 4.c we had Bus 2 Bus 1 j0.2 j0.1 j0.1 Bus 3 Ybus 10 15 5 j 5 15 10 10 10 20 • This Ybus is actually singular! • So we cannot solve V Ybus 1 I • This means (as you might expect), we cannot independently specify all the current injections I 4 Gauss with Many Bus Systems With multiple bus systems we could calculate new Vi ' s as follows: Vi ( v 1) n 1 S*i (v ) ( v )* YikVk Yii V k 1, k i i hi (V1( v ) ,V2( v ) ,...,Vn( v ) ) But after we've determined Vi( v 1) we have a better estimate of its voltage , so it makes sense to use this new value. This approach is known as the Gauss-Seidel iteration. 5 Gauss-Seidel Iteration Immediately use the new voltage estimates: V2( v 1) h2 (V1,V2( v ) ,V3( v ) ,,Vn( v ) ) V3( v 1) h2 (V1,V2( v 1) ,V3( v ) ,,Vn( v ) ) V4( v 1) h2 (V1,V2( v 1) ,V3( v 1) ,V4( v ) ,Vn( v ) ) Vn( v 1) h2 (V1,V2( v 1) ,V3( v 1) ,V4( v 1) ,Vn( v ) ) The Gauss-Seidel works better than the Gauss, and is actually easier to implement. It is used instead of Gauss. 6 Three Types of Power Flow Buses • There are three main types of power flow buses – – – Load (PQ) at which P and Q are fixed; iteration solves for voltage magnitude and angle. Slack at which the voltage magnitude and angle are fixed; iteration solves for P and Q injections Generator (PV) at which P and |V| are fixed; iteration solves for voltage angle and Q injection • special coding is needed to include PV buses in the Gauss-Seidel iteration (covered in book, but not in slides since Gauss-Seidel is no longer commonly used) 7 Accelerated G-S Convergence Previously in the Gauss-Seidel method we were calculating each value x as x ( v 1) h( x ( v ) ) To accelerate convergence we can rewrite this as x ( v 1) x ( v ) h( x ( v ) ) x ( v ) Now introduce acceleration parameter x ( v 1) x ( v ) (h( x ( v ) ) x ( v ) ) With = 1 this is identical to standard gauss-seidel. Larger values of may result in faster convergence. 8 Accelerated Convergence, cont’d Consider the previous example: x - x 1 0 x ( v 1) x ( v ) (1 x ( v ) x ( v ) ) Comparison of results with different values of k 1 1.2 1.5 2 0 1 1 1 1 1 2 2.20 2.5 3 2 2.4142 2.5399 2.6217 2.464 3 2.5554 2.6045 2.6179 2.675 4 2.5981 2.6157 2.6180 2.596 5 2.6118 2.6176 2.6180 2.626 9 Gauss-Seidel Advantages/Disadvantages • Advantages – – Each iteration is relatively fast (computational order is proportional to number of branches + number of buses in the system Relatively easy to program • Disadvantages – – – – Tends to converge relatively slowly, although this can be improved with acceleration Has tendency to miss solutions, particularly on large systems Tends to diverge on cases with negative branch reactances (common with compensated lines) Need to program using complex numbers 10 Newton-Raphson Algorithm • The second major power flow solution method is the Newton-Raphson algorithm • Key idea behind Newton-Raphson is to use sequential linearization General form of problem: Find an x such that f ( xˆ ) 0 11 Newton-Raphson Method (scalar) 1. For each guess of xˆ , x ( v ) , define x ( v ) xˆ - x ( v ) 2. Represent f ( xˆ ) by a Taylor series about f ( x ) (v) df ( x ) (v) (v) f ( xˆ ) f ( x ) x dx 1 d 2 f ( x( v ) ) (v) x 2 2 dx 2 higher order terms 12 Newton-Raphson Method, cont’d 3. Approximate f ( xˆ ) by neglecting all terms except the first two (v ) df ( x ) (v) (v ) f ( xˆ ) 0 f ( x ) x dx 4. Use this linear approximation to solve for x ( v ) 1 df ( x ) (v) x f ( x ) dx 5. Solve for a new estimate of x̂ (v) (v) x ( v 1) x ( v ) x ( v ) 13 Newton-Raphson Example Use Newton-Raphson to solve f ( x) x 2 - 2 0 The equation we must iteratively solve is x (v) x ( v ) x x 1 df ( x ) (v) f ( x ) dx 1 (v) 2 ( v ) (( x ) - 2) 2x (v ) ( v 1) x (v) ( v 1) x (v) x (v) 1 (v) 2 ( v ) (( x ) - 2) 2x 14 Newton-Raphson Example, cont’d x ( v 1) x (v) 1 (v) 2 ( v ) (( x ) - 2) 2x Guess x (0) 1. Iteratively solving we get v x(v) f ( x(v) ) x ( v ) 0 1 1 0.5 1 1.5 0.25 0.08333 2 1.41667 6.953 103 2.454 103 3 1.41422 6.024 106 15 Sequential Linear Approximations Function is f(x) = x2 - 2 = 0. Solutions are points where f(x) intersects f(x) = 0 axis At each iteration the N-R method uses a linear approximation to determine the next value for x 16 Newton-Raphson Comments • When close to the solution the error decreases quite quickly -- method has quadratic convergence • f(x(v)) is known as the mismatch, which we would like to drive to zero • Stopping criteria is when f(x(v)) < • Results are dependent upon the initial guess. What if we had guessed x(0) = 0, or x (0) = -1? • A solution’s region of attraction (ROA) is the set of initial guesses that converge to the particular solution. The ROA is often hard to determine 17 Multi-Variable Newton-Raphson Next we generalize to the case where x is an ndimension vector, and f (x) is an n-dimension function x1 x x 2 x n f1 (x) f ( x) f ( x) 2 f ( x) n Again define the solution xˆ so f (xˆ ) 0 and x xˆ x 18 Multi-Variable Case, cont’d The Taylor series expansion is written for each fi (x) f1 (x) f1 ( x) f1 ( xˆ ) f1 ( x) x1 x2 x1 x2 f1 (x) xn higher order terms xn f n (x) f n ( x) f n (xˆ ) f n ( x) x1 x2 x1 x2 f n (x) xn higher order terms xn 19 Multi-Variable Case, cont’d This can be written more compactly in matrix form f1 (x) x 1 f1 (x) f (x) f 2 (x) f (xˆ ) 2 x1 f ( x) n f (x) n x1 f1 (x) x2 f 2 (x) x2 f n (x) x2 f1 (x) xn x1 f 2 ( x) x xn 2 x f n (x) n xn higher order terms 20 Jacobian Matrix The n by n matrix of partial derivatives is known as the Jacobian matrix, J (x) f1 (x) x 1 f 2 (x) J (x) x1 f (x) n x1 f1 ( x) x2 f 2 ( x) x2 f n ( x) x2 f1 ( x) xn f 2 ( x) xn f n ( x) xn 21 Multi-Variable Example x1 Solve for x = such that f ( x) 0 where x2 f1 (x) 2 x12 x22 8 0 f 2 (x) x12 x22 x1 x2 4 0 First symbolically determine the Jacobian f1 (x) x 1 J (x) = f 2 (x) x1 f1 ( x) x2 f 2 ( x) x2 22 Multi-variable Example, cont’d 4 x1 J (x) = 2 x1 x2 Then x1 4 x1 x 2 x x 2 1 2 Arbitrarily guess x(0) x1 2 x2 2 x2 1 f1 ( x) x1 2 x2 f 2 ( x) 1 1 2 x2 1 x (1) 1 4 2 5 2.1 1 3 1 3 1.3 23 Multi-variable Example, cont’d 1 2.1 8.40 2.60 2.51 1.8284 x 1.3 5.50 0.50 1.45 1.2122 Each iteration we check f (x) to see if it is below our (2) specified tolerance 0.1556 f (x ) 0.0900 If = 0.2 then we would be done. Otherwise we'd (2) continue iterating. 24 NR Application to Power Flow We first need to rewrite complex power equations as equations with real coefficients * n Si Vi I i* Vi YikVk Vi Yik*Vk* k 1 k 1 These can be derived by defining n Yik Gik jBik ji Vi Vi e ik i k Vi i Recall e j cos j sin 25 Real Power Balance Equations n Si Pi jQi Vi Yik*Vk* k 1 n Vi Vk k 1 n j ik V V e (Gik jBik ) i k k 1 (cos ik j sin ik )(Gik jBik ) Resolving into the real and imaginary parts Pi Qi n Vi Vk (Gik cos ik Bik sin ik ) PGi PDi k 1 n Vi Vk (Gik sin ik Bik cos ik ) QGi QDi k 1 26 Newton-Raphson Power Flow In the Newton-Raphson power flow we use Newton's method to determine the voltage magnitude and angle at each bus in the power system. We need to solve the power balance equations Pi Qi n Vi Vk (Gik cos ik Bik sin ik ) PGi PDi Vi Vk (Gik sin ik Bik cos ik ) QGi QDi k 1 n k 1 27 Power Flow Variables Assume the slack bus is the first bus (with a fixed voltage angle/magnitude). We then need to determine the voltage angle/magnitude at the other buses. 2 n x V 2 Vn P2 (x) PG 2 PD 2 Pn (x) PGn PDn f ( x) Q2 (x) QG 2 QD 2 Qn (x) QGn QDn 28 N-R Power Flow Solution The power flow is solved using the same procedure discussed last time: Set v 0; make an initial guess of x, x( v ) While f (x( v ) ) Do x( v 1) x( v ) J (x( v ) ) 1 f (x( v ) ) v v 1 End While 29 Power Flow Jacobian Matrix The most difficult part of the algorithm is determining and inverting the n by n Jacobian matrix, J (x) f1 (x) x 1 f 2 (x) J (x) x1 f (x) n x1 f1 ( x) x2 f 2 (x) x2 f n ( x) x2 f1 ( x) xn f 2 ( x) xn f n ( x) xn 30 Power Flow Jacobian Matrix, cont’d Jacobian elements are calculated by differentiating each function, fi ( x), with respect to each variable. For example, if fi (x) is the bus i real power equation fi ( x) fi ( x) i n Vi Vk (Gik cosik Bik sin ik ) PGi PDi k 1 n Vi Vk (Gik sin ik Bik cosik ) k 1 k i fi ( x) Vi V j (Gij sin ij Bij cosij ) ( j i ) j 31 Two Bus Newton-Raphson Example For the two bus power system shown below, use the Newton-Raphson power flow to determine the voltage magnitude and angle at bus two. Assume that bus one is the slack and SBase = 100 MVA. Line Z = 0.1j One 1.000 pu Two 0 MW 0 MVR 2 x V2 1.000 pu 200 MW 100 MVR Ybus j10 j10 j 10 j 10 32 Two Bus Example, cont’d General power balance equations Pi Qi n Vi Vk (Gik cosik Bik sin ik ) PGi PDi k 1 n Vi Vk (Gik sin ik Bik cos ik ) QGi QDi k 1 Bus two power balance equations V2 V1 (10 sin 2 ) 2.0 0 V2 V1 ( 10 cos 2 ) V2 (10) 1.0 0 2 33 Two Bus Example, cont’d P2 (x) V2 (10sin 2 ) 2.0 0 Q2 (x) V2 ( 10 cos 2 ) V2 (10) 1.0 0 2 Now calculate the power flow Jacobian P2 (x) 2 J ( x) Q 2 (x) 2 P2 ( x) V 2 Q 2 ( x) V 2 10 V2 cos 2 10 V2 sin 2 10sin 2 10 cos 2 20 V2 34 Two Bus Example, First Iteration Set v 0, guess x (0) 0 1 Calculate V2 (10sin 2 ) 2.0 f(x ) 2 V2 (10 cos 2 ) V2 (10) 1.0 10sin 2 10 V2 cos 2 (0) J (x ) 10 V2 sin 2 10 cos 2 20 V2 (0) 1 Solve x (1) 0 10 0 2.0 1.0 1 0 10 2.0 1.0 10 0 0 10 0.2 0.9 35