SECTION 5: POWER FLOW ESE 470 Energy Distribution Systems
2 Introduction
Nodal Analysis 3 Consider the following circuit Three voltage sources VV sss, VV sss, VV sss Generic branch impedances Could be any combination of R, L, and C Three unknown node voltages VV 1, VV 2, and VV 3 Would like to analyze the circuit Determine unknown node voltages One possible analysis technique is nodal analysis
Nodal Analysis 4 Nodal analysis Systematic application of KCL at each unknown node Apply Ohm s law to express branch currents in terms of node voltages Sum currents at each unknown node We ll sum currents leaving each node and set equal to zero At node VV 1, we have VV 1 VV sss ZZ sss + VV 1 VV 2 ZZ 1 = 0 Every current term includes division by an impedance Easier to work with admittances instead
Nodal Analysis 5 Now our first nodal equation becomes VV 1 VV sss YY sss + VV 1 VV 2 YY 1 = 0 where YY sss = 1/ZZ sss and YY 1 = 1/ZZ 1 Rearranging to place all unknown node voltages on the left and all source terms on the right YY sss + YY 1 VV 1 YY 1 VV 2 = YY sss VV sss Applying KCL at node VV 2 VV 2 VV 1 YY 1 + VV 2 YY 2 + VV 2 VV sss YY sss + VV 2 VV 3 YY 3 = 0
Nodal Analysis 6 Rearranging YY 1 VV 1 + YY 1 + YY 2 + YY sss + YY 3 VV 2 YY 3 VV 3 = YY sss VV sss Finally, applying KCL at node VV 3, gives VV 3 VV 2 YY 3 + VV 3 VV sss YY sss = 0 YY 3 VV 2 + YY 3 + YY sss VV 3 = YY sss VV sss Note that the source terms are the Norton equivalent current sources (short-circuit currents) associated with each voltage source
Nodal Analysis 7 Putting the nodal equations into matrix form or where YY ss1 + YYY YY 1 0 YY 1 YY 1 + YY 2 + YY sss + YY 3 YY 3 0 YY 3 YY 3 + YY sss YYYY = II YY is the NN NN admittance matrix II is an NN 1 vector of known source currents VV is an NN 1 vector of unknown node voltages VV 1 VV 2 VV 3 = YY ss1 VV ss1 YY sss VV sss YY sss VV sss This is a system of NN (here, three) linear equations with NN unknowns We can solve for the vector of unknown voltages as VV = YY 1 II
The Admittance Matrix, YY 8 Take a closer look at the form of the admittance matrix, YY YY ss1 + YYY YY 1 0 YY 1 YY 1 + YY 2 + YY sss + YY 3 YY 3 = 0 YY 3 YY 3 + YY sss The elements of YY are Diagonal elements, YY kkkk : YY kkkk = sum of all admittances connected to node kk Self admittance or driving-point admittance Off-diagonal elements, YY kkkk (kk nn): YY kkkk = (total admittance between nodes kk and nn) Mutual admittance or transfer admittance YY 11 YY 12 YY 13 YY 21 YY 22 yy 23 YY 31 YY 32 YY 33 Note that, because the network is reciprocal, YY is symmetric
Nodal Analysis 9 Nodal analysis allows us to solve for unknown voltages given circuit admittances and current (Norton equivalent) inputs An application of Ohm s law YYYY = II A linear equation Simple, algebraic solution For power-flow analysis, things get a bit more complicated
10 Power-Flow Analysis
The Power-Flow Problem 11 A typical power system is not entirely unlike the simple circuit we just looked at Sources are generators Nodes are the system buses Buses are interconnected by impedances of transmission lines and transformers Inputs and outputs now include power (P and Q) System equations are now nonlinear Can t simply solve YYYY = II Must employ numerical, iterative solution methods Power system analysis to determine bus voltages and power flows is called power-flow analysis or load-flow analysis
System One-Line Diagram 12 Consider the one-line diagram for a simple power system System includes: Generators Buses Transformers Treated as equivalent circuit impedances in per-unit Transmission lines Equivalent circuit impedances Loads
Bus Variables 13 The buses are the system nodes Four variables associated with each bus, kk Voltage magnitude, VV kk Voltage phase angle, δδ kk Real power delivered to the bus, PP kk Reactive power delivered to the bus, QQ kk
Bus Power 14 Net power delivered to bus kk is the difference between power flowing from generators to bus kk and power flowing from bus kk to loads PP kk = PP GGGG PP LLLL QQ kk = QQ GGGG QQ LLLL Even though we ve introduced power flow into the analysis, we can still write nodal equations for the system Voltage and current related by the bus admittance matrix, YY bbbbbb II = YY bbbbbb VV YY bbbbbb contains the bus mutual and self admittances associated with transmission lines and transformers For an NN bus system, VV is an NN 1 vector of bus voltages II is an NN 1 vector of source currents flowing into each bus From generators and loads
Types of Buses 15 There are four variables associated with each bus VV kk = VV kk δδ kk = VV kk PP kk QQ kk Two variables are inputs to the power-flow problem Known Two are outputs To be calculated Buses are categorized into three types depending on which quantities are inputs and which are outputs Slack bus (swing bus) Load bus (PQ bus) Voltage-controlled bus (PV bus)
Bus Types 16 Slack bus (swing bus): Reference bus Typically bus 1 Inputs are voltage magnitude, VV 1, and phase angle, δδ 1 Typically 1.0 0 Power, PP 1 and QQ 1, is computed Load bus (PPPP bus): Buses to which only loads are connected Real power, PP kk, and reactive power, QQ kk, are the knowns VV kk and δδ kk are calculated Majority of power system buses are load buses
Bus Types 17 Voltage-controlled bus (PPPP bus): Buses connected to generators Buses with shunt reactive compensation Real power, PP kk, and voltage magnitude, VV kk, are known inputs Reactive power, QQ kk, and voltage phase angle, δδ kk, are calculated
Solving the Power-Flow Problem 18 The power-flow solution involves determining: VV kk, δδ kk, PP kk, and QQ kk There are NN buses Each with two unknown quantities There are 2NN unknown quantities in total Need 2NN equations NN of these equations are the nodal equations II = YYYY The other NN equations are the power-balance equations (1) SS kk = PP kk + jjqq kk = VV kk II kk (2) From (1), the nodal equation for the kk ttt bus is II kk = NN nn=1 YY kkkk VV nn (3)
Solving the Power-Flow Problem 19 Substituting (3) into (2) gives PP kk + jjqq kk = VV kk NN nn=1 YY kkkk VV nn (4) The bus voltages in (3) and (4) are phasors, which we can represent as VV nn = VV nn ee jjδδ nn and VV kk = VV kk ee jjδδ kk (5) The admittances can also be written in polar form YY kkkk = YY kkkk ee jjθθ kkkk (6) Using (5) and (6) in (4) gives PP kk + jjqq kk = VV kk ee jjδδ kk NN nn=1 YY kkkk ee jjθθ kkkkvv nn ee jjδδ nn PP kk + jjqq kk = VV kk NN nn=1 YY kkkk VV nn ee jj δδ kk δδ nn θθ kkkk (7)
Solving the Power-Flow Problem 20 In Cartesian form, (7) becomes PP kk + jjqq kk = NN VV kk nn=1 YY kkkk VV nn [cos δδ kk δδ nn θθ kkkk +jj sin δδ kk δδ nn θθ kkkk ] (8) From (8), active power is PP kk = VV kk NN nn=1 YY kkkk VV nn cos δδ kk δδ nn θθ kkkk (9) And, reactive power is QQ kk = VV kk NN nn=1 YY kkkk VV nn sin δδ kk δδ nn θθ kkkk (10)
Solving the Power-Flow Problem 21 PP kk = VV kk NN nn=1 YY kkkk VV nn cos δδ kk δδ nn θθ kkkk (9) QQ kk = VV kk NN nn=1 YY kkkk VV nn sin δδ kk δδ nn θθ kkkk (10) Solving the power-flow problem amounts to finding a solution to a system of nonlinear equations, (9) and (10) Must be solved using numerical, iterative algorithms Typically Newton-Raphson In practice, commercial software packages are available for power-flow analysis E.g. PowerWorld, CYME, ETAP We ll now learn to solve the power-flow problem Numerical, iterative algorithm Newton-Raphson
Solving the Power-Flow Problem 22 First, we ll introduce a variety of numerical algorithms for solving equations and systems of equations Linear system of equations Direct solution Gaussian elimination Iterative solution Jacobi Gauss-Seidel Nonlinear equations Iterative solution Newton-Raphson Nonlinear system of equations Iterative solution Newton-Raphson
23 Linear Systems of Equations Direct Solution
Solving Linear Systems of Equations 24 Gaussian elimination Direct (i.e. non-iterative) solution Two parts to the algorithm: Forward elimination Back substitution
Gaussian Elimination 25 Consider a system of equations 4xx 1 + 7xx 3 = 5 2xx 1 3xx 2 + 5xx 3 = 12 xx 2 3xx 3 = 3 This can be expressed in matrix form: In general 4 0 7 2 3 5 0 1 3 AA xx = yy xx 1 xx 2 xx 3 = 5 12 3 For a system of three equations with three unknowns: AA 11 AA 12 AA 13 AA 21 AA 22 AA 23 AA 31 AA 32 AA 33 xx 1 xx 2 xx 3 = yy 1 yy 2 yy 3
Gaussian Elimination 26 We ll use a 3 3 system as an example to develop the Gaussian elimination algorithm AA 11 AA 12 AA 13 AA 21 AA 22 AA 23 AA 31 AA 32 AA 33 xx 1 xx 2 xx 3 = yy 1 yy 2 yy 3 First, create the augmented system matrix AA 11 AA 12 AA 13 yy 1 AA 21 AA 22 AA 23 yy 2 AA 31 AA 32 AA 33 yy 3 Each row represents and equation NN rows for NN equations Row operations do not affect the system Multiply a row by a constant Add or subtract rows from one another and replace row with the result
Gaussian Elimination Forward Elimination 27 Perform row operations to reduce the augmented matrix to upper triangular Only zeros below the main diagonal Eliminate xx ii from the ii + 1 st through the NN th equations for ii = 1 NN Forward elimination After forward elimination, we have AA 11 AA 12 AA 13 yy 1 0 AA 22 AA 23 yy 2 0 0 AA 33 yy 3 Where the prime notation (e.g. AA 22 ) indicates that the value has been changed from its original value
Gaussian Elimination Back Substitution 28 AA 11 AA 12 AA 13 yy 1 0 AA 22 AA 23 yy 2 0 0 AA 33 yy 3 The last row represents an equation with only a single unknown AA 33 xx 3 = yy 3 Solve for xx 3 xx3 = yy 3 AA 33 The second-to-last row represents an equation with two unknowns AA 22 xx 2 + AA 23 xx 3 Substitute in newly-found value of xx 3 Solve for xx 2 Substitute values for xx 2 and xx 3 into the first-row equation Solve for xx 1 This process is back substitution
Gaussian elimination 29 Gaussian elimination summary Create the augmented system matrix Forward elimination Reduce to an upper-triangular matrix Back substitution Starting with xx NN, solve for xx ii for ii = NN 1 A direct solution algorithm Exact value for each xx ii arrived at with a single execution of the algorithm Alternatively, we can use an iterative algorithm The Jacobi method
30 Linear Systems of Equations Iterative Solution
Jacobi Method 31 Consider a system of NN linear equations AA xx = yy AA 1,1 AA 1,NN AA NN,1 AA NN,NN The kk th equation (kk th row) is xx 1 xx NN = yy 1 yy NN AA kk,1 xx 1 + AA kk,2 xx 2 + + AA kk,kk xx kk + + AA kk,nn xx NN = yy kk (11) Solve (11) for xx kk xx kk = 1 AA kk,kk [yy kk (AA kk,1 xx 1 + AA kk,2 xx 2 + + AA kk,kk 1 xx kk 1 + (12) +AA kk,kk+1 xx kk+1 + + AA kk,nn xx NN )]
Jacobi Method 32 Simplify (12) using summing notation xx kk = 1 AA kk,kk kk 1 NN yy kk AA kk,nn xx nn AA kk,nn xx nn, kk = 1 NN nn=1 nn=kk+1 (13) An equation for xx kk But, of course, we don t yet know all other xx nn values Use (13) as an iterative expression xx kk,ii+1 = 1 AA kk,kk kk 1 NN yy kk AA kk,nn xx nn,ii AA kk,nn xx nn,ii, kk = 1 NN nn=1 nn=kk+1 (14) The ii subscript indicates iteration number xx kk,ii+1 is the updated value from the current iteration xx nn,ii is a value from the previous iteration
Jacobi Method 33 xx kk,ii+1 = 1 AA kk,kk kk 1 yy kk AA kk,nn xx nn,ii nn=1 NN AA kk,nn xx nn,ii, kk = 1 NN nn=kk+1 (14) Old values of xx nn, on the right-hand side, are used to update xx kk on the left-hand side Start with an initial guess for all unknowns, xx 0 Iterate until adequate convergence is achieved Until a specified stopping criterion is satisfied Convergence is not guaranteed
Convergence 34 An approximation of xx is refined on each iteration Continue to iterate until we re close to the right answer for the vector of unknowns, xx Assume we ve converged to the right answer when xx changes very little from iteration to iteration On each iteration, calculate a relative error quantity εε ii = max Iterate until xx kk,ii+1 xx kk,ii xx kk,ii, kk = 1 NN εε ii εε ss where εε ss is a chosen stopping criterion
Jacobi Method Matrix Form 35 The Jacobi method iterative formula, (14), can be rewritten in matrix form: (15) xx ii+1 = MMxx ii + DD 1 yy where DD is the diagonal elements of A AA 1,1 0 0 0 AA DD = 2,2 0 0 0 0 0 AA NN,NN and MM = DD 1 DD AA Recall that the inverse of a diagonal matrix is given by inverting each diagonal element 1/AA 1,1 0 0 DD 11 0 1/AA = 2,2 0 0 0 0 0 1/AA NN,NN (16)
Jacobi Method Example 36 Consider the following system of equations 4xx 1 + 7xx 3 = 5 2xx 1 3xx 2 + 5xx 3 = 12 xx 2 3xx 3 = 3 In matrix form: 4 0 7 2 3 5 0 1 3 xx 1 xx 2 xx 3 = Solve using the Jacobi method 5 12 3
Jacobi Method Example 37 The iteration formula is where DD = 4 0 0 0 3 0 0 0 3 MM = DD 1 DD AA = xx ii+1 = MMxx ii + DD 1 yy DD 1 = 0.25 0 0 0 0.333 0 0 0 0.333 0 0 1.75 0.667 0 1.667 0 0.333 0 To begin iteration, we need a starting point Initial guess for unknown values, xx Often, we have some idea of the answer Here, arbitrarily choose xx 0 = 10 25 10 TT
Jacobi Method Example 38 At each iteration, calculate xx ii+1 = MMxx ii + DD 1 yy xx 1,ii+1 xx 2,ii+1 xx 3,ii+1 = 0 0 1.75 0.667 0 1.667 0 0.333 0 xx 1,ii xx 2,ii xx 3,ii + 1.25 4 1 For ii = 1: xx 1 = xx 1,1 xx 2,1 xx 3,1 = 0 0 1.75 0.667 0 1.667 0 0.333 0 10 25 10 + 1.25 4 1 xx 1 = 18.75 27.33 7.33 TT The relative error is εε 1 = max xx kk,1 xx kk,0 xx kk,0 = 0.875
Jacobi Method Example 39 For ii = 2: xx 2 = xx 1,2 xx 2,2 xx 3,2 = 0 0 1.75 0.667 0 1.667 0 0.333 0 18.75 27.33 7.33 + 1.25 4 1 xx 2 = 14.08 28.72 8.11 TT The relative error is εε 2 = max xx kk,2 xx kk,1 xx kk,1 = 0.249 Continue to iterate until relative error falls below a specified stopping condition
Jacobi Method Example 40 Automate with computer code, e.g. MATLAB Setup the system of equations Initialize matrices and parameters for iteration
Jacobi Method Example 41 Loop to continue iteration as long as: Stopping criterion is not satisfied Maximum number of iterations is not exceeded On each iteration Use previous xx values to update xx Calculate relative error Increment the number of iterations
Jacobi Method Example 42 Set εε ss = 1 10 6 and iterate: ii xx ii εε ii 0 10 25 10 TT - 1 18.75 27.33 7.33 TT 0.875 2 14.08 28.72 8.11 TT 0.249 3 15.44 26.91 8.57 TT 0.097 4 16.25 28.59 7.97 TT 0.071 5 15.20 28.12 8.53 TT 0.070 6 16.18 28.35 8.37 TT 0.065 371 20.50 36.00 11.00 TT 0.995 10-6 Convergence achieved in 371 iterations
Gauss-Seidel Method 43 The iterative formula for the Jacobi method is xx kk,ii+1 = 1 AA kk,kk kk 1 NN yy kk AA kk,nn xx nn,ii AA kk,nn xx nn,ii, kk = 1 NN nn=1 nn=kk+1 (14) Note that only old values of xx nn (i.e. xx nn,ii ) are used to update the value of xx kk Assume the xx kk,ii+1 values are determined in order of increasing kk When updating xx kk,ii+1, all xx nn,ii+1 values are already known for nn < kk We can use those updated values to calculate xx kk,ii+1 The Gauss-Seidel method
Gauss-Seidel Method 44 Now use the xx nn values already updated on the current iteration to update xx kk That is, xx nn,ii+1 for nn < kk Gauss-Seidel iterative formula xx kk,ii+1 = 1 AA kk,kk kk 1 NN yy kk AA kk,nn xx nn,ii+1 AA kk,nn xx nn,ii, kk = 1 NN nn=1 nn=kk+1 (17) Note that only the first summation has changed For already updated xx values xx nn for nn < kk Number of already-updated values used depends on kk
Gauss-Seidel Matrix Form 45 In matrix form the iterative formula is the same as for the Jacobi method where, again xx ii+1 = MMxx ii + DD 1 yy MM = DD 1 DD AA but now DD is the lower triangular part of AA DD = AA 1,1 0 0 AA 2,1 AA 2,2 0 0 AA NN,1 AA NN,2 AA NN,NN (15) (16) Otherwise, the algorithm and computer code is identical to that of the Jacobi method
Gauss-Seidel Example 46 Apply Gauss-Seidel to our previous example xx 0 = 10 25 10 TT εε ss = 1 10 6 ii xx ii εε ii 0 10 25 10 TT - 1 18.75 33.17 10.06 TT 0.875 2 18.85 33.32 10.11 TT 0.005 3 18.94 33.47 10.16 TT 0.005 4 19.03 33.61 10.20 TT 0.005 151 20.50 36.00 11.00 TT 0.995 10-6 Convergence achieved in 151 iterations Compared to 371 for the Jacobi method
47 Nonlinear Equations
Nonlinear Equations 48 Solution methods we ve seen so far work only for linear equations Now, we introduce an iterative method for solving a single nonlinear equation Newton-Raphson method Next, we ll apply the Newton-Raphson method to a system of nonlinear equations Finally, we ll use Newton-Raphson to solve the power-flow problem
Newton-Raphson Method 49 Want to solve yy = ff(xx) where ff xx is a nonlinear function That is, we want to find xx, given a known nonlinear function, ff, and a known output, yy Newton-Raphson method Based on a first-order Taylor series approximation to ff xx The nonlinear ff xx is approximated as linear to update our approximation to the solution, xx, on each iteration
Taylor Series Approximation 50 Taylor series approximation Given: A function, ff xx Value of the function at some value of xx, ff xx 0 Approximate: Value of the function at some other value of xx First-order Taylor series approximation Approximate ff xx using only its first derivative ff xx approximated as linear constant slope yy = ff xx ff xx 0 + dddd dddd xx=xx 0 xx xx 0 = yy
First-Order Taylor Series Approximation 51 Approximate value of the function at xx ff xx yy = ff xx 0 + ff xx 0 xx xx 0
Newton-Raphson Method 52 First order Taylor series approximation is yy ff xx 0 + ff xx 0 xx xx 0 Letting this be an equality and rearranging gives an iterative formula for updating an approximation to xx yy = ff xx ii + ff xx ii xx ii+1 xx ii ff xx ii xx ii+1 xx ii = yy ff xx ii xx ii+1 = xx ii + 1 ff xx ii yy ff xx ii (18) Initialize with a best guess at xx, xx 0 Iterate (18) until A stopping criterion is satisfied, or The maximum number of iterations is reached
First-Order Taylor Series Approximation 53 xx ii+1 = xx ii + 1 ff xx ii yy ff xx ii Now using the Taylor series approximation in a different way Not approximating the value of y = f(x) at x, but, instead Approximating the value of x where f(x) = y
Newton-Raphson Example 54 Consider the following nonlinear equation yy = ff xx = xx 3 + 10 = 20 Apply Newton-Raphson to solve Find xx, such that yy = ff xx = 20 The derivative function is Initial guess for xx ff xx = 3xx 2 xx 0 = 1 Iterate using the formula given by (18)
Newton-Raphson Example 55 ii = 1: xx 1 = xx 0 + ff xx 0 1 yy ff xx 0 xx 1 = 1 + 3 1 2 1 20 1 3 + 10 xx 1 = 4 εε 1 = xx 1 xx 0 xx 0 εε 1 = 4 1 1 = 3 xx 1 = 4, εε 1 = 3
Newton-Raphson Example 56 ii = 2: xx 2 = xx 1 + ff xx 1 1 yy ff xx 1 xx 2 = 4 + 3 4 2 1 20 4 3 + 10 xx 2 = 2.875 εε 2 = xx 2 xx 1 xx 1 εε 2 = 2.875 4 4 εε 2 = 0.281 xx 2 = 2.875, εε 2 = 0.281
Newton-Raphson Example 57 ii = 3: xx 3 = xx 2 + ff xx 2 1 yy ff xx 2 xx 3 = 2.875 + 3 2.875 2 1 20 2.875 3 + 10 xx 3 = 2.32 εε 3 = xx 3 xx 2 xx 2 εε 3 = 2.32 2.875 2.875 εε 3 = 0.193 xx 3 = 2.32, εε 3 = 0.193
Newton-Raphson Example 58 ii = 4: ii = 5: ii = 6: ii = 7: xx 4 = 2.166, εε 4 = 0.066 xx 5 = 2.155, εε 5 = 0.005 xx 6 = 2.154, εε 6 = 28.4 10 6 xx 7 = 2.154, εε 7 = 0.808 10 9 Convergence achieved very quickly Next, we ll see how to apply Newton-Raphson to a system of nonlinear equations
59 Nonlinear Systems of Equations
Nonlinear Systems of Equations 60 Now, consider a system of nonlinear equations Can be represented as a vector of NN functions Each is a function of an NN-vector of unknown variables yy = yy 1 yy 2 yy NN = ff xx = ff 1 xx 1, xx 2,, xx NN ff 2 xx 1, xx 2,, xx NN ff NN xx 1, xx 2,, xx NN We can again approximate this function using a first-order Taylor series yy = ff xx ff xx 0 + ff xx 0 xx xx 0 (19) Note that all variables are NN-vectors ff is an NN-vector of known, nonlinear functions xx is an NN-vector of unknown values this is what we want to solve for yy is an NN-vector of known values xx 00 is an NN-vector of xx values for which ff xx 0 is known
Newton-Raphson Method 61 Equation (19) is the basis for our Newton-Raphson iterative formula Again, let it be an equality and solve for xx yy ff xx 0 = ff xx 0 xx xx 0 ff xx 11 0 yy ff xx 0 = xx xx 0 xx = xx 0 + ff xx 11 0 yy ff xx 0 This last expression can be used as an iterative formula xx ii+1 = xx ii + ff xx ii 11 yy ff xx ii The derivative term on the right-hand side of (20) is an NN NN matrix The Jacobian matrix, JJ xx ii+1 = xx ii + JJ ii 11 yy ff xx ii (20)
The Jacobian Matrix 62 xx ii+1 = xx ii + JJ ii 11 yy ff xx ii (20) Jacobian matrix NN NN matrix of partial derivatives for ff xx Evaluated at the current value of xx, xx ii JJ ii = ff 1 ff 1 ff 1 xx 1 xx 2 xx NN ff 2 ff 2 ff 2 xx 1 xx 2 xx NN ff NN ff NN ff NN xx 1 xx 2 xx NN xx=xx ii
Newton-Raphson Method 63 xx ii+1 = xx ii + JJ ii 11 yy ff xx ii We could iterate (20) until convergence or a maximum number of iterations is reached Requires inversion of the Jacobian matrix Computationally expensive and error prone Instead, go back to the Taylor series approximation (20) yy = ff xx ii yy ff xx ii + JJ ii xx ii+1 xx ii = JJ ii xx ii+1 xx ii Left side of (21) represents a difference between the known and approximated outputs Right side represents an increment of the approximation for xx (21) Δyy ii = JJ ii Δxx ii (22)
Newton-Raphson Method 64 Δyy ii = JJ ii Δxx ii (22) On each iteration: Compute Δyy ii and JJ ii Solve for Δxx ii using Gaussian elimination Matrix inversion not required Computationally robust Update xx xx ii+1 = xx ii + Δxx ii (23)
Newton-Raphson Example 65 Apply Newton-Raphson to solve the following system of nonlinear equations ff xx = yy xx 1 2 + 3xx 2 xx 1 xx 2 = 21 12 2 TT Initial condition: xx 0 = 1 Stopping criterion: εε ss = 1 10 6 Jacobian matrix JJ ii = ff 1 ff 1 xx 1 xx 2 = ff 2 ff 2 xx 1 xx 2 xx=xx ii 2xx 1,ii 3 xx 2,ii xx 1,ii
Newton-Raphson Example 66 Δyy ii = JJ ii Δxx ii xx ii+1 = xx ii + Δxx ii (22) (23) Adjusting the indexing, we can equivalently write (22) and (23) as: Δyy ii 1 = JJ ii 1 Δxx ii 1 xx ii = xx ii 1 + Δxx ii 1 (22) (23) For iteration ii: Compute Δyy ii 1 and JJ ii 1 Solve (22) for Δxx ii 1 Update xx using (23)
Newton-Raphson Example 67 ii = 1: Δyy 0 = yy ff xx 0 = 21 12 7 2 = 14 10 JJ 0 = 2xx 1,0 3 xx 2,0 xx = 2 3 1,0 2 1 Δxx 0 = 4 2 xx 1 = xx 0 + Δxx 0 = 1 2 + 4 2 = 5 4 εε 1 = max xx kk,1 xx kk,0 xx kk,0, kk = 1 NN xx 1 = 5 4, εε 1 = 4
Newton-Raphson Example 68 ii = 2: Δyy 1 = yy ff xx 1 = 21 12 37 20 = 16 8 JJ 1 = 2xx 1,1 3 xx 2,1 xx = 10 3 1,1 4 5 Δxx 1 = 1.474 0.421 xx 2 = xx 1 + Δxx 1 = 5 4 + 1.474 0.421 = 3.526 3.579 εε 2 = max xx kk,2 xx kk,1 xx kk,1, kk = 1 NN xx 2 = 3.526 3.579, εε 2 = 0.295
Newton-Raphson Example 69 ii = 3: Δyy 2 = yy ff xx 2 = 21 12 23.172 12.621 = 2.172 0.621 JJ 2 = 2xx 1,2 3 xx 2,2 xx = 7.053 3 1,2 3.579 3.526 Δxx 2 = 0.410 0.240 xx 3 = xx 2 + Δxx 2 = 3.526 3.579 + 0.410 0.240 = 3.116 3.819 εε 3 = max xx kk,3 xx kk,2 xx kk,2, kk = 1 NN xx 3 = 3.116 3.819, εε 3 = 0.116
Newton-Raphson Example 70 ii = 7: Δyy 6 = yy ff xx 6 = 21 12 21.000 12.000 JJ 6 = 2xx 1,6 3 xx 2,6 xx 1,6 = 6.000 3 4.000 3.000 = 0.527 10 7 0.926 10 7 Δxx 6 = 0.073 10 6 0.128 10 6 xx 7 = xx 6 + Δxx 6 = 3.000 4.000 + 0.073 10 6 3.000 0.128 10 6 = 4.000 εε 7 = max xx kk,7 xx kk,6 xx kk,6, kk = 1 NN xx 7 = 3.000 4.000, εε 7 = 31.9 10 9
Newton-Raphson MATLAB Code 71 Define the system of equations Initialize xx Set up solution parameters
Newton-Raphson MATLAB Code 72 Iterate: Compute Δyy ii 1 and JJ ii 1 Solve for Δxx ii 1 Update xx
73 Solving the Power-Flow Problem
Solving the Power-Flow Problem - Overview 74 Consider an NN-bus power-flow problem 1 slack bus nn PPPP PV buses nn PPPP PQ buses NN = nn PPPP + nn PPPP + 1 Each bus has two unknown quantities Two of VV kk, δδ kk, PP kk, and QQ kk For the N-R power-flow problem, VV kk and δδ kk are the unknown quantities These are the inputs to the nonlinear system of equations the PP kk and QQ kk equations of (9) and (10) Finding unknown VV kk and δδ kk values allows us to determine unknown PP kk and QQ kk values
Solving the Power-Flow Problem - Overview 75 The nonlinear system of equations is yy = ff(xx) The unknowns, xx, are bus voltages Unknown phase angles from PV and PQ buses Unknown magnitudes from PQ bus xx = δδ VV = δδ 2 δδ nnpppp +nn PPPP +1 VV nnpppp +2 VV nnpppp +nn PPPP +1 nn PPPP + nn PPPP nn PPPP (24)
Solving the Power-Flow Problem - Overview 76 yy = ff(xx) The knowns, yy, are bus powers Known real power from PV and PQ buses Known reactive power from PQ bus yy = PP QQ = PP 2 PP nnpppp +nn PPPP +1 QQ nnpppp +2 QQ nnpppp +nn PPPP +1 nn PPPP + nn PPPP nn PPPP (25)
Solving the Power-Flow Problem - Overview 77 yy = ff(xx) The system of equations, ff, consists of the nonlinear functions for PP and QQ Nonlinear functions of VV and δδ ff(xx) = PP(xx) QQ(xx) = PP 2 xx QQ nnpppp +2 xx nn PPPP + nn PPPP nn PPPP (26)
Solving the Power-Flow Problem - Overview 78 PP kk xx and QQ kk xx are given by NN PP kk = VV kk nn=1 NN QQ kk = VV kk nn=1 YY kkkk VV nn cos δδ kk δδ nn θθ kkkk YY kkkk VV nn sin δδ kk δδ nn θθ kkkk (9) (10) Admittance matrix terms are YY kkkk = YY kkkk θθ kkkk
Solving the Power-Flow Problem - Overview 79 The iterative N-R formula is xx ii+1 = xx ii + Δxx ii The increment term, Δxx ii, is computed through Gaussian elimination of Δyy ii = JJ ii Δxx ii The Jacobian, JJ ii, is computed on each iteration The power mismatch vector is Δyy ii = yy ff xx ii yy is the vector of known powers, as given in (25) ff xx ii are the PP and QQ equations given by (9) and (10)
Solving the Power-Flow Problem - Procedure 80 The following procedure shows how to set up and solve the power-flow problem using the N-R algorithm 1. Order and number buses Slack bus is #1 Group all PV buses together next Group all PQ buses together last 2. Generate the bus admittance matrix, YY And magnitude, Y = YY, and angle, θ = YY, matrices
Solving the Power-Flow Problem - Procedure 81 3. Initialize known quantities Slack bus: VV 1 and δδ 1 PV buses: VV kk and PP kk PQ buses: PP kk and QQ kk Output vector: yy = PP QQ 4. Initialize unknown quantities xx oo = δδ 00 VV 00 = 0 0 1.0 1.0 nn PPPP + nn PPPP nn PPPP (24)
Solving the Power-Flow Problem - Procedure 82 5. Set up Newton-Raphson parameters Tolerance for convergence, reltol Maximum # of iterations, max_iter Initialize relative error: εε 0 > reltol, e.g. εε 0 = 10 Initialize iteration counter: ii = 0 6. while (εε > reltol) && (ii < max_iter) Update bus voltage phasor vector, VV ii, using magnitude and phase values from xx ii and from knowns Calculate the current injected into each bus, a vector of phasors II ii = YY VV ii
Solving the Power-Flow Problem - Procedure 83 6. while (εε > reltol) && (ii < max_iter) cont d Calculate complex, real, and reactive power injected into each bus This can be done using VV ii and II ii vectors and element-by-element multiplication (the.* operator in MATLAB) SS kk,ii = VV kk,ii II kk,ii PP kk,ii = RRRR SS kk,ii QQ kk,ii = IIII SS kk,ii Create ff xx ii from PP ii and QQ ii vectors Calculate power mismatch, Δyy ii Δyy ii = yy ff xx ii Compute the Jacobian, JJ ii, using voltage magnitudes and phase angles from VV ii
Solving the Power-Flow Problem - Procedure 84 6. while (εε > reltol) && (ii < max_iter) cont d Solve for Δxx ii using Gaussian elimination Δyy ii = JJ ii Δxx ii Use the mldivide (\, backslash) operator in MATLAB: Δxx ii = JJ ii \Δyy ii Update xx xx ii+1 = xx ii + Δxx ii Check for convergence using power mismatch εε ii+1 = max yy kk ff kk xx yy kk Update the number of iterations ii = ii + 1
The Jacobian Matrix 85 The Jacobian matrix has four quadrants of varying dimension depending on the number of different types of buses: nn PPPP + nn PPPP nn PPPP PP PP JJ = δδ JJ1 VV JJ2 nn PPPP + nn PPPP QQ δδ QQ VV nn PPPP JJ3 JJ4
The Jacobian Matrix 86 Jacobian elements are partial derivatives of (9) and (10) with respect to δδ or VV Formulas for the Jacobian elements: nn kk JJ1 kkkk = PP kk δδ nn = VV kk YY kkkk VV nn sin δδ kk δδ nn θθ kkkk (27) JJ2 kkkk = PP kk VV nn = VV kk YY kkkk cos δδ kk δδ nn θθ kkkk (28) JJ3 kkkk = QQ kk δδ nn = VV kk YY kkkk VV nn cos δδ kk δδ nn θθ kkkk (29) JJ4 kkkk = QQ kk VV nn = VV kk YY kkkk sin δδ kk δδ nn θθ kkkk (30)
The Jacobian Matrix 87 Formulas for the Jacobian elements, cont d: nn = kk NN JJ1 kkkk = PP kk δδ kk = VV kk nn=1 nn kk YY kknn VV nn sin δδ kk δδ nn θθ kkkk (31) JJ2 kkkk = PP kk VV kk = VV kk YY kkkk cos θθ kkkk NN + YY kknn VV nn cos δδ kk δδ nn θθ kkkk nn=1 (32) JJ3 kkkk = QQ NN kk = VV δδ kk YY kknn VV nn cos δδ kk δδ nn θθ kkkk kk nn=1 nn kk (33) JJ4 kkkk = QQ kk VV kk = VV kk YY kkkk sin θθ kkkk NN + YY kkkk VV nn sin δδ kk δδ nn θθ kkkk nn=1 (34)
88 Power-Flow Solution Example
Power-Flow Solution Buses 89 Determine all bus voltages and power flows for the following threebus power system Three buses, nn PPPP = 1, nn PPPP = 1, ordered PV first, then PQ: Bus 1: slack bus VV 1 and δδ 1 are known, find PP 1 and QQ 1 Bus 2: PV bus PP 2 and VV 2 are known, find δδ 2 and QQ 2 Bus 3: PQ bus PP 3 and QQ 3 are known, find VV 3 and δδ 3
Power-Flow Solution Admittance Matrix 90 Per-unit, per-length impedance of all transmission lines: zz = 31.1 + jjjjj 10 6 pppp/kkkk Admittance of each line: 1 YY 12 = YY 23 = = 2.06 jjjj.9 pppp zz 150 kkkk 1 YY 13 = = 1.54 jj15.7 pppp zz 200 kkkk
Power-Flow Solution Admittance Matrix 91 The admittance matrix (see p. 8): YY = YY 11 YY 12 YY 13 YY 21 YY 22 YY 23 = YY 31 YY 32 YY 33 3.6 jjjj.6 2.06 + jjjj.9 1.5 + jjjj.7 2.06 + jjjj.9 4.1 jjjj.8 2.06 + jjjj.9 1.5 + jjjj.7 2.06 + jjjj.9 3.6 jjjj.6 Admittance magnitude and angle matrices: Y = YY = 36.8 21.0 15.8 21.0 42.0 21.0 15.8 21.0 36.8, θθ = 84.4 95.6 95.6 95.6 84.4 95.6 95.6 95.6 84.4
Power-Flow Solution Initialize Knowns 92 Known quantities Slack bus: VV 1 = 1.0 pppp, δδ 1 = 0 PV bus: VV 2 = 1.05 pppp, PP 2 = 2.0 pppp PQ bus: PP 3 = 5.0 pppp, QQ 3 = 1.0 pppp Output vector yy = PP QQ = PP 2 PP 3 QQ 3 = 2.0 5.0 1.0
Power-Flow Solution Initialize Unknowns 93 The vector of unknown quantities to be solved for is xx = δδ VV = δδ 2 δδ 3 VV 3 Initialize all unknown bus voltage phasors to VV kk = 1.0 0 pppp xx 0 = δδ 0 VV 0 = δδ 2,0 δδ 3,0 VV 3,0 = 0 0 1.0 The complete vector of bus voltage phasors partly known, partly unknown is VV = VV 1 δδ 1 VV 2 δδ 2 VV 3 δδ 3 = 1.0 0 1.05 δδ 2,0 VV 3,0 δδ 3,0 = 1.0 0 1.05 0 1.0 0
Power-Flow Solution Jacobian Matrix 94 The Jacobian matrix for this system is JJ = PP 2 δδ 2 PP 2 δδ 3 PP 2 VV 3 PP 3 δδ 2 PP 3 δδ 3 PP 3 VV 3 QQ 3 δδ 2 QQ 3 δδ 3 QQ 3 VV 3 This matrix will be computed on each iteration using the current approximation to the vector of unknowns, xx ii
Power-Flow Solution Set Up and Iterate 95 Set up N-R iteration parameters reltol = 1e-6 max_iter = 1e3 εε 0 = 10 ii = 0 Iteratively update the approximation to the vector of unknowns as long as Stopping criterion is not satisfied εε ii > εε ss Maximum number of iterations is not exceeded ii mmmmmm _iiiiiiii
Power-Flow Solution Iterate 96 ii = 0: Vector of bus voltage phasors VV 0 = VV 1 δδ 1 VV 2 δδ 2,0 VV 3,0 δδ 3,0 = 1.0 0 1.05 0 1.0 0 Current injected into each bus II 0 = II 0 = YY VV 0 3.6 jjjj.6 2.1 + jjjj.9 1.5 + jjjj.7 2.1 + jjjj.9 4.1 jjjj.8 2.1 + jjjj.9 1.5 + jjjj.7 2.1 + jjjj.9 3.6 jjjj.6 1.0 0 1.05 0 1.0 0 II 0 = 1.05 95.6 2.10 84.4 1.05 95.6
Power-Flow Solution Iterate 97 ii = 0: Complex power injected into each bus SS 0 = VV 0. II 0 SS 0 = SS 0 = 1.0 0 1.05 0 1.0 0. 0.103 jjj.045 0.216 + jjj.195 0.103 jjj.045 1.05 95.6 2.10 84.4 1.05 95.6 Real and reactive power 0.103 PP 0 = 0.216 0.103, QQ 0 = 1.045 2.195 1.045
Power-Flow Solution Iterate 98 ii = 0: Power mismatch Δyy 0 = yy ff xx 0 Δyy 0 = 2.0 5.0 1.0 0.216 0.103 1.045 Next, compute the Jacobian matrix = 1.784 4.897 0.045 JJ 0 = PP 2 δδ 2 PP 2 δδ 3 PP 2 VV 3 PP 3 δδ 2 PP 3 δδ 3 PP 3 VV 3 QQ 3 δδ 2 QQ 3 δδ 3 QQ 3 VV 3 xx=xx 0
Power-Flow Solution Iterate 99 ii = 0: Elements of the Jacobian matrix are computed using VV and δδ values from VV 0 and YY and θθ values from YY: VV 0 = δδ 0 = YY = θθ = 1.0 1.05 1.0 0 0 0 36.8 21.0 15.8 21.0 42.0 21.0 15.8 21.0 36.8 84.4 95.6 95.6 95.6 84.4 95.6 95.6 95.6 84.4
Power-Flow Solution Iterate 100 ii = 0: Jacobian, JJ1 PP 2 δδ 2 = VV 2 YY 21 VV 1 sin δδ 2 δδ 1 θθ 21 + YY 23 VV 3 sin δδ 2 δδ 3 θθ 23 PP 3 δδ 3 = VV 3 YY 31 VV 1 sin δδ 3 δδ 1 θθ 31 + YY 32 VV 2 sin δδ 3 δδ 2 θθ 32 PP 2 δδ 3 = VV 2 YY 23 VV 3 sin δδ 2 δδ 3 θθ 23 PP 3 δδ 2 = VV 3 YY 32 VV 2 sin δδ 3 δδ 2 θθ 32
Power-Flow Solution Iterate 101 ii = 0: Jacobian, JJ2 PP 2 VV 3 = VV 2 YY 23 cos δδ 2 δδ 3 θθ 23 PP 3 VV 3 = 2 VV 3 YY 33 cos θθ 33 + Jacobian, JJ3 YY 31 VV 1 cos δδ 3 δδ 1 θθ 31 + YY 32 VV 2 cos δδ 3 δδ 2 θθ 32 QQ 3 δδ 2 = VV 3 YY 32 VV 2 cos δδ 3 δδ 2 θθ 32 QQ 3 δδ 3 = VV 3 YY 31 VV 1 cos δδ 3 δδ 1 θθ 31 + YY 32 VV 2 cos δδ 3 δδ 2 θθ 32
Power-Flow Solution Iterate 102 ii = 0: Jacobian, JJ4 PP 2 VV 3 = VV 2 YY 23 cos δδ 2 δδ 3 θθ 23 QQ 3 VV 3 = VV 3 YY 33 cos θθ 33 + YY 31 VV 1 cos δδ 3 δδ 1 θθ 31 + YY 32 VV 2 cos δδ 3 δδ 2 θθ 32 Evaluating the Jacobian expressions using VV and δδ values from VV 0 and YY and θθ values from YY, gives JJ 0 = 43.89 21.95 2.160 21.95 37.62 3.497 2.160 3.702 35.53
Power-Flow Solution Iterate 103 ii = 0: Use Gaussian elimination to solve for Δxx 0 Δyy 0 = JJ 0 Δxx 0 = Δxx 0 = 0.0345 0.1492 0.0122 43.89 21.95 2.160 21.95 37.62 3.497 2.160 3.702 35.53 Update the vector of unknowns, xx Δxx 1,0 Δxx 2,0 Δxx 3,0 = 1.784 4.897 0.045 xx 1 = xx 0 + Δxx 0 = 0 0 1.0 + 0.0345 0.1492 0.0122 = 0.0345 0.1492 0.9878
Power-Flow Solution Iterate 104 ii = 0: Use power mismatch to check for convergence εε 0 = max yy kk ff kk xx yy kk = 0.9794 Move on to the next iteration, ii = 1 Create VV 1 using xx 1 values Calculate II 1 Calculate SS 1, PP 1, QQ 1 Create ff xx 1 from PP 1 and QQ 1 Calculate Δyy 1, JJ 1, Δxx 1 Update xx to xx 2 Check for convergence
Power-Flow Solution 105 Convergence is achieved after four iterations VV 4 = 1.0 0 1.1 2.1 0.97 8.8, SS 4 = 3.08 jjj.82 2.0 + jjj.67 5.0 jjj.0 εε 4 = 0.41 10 6