ESE 470 – Energy Distribution Systems
SECTION 5: POWER FLOW
K. Webb ESE 470
Introduction
2
K. Webb ESE 470
Nodal Analysis
 Consider the following circuit
 Three voltage sources
 𝑉𝑉𝑠𝑠𝑠, 𝑉𝑉𝑠𝑠𝑠, 𝑉𝑉𝑠𝑠𝑠
 Generic branch impedances
 Could be any combination of R, L, and C
 Three unknown node voltages
 𝑉𝑉1, 𝑉𝑉2, and 𝑉𝑉3
 Would like to analyze the circuit
 Determine unknown node voltages
 One possible analysis technique is nodal analysis
3
K. Webb ESE 470
Nodal Analysis
 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 𝑉𝑉1, we have
𝑉𝑉1 − 𝑉𝑉𝑠𝑠𝑠
𝑍𝑍𝑠𝑠𝑠
+
𝑉𝑉1 − 𝑉𝑉2
𝑍𝑍1
= 0
 Every current term includes division
by an impedance
 Easier to work with admittances instead
4
K. Webb ESE 470
Nodal Analysis
 Now our first nodal equation becomes
𝑉𝑉1 − 𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠 + 𝑉𝑉1 − 𝑉𝑉2 𝑌𝑌1 = 0
where
𝑌𝑌𝑠𝑠𝑠 = 1/𝑍𝑍𝑠𝑠𝑠 and 𝑌𝑌1 = 1/𝑍𝑍1
 Rearranging to place all unknown node voltages on the left and all
source terms on the right
𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌1 𝑉𝑉1 − 𝑌𝑌1𝑉𝑉2 = 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠
 Applying KCL at node 𝑉𝑉2
𝑉𝑉2 − 𝑉𝑉1 𝑌𝑌1 + 𝑉𝑉2𝑌𝑌2 + 𝑉𝑉2 − 𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠 + 𝑉𝑉2 − 𝑉𝑉3 𝑌𝑌3 = 0
5
K. Webb ESE 470
Nodal Analysis
 Rearranging
−𝑌𝑌1𝑉𝑉1 + 𝑌𝑌1 + 𝑌𝑌2 + 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌3 𝑉𝑉2 − 𝑌𝑌3𝑉𝑉3 = 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠
 Finally, applying KCL at node 𝑉𝑉3, gives
𝑉𝑉3 − 𝑉𝑉2 𝑌𝑌3 + 𝑉𝑉3 − 𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠 = 0
−𝑌𝑌3𝑉𝑉2 + 𝑌𝑌3 + 𝑌𝑌𝑠𝑠𝑠 𝑉𝑉3 = 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠
 Note that the source terms are the Norton equivalent
current sources (short-circuit currents) associated with each
voltage source
6
K. Webb ESE 470
Nodal Analysis
 Putting the nodal equations into matrix form
𝑌𝑌𝑠𝑠1 + 𝑌𝑌𝑌 −𝑌𝑌1 0
−𝑌𝑌1 𝑌𝑌1 + 𝑌𝑌2 + 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌3 −𝑌𝑌3
0 −𝑌𝑌3 𝑌𝑌3 + 𝑌𝑌𝑠𝑠𝑠
𝑉𝑉1
𝑉𝑉2
𝑉𝑉3
=
𝑌𝑌𝑠𝑠1𝑉𝑉𝑠𝑠1
𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠
𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠
or
𝒀𝒀𝒀𝒀 = 𝑰𝑰
where
 𝒀𝒀 is the 𝑁𝑁 × 𝑁𝑁 admittance matrix
 𝑰𝑰 is an 𝑁𝑁 × 1 vector of known source currents
 𝑽𝑽 is an 𝑁𝑁 × 1 vector of unknown node voltages
 This is a system of 𝑁𝑁 (here, three) linear equations with 𝑁𝑁
unknowns
 We can solve for the vector of unknown voltages as
𝑽𝑽 = 𝒀𝒀−1
𝑰𝑰
7
K. Webb ESE 470
The Admittance Matrix, 𝒀𝒀
 Take a closer look at the form of the admittance matrix, 𝒀𝒀
𝑌𝑌𝑠𝑠1 + 𝑌𝑌𝑌 −𝑌𝑌1 0
−𝑌𝑌1 𝑌𝑌1 + 𝑌𝑌2 + 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌3 −𝑌𝑌3
0 −𝑌𝑌3 𝑌𝑌3 + 𝑌𝑌𝑠𝑠𝑠
=
𝑌𝑌11 𝑌𝑌12 𝑌𝑌13
𝑌𝑌21 𝑌𝑌22 𝑦𝑦23
𝑌𝑌31 𝑌𝑌32 𝑌𝑌33
 The elements of 𝒀𝒀 are
 Diagonal elements, 𝑌𝑌𝑘𝑘𝑘𝑘:
 𝑌𝑌𝑘𝑘𝑘𝑘 = sum of all admittances connected to node 𝑘𝑘
 Self admittance or driving-point admittance
 Off-diagonal elements, 𝑌𝑌𝑘𝑘𝑘𝑘 (𝑘𝑘 ≠ 𝑛𝑛):
 𝑌𝑌𝑘𝑘𝑘𝑘 = −(total admittance between nodes 𝑘𝑘 and 𝑛𝑛)
 Mutual admittance or transfer admittance
 Note that, because the network is reciprocal, 𝒀𝒀 is symmetric
8
K. Webb ESE 470
Nodal Analysis
 Nodal analysis allows us to solve for unknown voltages
given circuit admittances and current (Norton
equivalent) inputs
 An application of Ohm’s law
𝒀𝒀𝒀𝒀 = 𝑰𝑰
 A linear equation
 Simple, algebraic solution
 For power-flow analysis, things get a bit more
complicated
9
K. Webb ESE 470
Power-Flow Analysis
10
K. Webb ESE 470
The Power-Flow Problem
 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 𝒀𝒀𝒀𝒀 = 𝑰𝑰
 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
11
K. Webb ESE 470
System One-Line Diagram
 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
12
K. Webb ESE 470
Bus Variables
 The buses are the system nodes
 Four variables associated with each bus, 𝑘𝑘
 Voltage magnitude, 𝑉𝑉𝑘𝑘
 Voltage phase angle, 𝛿𝛿𝑘𝑘
 Real power delivered to the bus, 𝑃𝑃𝑘𝑘
 Reactive power delivered to the bus, 𝑄𝑄𝑘𝑘
13
K. Webb ESE 470
Bus Power
 Net power delivered to bus 𝑘𝑘 is the difference between power
flowing from generators to bus 𝑘𝑘 and power flowing from bus 𝑘𝑘 to
loads
𝑃𝑃𝑘𝑘 = 𝑃𝑃𝐺𝐺𝐺𝐺 − 𝑃𝑃𝐿𝐿𝐿𝐿
𝑄𝑄𝑘𝑘 = 𝑄𝑄𝐺𝐺𝐺𝐺 − 𝑄𝑄𝐿𝐿𝐿𝐿
 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, 𝒀𝒀𝑏𝑏𝑏𝑏𝑏𝑏
𝐈𝐈 = 𝐘𝐘𝑏𝑏𝑏𝑏𝑏𝑏𝐕𝐕
 𝐘𝐘𝑏𝑏𝑏𝑏𝑏𝑏 contains the bus mutual and self admittances associated with
transmission lines and transformers
 For an 𝑁𝑁 bus system, 𝐕𝐕 is an 𝑁𝑁 × 1 vector of bus voltages
 𝐈𝐈 is an 𝑁𝑁 × 1 vector of source currents flowing into each bus
 From generators and loads
14
K. Webb ESE 470
Types of Buses
 There are four variables associated with each bus
 𝑉𝑉𝑘𝑘 = 𝑽𝑽𝑘𝑘
 𝛿𝛿𝑘𝑘 = ∠𝑽𝑽𝑘𝑘
 𝑃𝑃𝑘𝑘
 𝑄𝑄𝑘𝑘
 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)
15
K. Webb ESE 470
Bus Types
 Slack bus (swing bus):
 Reference bus
 Typically bus 1
 Inputs are voltage magnitude, 𝑉𝑉1, and phase angle, 𝛿𝛿1
 Typically 1.0∠0°
 Power, 𝑃𝑃1 and 𝑄𝑄1, is computed
 Load bus (𝑷𝑷𝑷𝑷 bus):
 Buses to which only loads are connected
 Real power, 𝑃𝑃𝑘𝑘, and reactive power, 𝑄𝑄𝑘𝑘, are the knowns
 𝑉𝑉𝑘𝑘 and 𝛿𝛿𝑘𝑘 are calculated
 Majority of power system buses are load buses
16
K. Webb ESE 470
Bus Types
 Voltage-controlled bus (𝑷𝑷𝑷𝑷 bus):
 Buses connected to generators
 Buses with shunt reactive compensation
 Real power, 𝑃𝑃𝑘𝑘, and voltage magnitude, 𝑉𝑉𝑘𝑘, are known
inputs
 Reactive power, 𝑄𝑄𝑘𝑘, and voltage phase angle, 𝛿𝛿𝑘𝑘, are
calculated
17
K. Webb ESE 470
Solving the Power-Flow Problem
 The power-flow solution involves determining:
 𝑉𝑉𝑘𝑘, 𝛿𝛿𝑘𝑘, 𝑃𝑃𝑘𝑘, and 𝑄𝑄𝑘𝑘
 There are 𝑁𝑁 buses
 Each with two unknown quantities
 There are 2𝑁𝑁 unknown quantities in total
 Need 2𝑁𝑁 equations
 𝑁𝑁 of these equations are the nodal equations
𝑰𝑰 = 𝒀𝒀𝒀𝒀 (1)
 The other 𝑁𝑁 equations are the power-balance equations
𝑺𝑺𝑘𝑘 = 𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑽𝑽𝑘𝑘𝑰𝑰𝑘𝑘
∗
(2)
 From (1), the nodal equation for the 𝑘𝑘𝑡𝑡𝑡
bus is
𝑰𝑰𝑘𝑘 = ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘𝑽𝑽𝑛𝑛 (3)
18
K. Webb ESE 470
Solving the Power-Flow Problem
 Substituting (3) into (2) gives
𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑽𝑽𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘𝑽𝑽𝑛𝑛
∗ (4)
 The bus voltages in (3) and (4) are phasors, which we can
represent as
𝑽𝑽𝑛𝑛 = 𝑉𝑉
𝑛𝑛𝑒𝑒𝑗𝑗𝛿𝛿𝑛𝑛 and 𝑽𝑽𝑘𝑘 = 𝑉𝑉𝑘𝑘𝑒𝑒𝑗𝑗𝛿𝛿𝑘𝑘 (5)
 The admittances can also be written in polar form
𝑌𝑌𝑘𝑘𝑘𝑘 = 𝑌𝑌𝑘𝑘𝑘𝑘 𝑒𝑒𝑗𝑗𝜃𝜃𝑘𝑘𝑘𝑘 (6)
 Using (5) and (6) in (4) gives
𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘𝑒𝑒𝑗𝑗𝛿𝛿𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑒𝑒𝑗𝑗𝜃𝜃𝑘𝑘𝑘𝑘𝑉𝑉
𝑛𝑛𝑒𝑒𝑗𝑗𝛿𝛿𝑛𝑛
∗
𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛𝑒𝑒𝑗𝑗 𝛿𝛿𝑘𝑘−𝛿𝛿𝑛𝑛−𝜃𝜃𝑘𝑘𝑘𝑘 (7)
19
K. Webb ESE 470
Solving the Power-Flow Problem
 In Cartesian form, (7) becomes
𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 =
𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 [cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
+𝑗𝑗 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 ] (8)
 From (8), active power is
𝑃𝑃𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (9)
 And, reactive power is
𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (10)
20
K. Webb ESE 470
Solving the Power-Flow Problem
𝑃𝑃𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (9)
𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (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
21
K. Webb ESE 470
Solving the Power-Flow Problem
 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
22
K. Webb ESE 470
Linear Systems of Equations –
Direct Solution
23
K. Webb ESE 470
Solving Linear Systems of Equations
 Gaussian elimination
 Direct (i.e. non-iterative) solution
 Two parts to the algorithm:
 Forward elimination
 Back substitution
24
K. Webb ESE 470
Gaussian Elimination
 Consider a system of equations
−4𝑥𝑥1 + 7𝑥𝑥3 = −5
2𝑥𝑥1 − 3𝑥𝑥2 + 5𝑥𝑥3 = −12
𝑥𝑥2 − 3𝑥𝑥3 = 3
 This can be expressed in matrix form:
−4 0 7
2 −3 5
0 1 −3
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
=
−5
−12
3
 In general
𝐀𝐀 ⋅ 𝐱𝐱 = 𝐲𝐲
 For a system of three equations with three unknowns:
𝐴𝐴11 𝐴𝐴12 𝐴𝐴13
𝐴𝐴21 𝐴𝐴22 𝐴𝐴23
𝐴𝐴31 𝐴𝐴32 𝐴𝐴33
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
=
𝑦𝑦1
𝑦𝑦2
𝑦𝑦3
25
K. Webb ESE 470
Gaussian Elimination
 We’ll use a 3×3 system as an example to develop the Gaussian elimination
algorithm
𝐴𝐴11 𝐴𝐴12 𝐴𝐴13
𝐴𝐴21 𝐴𝐴22 𝐴𝐴23
𝐴𝐴31 𝐴𝐴32 𝐴𝐴33
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
=
𝑦𝑦1
𝑦𝑦2
𝑦𝑦3
 First, create the augmented system matrix
𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 ⋮ 𝑦𝑦1
𝐴𝐴21 𝐴𝐴22 𝐴𝐴23 ⋮ 𝑦𝑦2
𝐴𝐴31 𝐴𝐴32 𝐴𝐴33 ⋮ 𝑦𝑦3
 Each row represents and equation
 𝑁𝑁 rows for 𝑁𝑁 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
26
K. Webb ESE 470
Gaussian Elimination – Forward Elimination
 Perform row operations to reduce the augmented
matrix to upper triangular
 Only zeros below the main diagonal
 Eliminate 𝑥𝑥𝑖𝑖 from the 𝑖𝑖 + 1 st through the 𝑁𝑁th equations for
𝑖𝑖 = 1 … 𝑁𝑁
 Forward elimination
 After forward elimination, we have
𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 ⋮ 𝑦𝑦1
0 𝐴𝐴22
′
𝐴𝐴23
′
⋮ 𝑦𝑦2
′
0 0 𝐴𝐴33
′
⋮ 𝑦𝑦3
′
 Where the prime notation (e.g. 𝐴𝐴22
′
) indicates that the value
has been changed from its original value
27
K. Webb ESE 470
Gaussian Elimination – Back Substitution
𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 ⋮ 𝑦𝑦1
0 𝐴𝐴22
′
𝐴𝐴23
′
⋮ 𝑦𝑦2
′
0 0 𝐴𝐴33
′
⋮ 𝑦𝑦3
′
 The last row represents an equation with only a single unknown
𝐴𝐴33
′
⋅ 𝑥𝑥3 = 𝑦𝑦3
′
 Solve for 𝑥𝑥3
𝑥𝑥3 =
𝑦𝑦3
′
𝐴𝐴33
′
 The second-to-last row represents an equation with two unknowns
𝐴𝐴22
′
⋅ 𝑥𝑥2 + 𝐴𝐴23
′
⋅ 𝑥𝑥3 = 𝑦𝑦2
′
 Substitute in newly-found value of 𝑥𝑥3
 Solve for 𝑥𝑥2
 Substitute values for 𝑥𝑥2 and 𝑥𝑥3 into the first-row equation
 Solve for 𝑥𝑥1
 This process is back substitution
28
K. Webb ESE 470
Gaussian elimination
 Gaussian elimination summary
 Create the augmented system matrix
 Forward elimination
 Reduce to an upper-triangular matrix
 Back substitution
 Starting with 𝑥𝑥𝑁𝑁, solve for 𝑥𝑥𝑖𝑖 for 𝑖𝑖 = 𝑁𝑁 … 1
 A direct solution algorithm
 Exact value for each 𝑥𝑥𝑖𝑖 arrived at with a single execution of
the algorithm
 Alternatively, we can use an iterative algorithm
 The Jacobi method
29
K. Webb ESE 470
Linear Systems of Equations –
Iterative Solution – Jacobi Method
30
K. Webb ESE 470
Jacobi Method
 Consider a system of 𝑁𝑁 linear equations
𝐀𝐀 ⋅ 𝐱𝐱 = 𝐲𝐲
𝐴𝐴1,1 ⋯ 𝐴𝐴1,𝑁𝑁
⋮ ⋱ ⋮
𝐴𝐴𝑁𝑁,1 ⋯ 𝐴𝐴𝑁𝑁,𝑁𝑁
𝑥𝑥1
⋮
𝑥𝑥𝑁𝑁
=
𝑦𝑦1
⋮
𝑦𝑦𝑁𝑁
 The 𝑘𝑘th equation (𝑘𝑘th row) is
𝐴𝐴𝑘𝑘,1𝑥𝑥1 + 𝐴𝐴𝑘𝑘,2𝑥𝑥2 + ⋯ + 𝐴𝐴𝑘𝑘,𝑘𝑘𝑥𝑥𝑘𝑘 + ⋯ + 𝐴𝐴𝑘𝑘,𝑁𝑁𝑥𝑥𝑁𝑁 = 𝑦𝑦𝑘𝑘 (11)
 Solve (11) for 𝑥𝑥𝑘𝑘
𝑥𝑥𝑘𝑘 =
1
𝐴𝐴𝑘𝑘,𝑘𝑘
[𝑦𝑦𝑘𝑘 − (𝐴𝐴𝑘𝑘,1𝑥𝑥1 + 𝐴𝐴𝑘𝑘,2𝑥𝑥2 + ⋯ + 𝐴𝐴𝑘𝑘,𝑘𝑘−1𝑥𝑥𝑘𝑘−1 + (12)
+𝐴𝐴𝑘𝑘,𝑘𝑘+1𝑥𝑥𝑘𝑘+1 + ⋯ + 𝐴𝐴𝑘𝑘,𝑁𝑁𝑥𝑥𝑁𝑁)]
31
K. Webb ESE 470
Jacobi Method
 Simplify (12) using summing notation
𝑥𝑥𝑘𝑘 =
1
𝐴𝐴𝑘𝑘,𝑘𝑘
𝑦𝑦𝑘𝑘 − �
𝑛𝑛=1
𝑘𝑘−1
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛 − �
𝑛𝑛=𝑘𝑘+1
𝑁𝑁
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛 , 𝑘𝑘 = 1 … 𝑁𝑁
 An equation for 𝑥𝑥𝑘𝑘
 But, of course, we don’t yet know all other 𝑥𝑥𝑛𝑛 values
 Use (13) as an iterative expression
𝑥𝑥𝑘𝑘,𝑖𝑖+1 =
1
𝐴𝐴𝑘𝑘,𝑘𝑘
𝑦𝑦𝑘𝑘 − �
𝑛𝑛=1
𝑘𝑘−1
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 − �
𝑛𝑛=𝑘𝑘+1
𝑁𝑁
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁
 The 𝑖𝑖 subscript indicates iteration number
 𝑥𝑥𝑘𝑘,𝑖𝑖+1 is the updated value from the current iteration
 𝑥𝑥𝑛𝑛,𝑖𝑖 is a value from the previous iteration
(13)
(14)
32
K. Webb ESE 470
Jacobi Method
𝑥𝑥𝑘𝑘,𝑖𝑖+1 =
1
𝐴𝐴𝑘𝑘,𝑘𝑘
𝑦𝑦𝑘𝑘 − �
𝑛𝑛=1
𝑘𝑘−1
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 − �
𝑛𝑛=𝑘𝑘+1
𝑁𝑁
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁
 Old values of 𝑥𝑥𝑛𝑛, on the right-hand side, are used to
update 𝑥𝑥𝑘𝑘 on the left-hand side
 Start with an initial guess for all unknowns, 𝐱𝐱0
 Iterate until adequate convergence is achieved
 Until a specified stopping criterion is satisfied
 Convergence is not guaranteed
(14)
33
K. Webb ESE 470
Convergence
 An approximation of 𝐱𝐱 is refined on each iteration
 Continue to iterate until we’re close to the right answer
for the vector of unknowns, 𝐱𝐱
 Assume we’ve converged to the right answer when 𝐱𝐱
changes very little from iteration to iteration
 On each iteration, calculate a relative error quantity
𝜀𝜀𝑖𝑖 = max
𝑥𝑥𝑘𝑘,𝑖𝑖+1 − 𝑥𝑥𝑘𝑘,𝑖𝑖
𝑥𝑥𝑘𝑘,𝑖𝑖
, 𝑘𝑘 = 1 … 𝑁𝑁
 Iterate until
𝜀𝜀𝑖𝑖 ≤ 𝜀𝜀𝑠𝑠
where 𝜀𝜀𝑠𝑠 is a chosen stopping criterion
34
K. Webb ESE 470
Jacobi Method – Matrix Form
 The Jacobi method iterative formula, (14), can be rewritten in matrix form:
𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1𝐲𝐲
where 𝐃𝐃 is the diagonal elements of A
𝐃𝐃 =
𝐴𝐴1,1 0 ⋯ 0
0 𝐴𝐴2,2 0 ⋮
⋮ 0 ⋱ 0
0 ⋯ 0 𝐴𝐴𝑁𝑁,𝑁𝑁
and
𝐌𝐌 = 𝐃𝐃−1
𝐃𝐃 − 𝐀𝐀
 Recall that the inverse of a diagonal matrix is given by inverting each diagonal
element
𝐃𝐃−𝟏𝟏 =
1/𝐴𝐴1,1 0 ⋯ 0
0 1/𝐴𝐴2,2 0 ⋮
⋮ 0 ⋱ 0
0 ⋯ 0 1/𝐴𝐴𝑁𝑁,𝑁𝑁
(15)
(16)
35
K. Webb ESE 470
Jacobi Method – Example
 Consider the following system of equations
−4𝑥𝑥1 + 7𝑥𝑥3 = −5
2𝑥𝑥1 − 3𝑥𝑥2 + 5𝑥𝑥3 = −12
𝑥𝑥2 − 3𝑥𝑥3 = 3
 In matrix form:
−4 0 7
2 −3 5
0 1 −3
𝑥𝑥1
𝑥𝑥2
𝑥𝑥3
=
−5
−12
3
 Solve using the Jacobi method
36
K. Webb ESE 470
Jacobi Method – Example
 The iteration formula is
𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1𝐲𝐲
where
𝐃𝐃 =
−4 0 0
0 −3 0
0 0 −3
𝐃𝐃−1 =
−0.25 0 0
0 −0.333 0
0 0 −0.333
𝐌𝐌 = 𝐃𝐃−1 𝐃𝐃 − 𝐀𝐀 =
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, 𝐱𝐱
 Often, we have some idea of the answer
 Here, arbitrarily choose
𝐱𝐱0 = 10 25 10 𝑇𝑇
37
K. Webb ESE 470
Jacobi Method – Example
 At each iteration, calculate
𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1𝐲𝐲
𝑥𝑥1,𝑖𝑖+1
𝑥𝑥2,𝑖𝑖+1
𝑥𝑥3,𝑖𝑖+1
=
0 0 1.75
0.667 0 1.667
0 0.333 0
𝑥𝑥1,𝑖𝑖
𝑥𝑥2,𝑖𝑖
𝑥𝑥3,𝑖𝑖
+
1.25
4
−1
 For 𝑖𝑖 = 1:
𝐱𝐱1 =
𝑥𝑥1,1
𝑥𝑥2,1
𝑥𝑥3,1
=
0 0 1.75
0.667 0 1.667
0 0.333 0
10
25
10
+
1.25
4
−1
𝐱𝐱1 = 18.75 27.33 7.33 𝑇𝑇
 The relative error is
𝜀𝜀1 = max
𝑥𝑥𝑘𝑘,1 − 𝑥𝑥𝑘𝑘,0
𝑥𝑥𝑘𝑘,0
= 0.875
38
K. Webb ESE 470
Jacobi Method – Example
 For 𝑖𝑖 = 2:
𝐱𝐱2 =
𝑥𝑥1,2
𝑥𝑥2,2
𝑥𝑥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
𝐱𝐱2 = 14.08 28.72 8.11 𝑇𝑇
 The relative error is
𝜀𝜀2 = max
𝑥𝑥𝑘𝑘,2 − 𝑥𝑥𝑘𝑘,1
𝑥𝑥𝑘𝑘,1
= 0.249
 Continue to iterate until relative error falls below a specified
stopping condition
39
K. Webb ESE 470
Jacobi Method – Example
 Automate with computer code, e.g. MATLAB
 Setup the system of equations
 Initialize matrices and parameters for iteration
40
K. Webb ESE 470
Jacobi Method – Example
 Loop to continue iteration as long as:
 Stopping criterion is not satisfied
 Maximum number of iterations is not exceeded
 On each iteration
 Use previous 𝐱𝐱 values to update 𝐱𝐱
 Calculate relative error
 Increment the number of iterations
41
K. Webb ESE 470
Jacobi Method – Example
 Set 𝜀𝜀𝑠𝑠 = 1 × 10−6
and iterate:
𝒊𝒊 𝐱𝐱𝒊𝒊 𝜺𝜺𝒊𝒊
0 10 25 10 𝑇𝑇 -
1 18.75 27.33 7.33 𝑇𝑇 0.875
2 14.08 28.72 8.11 𝑇𝑇 0.249
3 15.44 26.91 8.57 𝑇𝑇 0.097
4 16.25 28.59 7.97 𝑇𝑇 0.071
5 15.20 28.12 8.53 𝑇𝑇 0.070
6 16.18 28.35 8.37 𝑇𝑇 0.065
⋮ ⋮ ⋮
371 20.50 36.00 11.00 𝑇𝑇 0.995×10-6
 Convergence achieved in 371 iterations
42
K. Webb ESE 470
Linear Systems of Equations –
Iterative Solution – Gauss-Seidel
43
K. Webb ESE 470
Gauss-Seidel Method
 The iterative formula for the Jacobi method is
𝑥𝑥𝑘𝑘,𝑖𝑖+1 =
1
𝐴𝐴𝑘𝑘,𝑘𝑘
𝑦𝑦𝑘𝑘 − �
𝑛𝑛=1
𝑘𝑘−1
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 − �
𝑛𝑛=𝑘𝑘+1
𝑁𝑁
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁
 Note that only old values of 𝑥𝑥𝑛𝑛 (i.e. 𝑥𝑥𝑛𝑛,𝑖𝑖) are used to
update the value of 𝑥𝑥𝑘𝑘
 Assume the 𝑥𝑥𝑘𝑘,𝑖𝑖+1 values are determined in order of
increasing 𝑘𝑘
 When updating 𝑥𝑥𝑘𝑘,𝑖𝑖+1, all 𝑥𝑥𝑛𝑛,𝑖𝑖+1 values are already known
for 𝑛𝑛 < 𝑘𝑘
 We can use those updated values to calculate 𝑥𝑥𝑘𝑘,𝑖𝑖+1
 The Gauss-Seidel method
(14)
44
K. Webb ESE 470
Gauss-Seidel Method
 Now use the 𝑥𝑥𝑛𝑛 values already updated on the
current iteration to update 𝑥𝑥𝑘𝑘
 That is, 𝑥𝑥𝑛𝑛,𝑖𝑖+1 for 𝑛𝑛 < 𝑘𝑘
 Gauss-Seidel iterative formula
𝑥𝑥𝑘𝑘,𝑖𝑖+1 =
1
𝐴𝐴𝑘𝑘,𝑘𝑘
𝑦𝑦𝑘𝑘 − �
𝑛𝑛=1
𝑘𝑘−1
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖+1 − �
𝑛𝑛=𝑘𝑘+1
𝑁𝑁
𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁
 Note that only the first summation has changed
 For already updated 𝑥𝑥 values
 𝑥𝑥𝑛𝑛 for 𝑛𝑛 < 𝑘𝑘
 Number of already-updated values used depends on 𝑘𝑘
(17)
45
K. Webb ESE 470
Gauss-Seidel – Matrix Form
 In matrix form the iterative formula is the same as for the Jacobi
method
𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1
𝐲𝐲
where, again
𝐌𝐌 = 𝐃𝐃−1 𝐃𝐃 − 𝐀𝐀
but now 𝐃𝐃 is the lower triangular part of 𝐀𝐀
𝐃𝐃 =
𝐴𝐴1,1 0 ⋯ 0
𝐴𝐴2,1 𝐴𝐴2,2 0 ⋮
⋮ ⋮ ⋱ 0
𝐴𝐴𝑁𝑁,1 𝐴𝐴𝑁𝑁,2 ⋯ 𝐴𝐴𝑁𝑁,𝑁𝑁
 Otherwise, the algorithm and computer code is identical to that of
the Jacobi method
(15)
(16)
46
K. Webb ESE 470
Gauss-Seidel – Example
 Apply Gauss-Seidel to our previous example
 𝑥𝑥0 = 10 25 10 𝑇𝑇
 𝜀𝜀𝑠𝑠 = 1 × 10−6
𝒊𝒊 𝐱𝐱𝒊𝒊 𝜺𝜺𝒊𝒊
0 10 25 10 𝑇𝑇 -
1 18.75 33.17 10.06 𝑇𝑇 0.875
2 18.85 33.32 10.11 𝑇𝑇 0.005
3 18.94 33.47 10.16 𝑇𝑇 0.005
4 19.03 33.61 10.20 𝑇𝑇 0.005
⋮ ⋮ ⋮
151 20.50 36.00 11.00 𝑇𝑇 0.995×10-6
 Convergence achieved in 151 iterations
 Compared to 371 for the Jacobi method
47
K. Webb ESE 470
Nonlinear Equations
48
K. Webb ESE 470
Nonlinear Equations
 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
49
K. Webb ESE 470
Newton-Raphson Method
 Want to solve
𝑦𝑦 = 𝑓𝑓(𝑥𝑥)
where 𝑓𝑓 𝑥𝑥 is a nonlinear function
 That is, we want to find 𝑥𝑥, given a known nonlinear
function, 𝑓𝑓, and a known output, 𝑦𝑦
 Newton-Raphson method
 Based on a first-order Taylor series approximation to
𝑓𝑓 𝑥𝑥
 The nonlinear 𝑓𝑓 𝑥𝑥 is approximated as linear to update
our approximation to the solution, 𝑥𝑥, on each iteration
50
K. Webb ESE 470
Taylor Series Approximation
 Taylor series approximation
 Given:
 A function, 𝑓𝑓 𝑥𝑥
 Value of the function at some value of 𝑥𝑥, 𝑓𝑓 𝑥𝑥0
 Approximate:
 Value of the function at some other value of 𝑥𝑥
 First-order Taylor series approximation
 Approximate 𝑓𝑓 𝑥𝑥 using only its first derivative
 𝑓𝑓 𝑥𝑥 approximated as linear – constant slope
𝑦𝑦 = 𝑓𝑓 𝑥𝑥 ≈ 𝑓𝑓 𝑥𝑥0 +
𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
�
𝑥𝑥=𝑥𝑥0
𝑥𝑥 − 𝑥𝑥0 = �
𝑦𝑦
51
K. Webb ESE 470
First-Order Taylor Series Approximation
 Approximate value of the function at 𝑥𝑥
𝑓𝑓 𝑥𝑥 ≈ �
𝑦𝑦 = 𝑓𝑓 𝑥𝑥0 + 𝑓𝑓′ 𝑥𝑥0 𝑥𝑥 − 𝑥𝑥0
52
K. Webb ESE 470
Newton-Raphson Method
 First order Taylor series approximation is
𝑦𝑦 ≈ 𝑓𝑓 𝑥𝑥0 + 𝑓𝑓′ 𝑥𝑥0 𝑥𝑥 − 𝑥𝑥0
 Letting this be an equality and rearranging gives an iterative formula
for updating an approximation to 𝑥𝑥
𝑦𝑦 = 𝑓𝑓 𝑥𝑥𝑖𝑖 + 𝑓𝑓′ 𝑥𝑥𝑖𝑖 𝑥𝑥𝑖𝑖+1 − 𝑥𝑥𝑖𝑖
𝑓𝑓′ 𝑥𝑥𝑖𝑖 𝑥𝑥𝑖𝑖+1 − 𝑥𝑥𝑖𝑖 = 𝑦𝑦 − 𝑓𝑓 𝑥𝑥𝑖𝑖
𝑥𝑥𝑖𝑖+1 = 𝑥𝑥𝑖𝑖 +
1
𝑓𝑓′ 𝑥𝑥𝑖𝑖
𝑦𝑦 − 𝑓𝑓 𝑥𝑥𝑖𝑖
 Initialize with a best guess at 𝑥𝑥, 𝑥𝑥0
 Iterate (18) until
 A stopping criterion is satisfied, or
 The maximum number of iterations is reached
(18)
53
K. Webb ESE 470
First-Order Taylor Series Approximation
 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
𝑥𝑥𝑖𝑖+1 = 𝑥𝑥𝑖𝑖 +
1
𝑓𝑓′ 𝑥𝑥𝑖𝑖
𝑦𝑦 − 𝑓𝑓 𝑥𝑥𝑖𝑖
54
K. Webb ESE 470
Newton-Raphson – Example
 Consider the following nonlinear equation
𝑦𝑦 = 𝑓𝑓 𝑥𝑥 = 𝑥𝑥3 + 10 = 20
 Apply Newton-Raphson to solve
 Find 𝑥𝑥, such that 𝑦𝑦 = 𝑓𝑓 𝑥𝑥 = 20
 The derivative function is
𝑓𝑓′ 𝑥𝑥 = 3𝑥𝑥2
 Initial guess for 𝑥𝑥
𝑥𝑥0 = 1
 Iterate using the formula given by (18)
55
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 1:
𝑥𝑥1 = 𝑥𝑥0 + 𝑓𝑓′ 𝑥𝑥0
−1
𝑦𝑦 − 𝑓𝑓 𝑥𝑥0
𝑥𝑥1 = 1 + 3 ⋅ 12 −1 20 − 13 + 10
𝑥𝑥1 = 4
𝜀𝜀1 =
𝑥𝑥1 − 𝑥𝑥0
𝑥𝑥0
𝜀𝜀1 =
4 − 1
1
= 3
𝑥𝑥1 = 4, 𝜀𝜀1 = 3
56
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 2:
𝑥𝑥2 = 𝑥𝑥1 + 𝑓𝑓′ 𝑥𝑥1
−1
𝑦𝑦 − 𝑓𝑓 𝑥𝑥1
𝑥𝑥2 = 4 + 3 ⋅ 42 −1 20 − 43 + 10
𝑥𝑥2 = 2.875
𝜀𝜀2 =
𝑥𝑥2 − 𝑥𝑥1
𝑥𝑥1
𝜀𝜀2 =
2.875 − 4
4
𝜀𝜀2 = 0.281
𝑥𝑥2 = 2.875, 𝜀𝜀2 = 0.281
57
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 3:
𝑥𝑥3 = 𝑥𝑥2 + 𝑓𝑓′ 𝑥𝑥2
−1
𝑦𝑦 − 𝑓𝑓 𝑥𝑥2
𝑥𝑥3 = 2.875 + 3 ⋅ 2.8752 −1
20 − 2.8753
+ 10
𝑥𝑥3 = 2.32
𝜀𝜀3 =
𝑥𝑥3 − 𝑥𝑥2
𝑥𝑥2
𝜀𝜀3 =
2.32 − 2.875
2.875
𝜀𝜀3 = 0.193
𝑥𝑥3 = 2.32, 𝜀𝜀3 = 0.193
58
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 4:
𝑥𝑥4 = 2.166, 𝜀𝜀4 = 0.066
 𝑖𝑖 = 5:
𝑥𝑥5 = 2.155, 𝜀𝜀5 = 0.005
 𝑖𝑖 = 6:
𝑥𝑥6 = 2.154, 𝜀𝜀6 = 28.4 × 10−6
 𝑖𝑖 = 7:
𝑥𝑥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
K. Webb ESE 470
Example Problems
60
K. Webb ESE 470
Perform three iterations toward the solution of the following system
of equations using the Jacobi method. Let 𝐱𝐱0 = 0, 0 𝑇𝑇.
2𝑥𝑥1 + 𝑥𝑥2 = 12
2𝑥𝑥1 + 3𝑥𝑥2 = 5
61
K. Webb ESE 470
62
K. Webb ESE 470
63
K. Webb ESE 470
64
K. Webb ESE 470
Perform three iterations toward the solution of the following system
of equations using the Gauss-Seidel method. Let 𝐱𝐱0 = 0, 0 𝑇𝑇.
2𝑥𝑥1 + 𝑥𝑥2 = 12
2𝑥𝑥1 + 3𝑥𝑥2 = 5
65
K. Webb ESE 470
66
K. Webb ESE 470
67
K. Webb ESE 470
68
K. Webb ESE 470
Perform three iterations toward the solution of the following
equation using the Newton-Raphson method. Let 𝐱𝐱0 = 0.
𝑓𝑓 𝑥𝑥 = cos 𝑥𝑥 + 3𝑥𝑥 = 10
69
K. Webb ESE 470
70
K. Webb ESE 470
Nonlinear Systems of Equations
71
K. Webb ESE 470
Nonlinear Systems of Equations
 Now, consider a system of nonlinear equations
 Can be represented as a vector of 𝑁𝑁 functions
 Each is a function of an 𝑁𝑁-vector of unknown variables
𝐲𝐲 =
𝑦𝑦1
𝑦𝑦2
⋮
𝑦𝑦𝑁𝑁
= 𝐟𝐟 𝐱𝐱 =
𝑓𝑓1 𝑥𝑥1, 𝑥𝑥2, ⋯ , 𝑥𝑥𝑁𝑁
𝑓𝑓2 𝑥𝑥1, 𝑥𝑥2, ⋯ , 𝑥𝑥𝑁𝑁
⋮
𝑓𝑓𝑁𝑁 𝑥𝑥1, 𝑥𝑥2, ⋯ , 𝑥𝑥𝑁𝑁
 We can again approximate this function using a first-order Taylor series
𝐲𝐲 = 𝐟𝐟 𝐱𝐱 ≈ 𝐟𝐟 𝐱𝐱0 + 𝐟𝐟′
𝐱𝐱0 𝐱𝐱 − 𝐱𝐱0
 Note that all variables are 𝑁𝑁-vectors
 𝐟𝐟 is an 𝑁𝑁-vector of known, nonlinear functions
 𝐱𝐱 is an 𝑁𝑁-vector of unknown values – this is what we want to solve for
 𝐲𝐲 is an 𝑁𝑁-vector of known values
 𝐱𝐱𝟎𝟎 is an 𝑁𝑁-vector of 𝐱𝐱 values for which 𝐟𝐟 𝐱𝐱0 is known
(19)
72
K. Webb ESE 470
Newton-Raphson Method
 Equation (19) is the basis for our Newton-Raphson iterative formula
 Again, let it be an equality and solve for 𝐱𝐱
𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 = 𝐟𝐟′ 𝐱𝐱0 𝐱𝐱 − 𝐱𝐱0
𝐟𝐟′ 𝐱𝐱0
−𝟏𝟏
𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 = 𝐱𝐱 − 𝐱𝐱0
𝐱𝐱 = 𝐱𝐱0 + 𝐟𝐟′ 𝐱𝐱0
−𝟏𝟏
𝐲𝐲 − 𝐟𝐟 𝐱𝐱0
 This last expression can be used as an iterative formula
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐟𝐟′ 𝐱𝐱𝑖𝑖
−𝟏𝟏
𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖
 The derivative term on the right-hand side of (20) is an 𝑁𝑁 × 𝑁𝑁 matrix
 The Jacobian matrix, 𝐉𝐉
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖
−𝟏𝟏
𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖 (20)
73
K. Webb ESE 470
The Jacobian Matrix
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖
−𝟏𝟏
𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖
 Jacobian matrix
 𝑁𝑁 × 𝑁𝑁 matrix of partial derivatives for 𝐟𝐟 𝐱𝐱
 Evaluated at the current value of 𝐱𝐱, 𝐱𝐱𝑖𝑖
𝐉𝐉𝑖𝑖 =
𝜕𝜕𝑓𝑓1
𝜕𝜕𝑥𝑥1
𝜕𝜕𝑓𝑓1
𝜕𝜕𝑥𝑥2
⋯
𝜕𝜕𝑓𝑓1
𝜕𝜕𝑥𝑥𝑁𝑁
𝜕𝜕𝑓𝑓2
𝜕𝜕𝑥𝑥1
𝜕𝜕𝑓𝑓2
𝜕𝜕𝑥𝑥2
⋯
𝜕𝜕𝑓𝑓2
𝜕𝜕𝑥𝑥𝑁𝑁
⋮ ⋮ ⋱ ⋮
𝜕𝜕𝑓𝑓𝑁𝑁
𝜕𝜕𝑥𝑥1
𝜕𝜕𝑓𝑓𝑁𝑁
𝜕𝜕𝑥𝑥2
⋯
𝜕𝜕𝑓𝑓𝑁𝑁
𝜕𝜕𝑥𝑥𝑁𝑁 𝐱𝐱=𝐱𝐱𝑖𝑖
(20)
74
K. Webb ESE 470
Newton-Raphson Method
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖
−𝟏𝟏
𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖
 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
𝐲𝐲 = 𝐟𝐟 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖 𝐱𝐱𝑖𝑖+1 − 𝐱𝐱𝑖𝑖
𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖 = 𝐉𝐉𝑖𝑖 𝐱𝐱𝑖𝑖+1 − 𝐱𝐱𝑖𝑖
 Left side of (21) represents a difference between the known and
approximated outputs
 Right side represents an increment of the approximation for 𝐱𝐱
Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖
(20)
(21)
(22)
75
K. Webb ESE 470
Newton-Raphson Method
Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖
 On each iteration:
 Compute Δ𝐲𝐲𝑖𝑖 and 𝐉𝐉𝑖𝑖
 Solve for Δ𝐱𝐱𝑖𝑖 using Gaussian elimination
 Matrix inversion not required
 Computationally robust
 Update 𝐱𝐱
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖
(22)
(23)
76
K. Webb ESE 470
Newton-Raphson – Example
 Apply Newton-Raphson to solve the following system of
nonlinear equations
𝐟𝐟 𝐱𝐱 = 𝐲𝐲
𝑥𝑥1
2
+ 3𝑥𝑥2
𝑥𝑥1𝑥𝑥2
=
21
12
 Initial condition: 𝐱𝐱0 = 1 2 𝑇𝑇
 Stopping criterion: 𝜀𝜀𝑠𝑠 = 1 × 10−6
 Jacobian matrix
𝐉𝐉𝑖𝑖 =
𝜕𝜕𝑓𝑓1
𝜕𝜕𝑥𝑥1
𝜕𝜕𝑓𝑓1
𝜕𝜕𝑥𝑥2
𝜕𝜕𝑓𝑓2
𝜕𝜕𝑥𝑥1
𝜕𝜕𝑓𝑓2
𝜕𝜕𝑥𝑥2 𝐱𝐱=𝐱𝐱𝑖𝑖
=
2𝑥𝑥1,𝑖𝑖 3
𝑥𝑥2,𝑖𝑖 𝑥𝑥1,𝑖𝑖
77
K. Webb ESE 470
Newton-Raphson – Example
Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖
 Adjusting the indexing, we can equivalently write (22)
and (23) as:
Δ𝐲𝐲𝑖𝑖−1 = 𝐉𝐉𝑖𝑖−1Δ𝐱𝐱𝑖𝑖−1
𝐱𝐱𝑖𝑖 = 𝐱𝐱𝑖𝑖−1 + Δ𝐱𝐱𝑖𝑖−1
 For iteration 𝑖𝑖:
 Compute Δ𝐲𝐲𝑖𝑖−1 and 𝐉𝐉𝑖𝑖−1
 Solve (22) for Δ𝐱𝐱𝑖𝑖−1
 Update 𝐱𝐱 using (23)
(22)
(23)
(22)
(23)
78
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 1:
Δ𝑦𝑦0 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 =
21
12
−
7
2
=
14
10
𝐉𝐉0 =
2𝑥𝑥1,0 3
𝑥𝑥2,0 𝑥𝑥1,0
=
2 3
2 1
Δ𝐱𝐱0 =
4
2
𝐱𝐱1 = 𝐱𝐱0 + Δ𝐱𝐱0 =
1
2
+
4
2
=
5
4
𝜀𝜀1 = max
𝑥𝑥𝑘𝑘,1 − 𝑥𝑥𝑘𝑘,0
𝑥𝑥𝑘𝑘,0
, 𝑘𝑘 = 1 … 𝑁𝑁
𝑥𝑥1 =
5
4
, 𝜀𝜀1 = 4
79
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 2:
Δ𝑦𝑦1 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱1 =
21
12
−
37
20
=
−16
−8
𝐉𝐉1 =
2𝑥𝑥1,1 3
𝑥𝑥2,1 𝑥𝑥1,1
=
10 3
4 5
Δ𝐱𝐱1 =
−1.474
−0.421
𝐱𝐱2 = 𝐱𝐱1 + Δ𝐱𝐱1 =
5
4
+
−1.474
−0.421
=
3.526
3.579
𝜀𝜀2 = max
𝑥𝑥𝑘𝑘,2 − 𝑥𝑥𝑘𝑘,1
𝑥𝑥𝑘𝑘,1
, 𝑘𝑘 = 1 … 𝑁𝑁
𝑥𝑥2 =
3.526
3.579
, 𝜀𝜀2 = 0.295
80
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 3:
Δ𝑦𝑦2 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱2 =
21
12
−
23.172
12.621
=
−2.172
−0.621
𝐉𝐉2 =
2𝑥𝑥1,2 3
𝑥𝑥2,2 𝑥𝑥1,2
=
7.053 3
3.579 3.526
Δ𝐱𝐱2 =
−0.410
0.240
𝐱𝐱3 = 𝐱𝐱2 + Δ𝐱𝐱2 =
3.526
3.579
+
−0.410
0.240
=
3.116
3.819
𝜀𝜀3 = max
𝑥𝑥𝑘𝑘,3 − 𝑥𝑥𝑘𝑘,2
𝑥𝑥𝑘𝑘,2
, 𝑘𝑘 = 1 … 𝑁𝑁
𝑥𝑥3 =
3.116
3.819
, 𝜀𝜀3 = 0.116
81
K. Webb ESE 470
Newton-Raphson – Example
 𝑖𝑖 = 7:
Δ𝑦𝑦6 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱6 =
21
12
−
21.000
12.000
= −0.527 × 10−7
0.926 × 10−7
𝐉𝐉6 =
2𝑥𝑥1,6 3
𝑥𝑥2,6 𝑥𝑥1,6
=
6.000 3
4.000 3.000
Δ𝐱𝐱6 = −0.073 × 10−6
0.128 × 10−6
𝐱𝐱7 = 𝐱𝐱6 + Δ𝐱𝐱6 =
3.000
4.000
+ −0.073 × 10−6
0.128 × 10−6 =
3.000
4.000
𝜀𝜀7 = max
𝑥𝑥𝑘𝑘,7 − 𝑥𝑥𝑘𝑘,6
𝑥𝑥𝑘𝑘,6
, 𝑘𝑘 = 1 … 𝑁𝑁
𝑥𝑥7 =
3.000
4.000
, 𝜀𝜀7 = 31.9 × 10−9
82
K. Webb ESE 470
Newton-Raphson – MATLAB Code
 Define the system of equations
 Initialize 𝐱𝐱
 Set up solution parameters
83
K. Webb ESE 470
Newton-Raphson – MATLAB Code
 Iterate:
 Compute Δ𝐲𝐲𝑖𝑖−1 and 𝐉𝐉𝑖𝑖−1
 Solve for Δ𝐱𝐱𝑖𝑖−1
 Update 𝐱𝐱
84
K. Webb ESE 470
Example Problems
85
K. Webb ESE 470
Perform three iterations toward the solution of the following system
of equations using the Newton-Raphson method. Let 𝐱𝐱0 = 1, 1 𝑇𝑇.
10𝑥𝑥1
2
+ 𝑥𝑥2 = 20
𝑒𝑒𝑥𝑥1 − 𝑥𝑥2 = 10
86
K. Webb ESE 470
87
K. Webb ESE 470
88
K. Webb ESE 470
89
K. Webb ESE 470
Power-Flow Solution – Overview
90
K. Webb ESE 470
Solving the Power-Flow Problem - Overview
 Consider an 𝑁𝑁-bus power-flow problem
 1 slack bus
 𝑛𝑛𝑃𝑃𝑃𝑃 PV buses
 𝑛𝑛𝑃𝑃𝑃𝑃 PQ buses
𝑁𝑁 = 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 + 1
 Each bus has two unknown quantities
 Two of 𝑉𝑉𝑘𝑘, 𝛿𝛿𝑘𝑘, 𝑃𝑃𝑘𝑘, and 𝑄𝑄𝑘𝑘
 For the N-R power-flow problem, 𝑉𝑉𝑘𝑘 and 𝛿𝛿𝑘𝑘 are the
unknown quantities
 These are the inputs to the nonlinear system of equations – the
𝑃𝑃𝑘𝑘 and 𝑄𝑄𝑘𝑘 equations – of (9) and (10)
 Finding unknown 𝑉𝑉𝑘𝑘 and 𝛿𝛿𝑘𝑘 values allows us to determine
unknown 𝑃𝑃𝑘𝑘 and 𝑄𝑄𝑘𝑘 values
91
K. Webb ESE 470
Solving the Power-Flow Problem - Overview
 The nonlinear system of equations is
𝐲𝐲 = 𝐟𝐟(𝐱𝐱)
 The unknowns , 𝐱𝐱, are bus voltages
 Unknown phase angles from PV and PQ buses
 Unknown magnitudes from PQ bus
𝐱𝐱 =
𝛅𝛅
𝐕𝐕
=
𝛿𝛿2
⋮
𝛿𝛿𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1
𝑉𝑉𝑛𝑛𝑃𝑃𝑃𝑃+2
⋮
𝑉𝑉𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1
𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃
(24)
92
K. Webb ESE 470
Solving the Power-Flow Problem - Overview
𝐲𝐲 = 𝐟𝐟(𝐱𝐱)
 The knowns , 𝐲𝐲, are bus powers
 Known real power from PV and PQ buses
 Known reactive power from PQ bus
𝐲𝐲 =
𝐏𝐏
𝐐𝐐
=
𝑃𝑃2
⋮
𝑃𝑃𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1
𝑄𝑄𝑛𝑛𝑃𝑃𝑃𝑃+2
⋮
𝑄𝑄𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1
𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃
(25)
93
K. Webb ESE 470
Solving the Power-Flow Problem - Overview
𝐲𝐲 = 𝐟𝐟(𝐱𝐱)
 The system of equations , 𝐟𝐟, consists of the
nonlinear functions for 𝐏𝐏 and 𝐐𝐐
 Nonlinear functions of 𝐕𝐕 and 𝛅𝛅
𝐟𝐟(𝐱𝐱) =
𝐏𝐏(𝐱𝐱)
𝐐𝐐(𝐱𝐱)
=
𝑃𝑃2 𝐱𝐱
⋮
⋮
𝑄𝑄𝑛𝑛𝑃𝑃𝑃𝑃+2 𝐱𝐱
⋮
⋮
𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃
(26)
94
K. Webb ESE 470
Solving the Power-Flow Problem - Overview
 𝑃𝑃𝑘𝑘 𝐱𝐱 and 𝑄𝑄𝑘𝑘 𝐱𝐱 are given by
𝑃𝑃𝑘𝑘 = 𝑉𝑉𝑘𝑘 �
𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 �
𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉
𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
 Admittance matrix terms are
𝑌𝑌𝑘𝑘𝑘𝑘 = 𝑌𝑌𝑘𝑘𝑘𝑘 ∠𝜃𝜃𝑘𝑘𝑘𝑘
(9)
(10)
95
K. Webb ESE 470
Solving the Power-Flow Problem - Overview
 The iterative N-R formula is
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖
 The increment term, Δ𝐱𝐱𝑖𝑖, is computed through
Gaussian elimination of
Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖
 The Jacobian, 𝐽𝐽𝑖𝑖, is computed on each iteration
 The power mismatch vector is
Δ𝐲𝐲𝑖𝑖 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖
 𝐲𝐲 is the vector of known powers, as given in (25)
 𝐟𝐟 𝐱𝐱𝑖𝑖 are the 𝑃𝑃 and 𝑄𝑄 equations given by (9) and (10)
96
K. Webb ESE 470
Power-Flow Solution – Procedure
97
K. Webb ESE 470
Solving the Power-Flow Problem - Procedure
 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, 𝐘𝐘
 And magnitude, Y = 𝐘𝐘 , and angle, θ = ∠𝐘𝐘, matrices
98
K. Webb ESE 470
Solving the Power-Flow Problem - Procedure
3. Initialize known quantities
 Slack bus: 𝑉𝑉1 and 𝛿𝛿1
 PV buses: 𝑉𝑉𝑘𝑘 and 𝑃𝑃𝑘𝑘
 PQ buses: 𝑃𝑃𝑘𝑘 and 𝑄𝑄𝑘𝑘
 Output vector:
𝐲𝐲 =
𝐏𝐏
𝐐𝐐
4. Initialize unknown quantities
𝐱𝐱𝒐𝒐 =
𝛅𝛅𝟎𝟎
𝐕𝐕𝟎𝟎
=
0
⋮
0
1.0
⋮
1.0
𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃
(24)
99
K. Webb ESE 470
Solving the Power-Flow Problem - Procedure
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: 𝑖𝑖 = 0
6. while (𝜀𝜀 > reltol) && (𝑖𝑖 < max_iter)
 Update bus voltage phasor vector, 𝐕𝐕𝑖𝑖, using magnitude
and phase values from 𝐱𝐱𝑖𝑖 and from knowns
 Calculate the current injected into each bus, a vector of
phasors
𝐈𝐈𝑖𝑖 = 𝐘𝐘 ⋅ 𝐕𝐕𝑖𝑖
100
K. Webb ESE 470
Solving the Power-Flow Problem - Procedure
6. while (𝜀𝜀 > reltol) && (𝑖𝑖 < max_iter) – cont’d
 Calculate complex, real, and reactive power injected into each bus
 This can be done using 𝐕𝐕𝑖𝑖 and 𝐈𝐈𝑖𝑖 vectors and element-by-element
multiplication (the .* operator in MATLAB)
𝐒𝐒𝑘𝑘,𝑖𝑖 = 𝐕𝐕𝑘𝑘,𝑖𝑖 ⋅ 𝐈𝐈𝑘𝑘,𝑖𝑖
∗
𝑃𝑃𝑘𝑘,𝑖𝑖 = 𝑅𝑅𝑅𝑅 𝐒𝐒𝑘𝑘,𝑖𝑖
𝑄𝑄𝑘𝑘,𝑖𝑖 = 𝐼𝐼𝐼𝐼 𝐒𝐒𝑘𝑘,𝑖𝑖
 Create 𝑓𝑓 𝑥𝑥𝑖𝑖 from 𝐏𝐏𝑖𝑖 and 𝐐𝐐𝑖𝑖 vectors
 Calculate power mismatch, Δ𝐲𝐲𝑖𝑖
Δ𝐲𝐲𝑖𝑖 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖
 Compute the Jacobian, 𝐉𝐉𝑖𝑖, using voltage magnitudes and phase
angles from 𝐕𝐕𝑖𝑖
101
K. Webb ESE 470
Solving the Power-Flow Problem - Procedure
6. while (𝜀𝜀 > reltol) && (𝑖𝑖 < max_iter) – cont’d
 Solve for Δ𝐱𝐱𝑖𝑖 using Gaussian elimination
Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖
 Use the mldivide (, backslash) operator in MATLAB: Δ𝐱𝐱𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐲𝐲𝑖𝑖
 Update 𝐱𝐱
𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖
 Check for convergence using power mismatch
𝜀𝜀𝑖𝑖+1 = max
𝑦𝑦𝑘𝑘 − 𝑓𝑓𝑘𝑘 𝐱𝐱
𝑦𝑦𝑘𝑘
 Update the number of iterations
𝑖𝑖 = 𝑖𝑖 + 1
102
K. Webb ESE 470
The Jacobian Matrix
 The Jacobian matrix has four quadrants of varying
dimension depending on the number of different
types of buses:
𝐉𝐉 =
𝜕𝜕𝐏𝐏
𝜕𝜕𝛅𝛅
𝜕𝜕𝐏𝐏
𝜕𝜕𝐕𝐕
𝜕𝜕𝐐𝐐
𝜕𝜕𝛅𝛅
𝜕𝜕𝐐𝐐
𝜕𝜕𝐕𝐕
𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃
𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃
𝐉𝐉1 𝐉𝐉2
𝐉𝐉3 𝐉𝐉4
103
K. Webb ESE 470
The Jacobian Matrix
 Jacobian elements are partial derivatives of (9) and (10) with
respect to 𝛿𝛿 or 𝑉𝑉
 Formulas for the Jacobian elements:
 𝑛𝑛 ≠ 𝑘𝑘
𝐉𝐉1𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑃𝑃𝑘𝑘
𝜕𝜕𝛿𝛿𝑛𝑛
= 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘𝑉𝑉
𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝐉𝐉2𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑃𝑃𝑘𝑘
𝜕𝜕𝑉𝑉
𝑛𝑛
= 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝐉𝐉3𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑄𝑄𝑘𝑘
𝜕𝜕𝛿𝛿𝑛𝑛
= −𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘𝑉𝑉
𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝐉𝐉4𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑄𝑄𝑘𝑘
𝜕𝜕𝑉𝑉
𝑛𝑛
= 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
(29)
(27)
(28)
(30)
104
K. Webb ESE 470
The Jacobian Matrix
 Formulas for the Jacobian elements, cont’d:
 𝑛𝑛 = 𝑘𝑘
𝐉𝐉1𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑃𝑃𝑘𝑘
𝜕𝜕𝛿𝛿𝑘𝑘
= −𝑉𝑉𝑘𝑘 �
𝑛𝑛=1
𝑛𝑛≠𝑘𝑘
𝑁𝑁
𝑌𝑌𝑘𝑘𝑛𝑛𝑉𝑉
𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝐉𝐉2𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑃𝑃𝑘𝑘
𝜕𝜕𝑉𝑉𝑘𝑘
= 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 cos 𝜃𝜃𝑘𝑘𝑘𝑘 + �
𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑛𝑛𝑉𝑉
𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝐉𝐉3𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑄𝑄𝑘𝑘
𝜕𝜕𝛿𝛿𝑘𝑘
= 𝑉𝑉𝑘𝑘 �
𝑛𝑛=1
𝑛𝑛≠𝑘𝑘
𝑁𝑁
𝑌𝑌𝑘𝑘𝑛𝑛𝑉𝑉
𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
𝐉𝐉4𝑘𝑘𝑘𝑘 =
𝜕𝜕𝑄𝑄𝑘𝑘
𝜕𝜕𝑉𝑉𝑘𝑘
= −𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 sin 𝜃𝜃𝑘𝑘𝑘𝑘 + �
𝑛𝑛=1
𝑁𝑁
𝑌𝑌𝑘𝑘𝑘𝑘𝑉𝑉
𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘
(33)
(31)
(32)
(34)
105
K. Webb ESE 470
Power-Flow Solution – Example
106
K. Webb ESE 470
Power-Flow Solution – Buses
 Determine all bus voltages and power flows for the following three-
bus power system
 Three buses, 𝑛𝑛𝑃𝑃𝑃𝑃 = 1, 𝑛𝑛𝑃𝑃𝑃𝑃 = 1, ordered PV first, then PQ:
 Bus 1: slack bus
 𝑉𝑉1 and 𝛿𝛿1 are known, find 𝑃𝑃1 and 𝑄𝑄1
 Bus 2: PV bus
 𝑃𝑃2 and 𝑉𝑉2 are known, find 𝛿𝛿2 and 𝑄𝑄2
 Bus 3: PQ bus
 𝑃𝑃3 and 𝑄𝑄3 are known, find 𝑉𝑉3 and 𝛿𝛿3
107
K. Webb ESE 470
 Per-unit, per-length impedance of all transmission lines:
𝑧𝑧 = 31.1 + 𝑗𝑗𝑗𝑗𝑗 × 10−6 𝑝𝑝𝑝𝑝/𝑘𝑘𝑘𝑘
 Admittance of each line:
𝑌𝑌12 = 𝑌𝑌23 =
1
𝑧𝑧 ⋅ 150 𝑘𝑘𝑘𝑘
= 2.06 − 𝑗𝑗𝑗𝑗.9 𝑝𝑝𝑝𝑝
𝑌𝑌13 =
1
𝑧𝑧 ⋅ 200 𝑘𝑘𝑘𝑘
= 1.54 − 𝑗𝑗15.7 𝑝𝑝𝑝𝑝
Power-Flow Solution – Admittance Matrix
108
K. Webb ESE 470
 The admittance matrix (see p. 8):
𝐘𝐘 =
𝑌𝑌11 −𝑌𝑌12 −𝑌𝑌13
−𝑌𝑌21 𝑌𝑌22 −𝑌𝑌23
−𝑌𝑌31 −𝑌𝑌32 𝑌𝑌33
=
3.6 − 𝑗𝑗𝑗𝑗.6 −2.06 + 𝑗𝑗𝑗𝑗.9 −1.5 + 𝑗𝑗𝑗𝑗.7
−2.06 + 𝑗𝑗𝑗𝑗.9 4.1 − 𝑗𝑗𝑗𝑗.8 −2.06 + 𝑗𝑗𝑗𝑗.9
−1.5 + 𝑗𝑗𝑗𝑗.7 −2.06 + 𝑗𝑗𝑗𝑗.9 3.6 − 𝑗𝑗𝑗𝑗.6
 Admittance magnitude and angle matrices:
Y = 𝐘𝐘 =
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 – Admittance Matrix
109
K. Webb ESE 470
Power-Flow Solution – Initialize Knowns
 Known quantities
 Slack bus: 𝑉𝑉1 = 1.0 𝑝𝑝𝑝𝑝, 𝛿𝛿1 = 0°
 PV bus: 𝑉𝑉2 = 1.05 𝑝𝑝𝑝𝑝, 𝑃𝑃2 = 2.0 𝑝𝑝𝑝𝑝
 PQ bus: 𝑃𝑃3 = −5.0 𝑝𝑝𝑝𝑝, 𝑄𝑄3 = −1.0 𝑝𝑝𝑝𝑝
 Output vector
𝐲𝐲 =
𝐏𝐏
𝐐𝐐
=
𝑃𝑃2
𝑃𝑃3
𝑄𝑄3
=
2.0
−5.0
−1.0
110
K. Webb ESE 470
Power-Flow Solution – Initialize Unknowns
 The vector of unknown quantities to be solved for is
𝐱𝐱 =
𝛅𝛅
𝐕𝐕
=
𝛿𝛿2
𝛿𝛿3
𝑉𝑉3
 Initialize all unknown bus voltage phasors to 𝐕𝐕𝑘𝑘 = 1.0∠0° 𝑝𝑝𝑝𝑝
𝐱𝐱0 =
𝛅𝛅0
𝐕𝐕0
=
𝛿𝛿2,0
𝛿𝛿3,0
𝑉𝑉3,0
=
0
0
1.0
 The complete vector of bus voltage phasors – partly known, partly
unknown – is
𝐕𝐕 =
𝑉𝑉1∠𝛿𝛿1
𝑉𝑉2∠𝛿𝛿2
𝑉𝑉3∠𝛿𝛿3
=
1.0∠0°
1.05∠𝛿𝛿2,0
𝑉𝑉3,0∠𝛿𝛿3,0
=
1.0∠0°
1.05∠0°
1.0∠0°
111
K. Webb ESE 470
Power-Flow Solution – Jacobian Matrix
 The Jacobian matrix for this system is
𝐉𝐉 =
𝜕𝜕𝑃𝑃2
𝜕𝜕𝛿𝛿2
𝜕𝜕𝑃𝑃2
𝜕𝜕𝛿𝛿3
𝜕𝜕𝑃𝑃2
𝜕𝜕𝑉𝑉3
𝜕𝜕𝑃𝑃3
𝜕𝜕𝛿𝛿2
𝜕𝜕𝑃𝑃3
𝜕𝜕𝛿𝛿3
𝜕𝜕𝑃𝑃3
𝜕𝜕𝑉𝑉3
𝜕𝜕𝑄𝑄3
𝜕𝜕𝛿𝛿2
𝜕𝜕𝑄𝑄3
𝜕𝜕𝛿𝛿3
𝜕𝜕𝑄𝑄3
𝜕𝜕𝑉𝑉3
 This matrix will be computed on each iteration using
the current approximation to the vector of
unknowns, 𝐱𝐱𝑖𝑖
112
K. Webb ESE 470
Power-Flow Solution – Set Up and Iterate
 Set up N-R iteration parameters
 reltol = 1e-6
 max_iter = 1e3
 𝜀𝜀0 = 10
 𝑖𝑖 = 0
 Iteratively update the approximation to the vector of
unknowns as long as
 Stopping criterion is not satisfied
𝜀𝜀𝑖𝑖 > 𝜀𝜀𝑠𝑠
 Maximum number of iterations is not exceeded
𝑖𝑖 ≤ 𝑚𝑚𝑚𝑚𝑚𝑚 _𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖
113
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Vector of bus voltage phasors
𝐕𝐕0 =
𝑉𝑉1∠𝛿𝛿1
𝑉𝑉2∠𝛿𝛿2,0
𝑉𝑉3,0∠𝛿𝛿3,0
=
1.0∠0°
1.05∠0°
1.0∠0°
 Current injected into each bus
𝐈𝐈0 = 𝐘𝐘 ⋅ 𝐕𝐕0
𝐈𝐈0 =
3.6 − 𝑗𝑗𝑗𝑗.6 −2.1 + 𝑗𝑗𝑗𝑗.9 −1.5 + 𝑗𝑗𝑗𝑗.7
−2.1 + 𝑗𝑗𝑗𝑗.9 4.1 − 𝑗𝑗𝑗𝑗.8 −2.1 + 𝑗𝑗𝑗𝑗.9
−1.5 + 𝑗𝑗𝑗𝑗.7 −2.1 + 𝑗𝑗𝑗𝑗.9 3.6 − 𝑗𝑗𝑗𝑗.6
1.0∠0°
1.05∠0°
1.0∠0°
𝐈𝐈0 =
1.05∠95.6°
2.10∠ − 84.4°
1.05∠95.6°
114
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Complex power injected into each bus
𝐒𝐒0 = 𝐕𝐕0 .∗ 𝐈𝐈0
∗
𝐒𝐒0 =
1.0∠0°
1.05∠0°
1.0∠0°
.∗
1.05∠95.6°
2.10∠ − 84.4°
1.05∠95.6°
∗
𝐒𝐒0 =
−0.103 − 𝑗𝑗𝑗.045
0.216 + 𝑗𝑗𝑗.195
−0.103 − 𝑗𝑗𝑗.045
 Real and reactive power
𝐏𝐏0 =
−0.103
0.216
−0.103
, 𝐐𝐐0 =
−1.045
2.195
−1.045
115
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Power mismatch
Δ𝐲𝐲0 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0
Δ𝐲𝐲0 =
2.0
−5.0
−1.0
−
0.216
−0.103
−1.045
=
1.784
−4.897
0.045
 Next, compute the Jacobian matrix
𝐉𝐉0 =
𝜕𝜕𝑃𝑃2
𝜕𝜕𝛿𝛿2
𝜕𝜕𝑃𝑃2
𝜕𝜕𝛿𝛿3
𝜕𝜕𝑃𝑃2
𝜕𝜕𝑉𝑉3
𝜕𝜕𝑃𝑃3
𝜕𝜕𝛿𝛿2
𝜕𝜕𝑃𝑃3
𝜕𝜕𝛿𝛿3
𝜕𝜕𝑃𝑃3
𝜕𝜕𝑉𝑉3
𝜕𝜕𝑄𝑄3
𝜕𝜕𝛿𝛿2
𝜕𝜕𝑄𝑄3
𝜕𝜕𝛿𝛿3
𝜕𝜕𝑄𝑄3
𝜕𝜕𝑉𝑉3 𝐱𝐱=𝐱𝐱0
116
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Elements of the Jacobian matrix are computed using 𝑉𝑉
and 𝛿𝛿 values from 𝐕𝐕0 and 𝑌𝑌 and 𝜃𝜃 values from 𝐘𝐘:
𝑉𝑉0 =
1.0
1.05
1.0
𝛿𝛿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°
117
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Jacobian, 𝐉𝐉1
𝜕𝜕𝑃𝑃2
𝜕𝜕𝛿𝛿2
= −𝑉𝑉2 𝑌𝑌21𝑉𝑉1 sin 𝛿𝛿2 − 𝛿𝛿1 − 𝜃𝜃21 + 𝑌𝑌23𝑉𝑉3 sin 𝛿𝛿2 − 𝛿𝛿3 − 𝜃𝜃23
𝜕𝜕𝑃𝑃3
𝜕𝜕𝛿𝛿3
= −𝑉𝑉3 𝑌𝑌31𝑉𝑉1 sin 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 sin 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32
𝜕𝜕𝑃𝑃2
𝜕𝜕𝛿𝛿3
= 𝑉𝑉2𝑌𝑌23𝑉𝑉3 sin 𝛿𝛿2 − 𝛿𝛿3 − 𝜃𝜃23
𝜕𝜕𝑃𝑃3
𝜕𝜕𝛿𝛿2
= 𝑉𝑉3𝑌𝑌32𝑉𝑉2 sin 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32
118
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Jacobian, 𝐉𝐉2
𝜕𝜕𝑃𝑃2
𝜕𝜕𝑉𝑉3
= 𝑉𝑉2𝑌𝑌23 cos 𝛿𝛿2 − 𝛿𝛿3 − 𝜃𝜃23
𝜕𝜕𝑃𝑃3
𝜕𝜕𝑉𝑉3
= 2 ⋅ 𝑉𝑉3𝑌𝑌33 cos 𝜃𝜃33 +
𝑌𝑌31𝑉𝑉1 cos 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32
 Jacobian, 𝐉𝐉3
𝜕𝜕𝑄𝑄3
𝜕𝜕𝛿𝛿2
= −𝑉𝑉3𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32
𝜕𝜕𝑄𝑄3
𝜕𝜕𝛿𝛿3
= 𝑉𝑉3 𝑌𝑌31𝑉𝑉1 cos 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32
119
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Jacobian, 𝐉𝐉4
𝜕𝜕𝑄𝑄3
𝜕𝜕𝑉𝑉3
= 𝑉𝑉3𝑌𝑌33 cos 𝜃𝜃33 +
𝑌𝑌31𝑉𝑉1 cos 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32
 Evaluating the Jacobian expressions using 𝑉𝑉 and 𝛿𝛿
values from 𝐕𝐕0 and 𝑌𝑌 and 𝜃𝜃 values from 𝐘𝐘, gives
𝐉𝐉0 =
43.89 −21.95 −2.160
−21.95 37.62 3.497
2.160 −3.702 35.53
120
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Use Gaussian elimination to solve for Δ𝐱𝐱0
Δ𝐲𝐲0 = 𝐉𝐉0Δ𝐱𝐱0 =
43.89 −21.95 −2.160
−21.95 37.62 3.497
2.160 −3.702 35.53
Δ𝑥𝑥1,0
Δ𝑥𝑥2,0
Δ𝑥𝑥3,0
=
1.784
−4.897
0.045
Δ𝐱𝐱0 =
−0.0345
−0.1492
−0.0122
 Update the vector of unknowns, 𝐱𝐱
𝐱𝐱1 = 𝐱𝐱0 + Δ𝐱𝐱0 =
0
0
1.0
+
−0.0345
−0.1492
−0.0122
=
−0.0345
−0.1492
0.9878
121
K. Webb ESE 470
Power-Flow Solution – Iterate
 𝑖𝑖 = 0:
 Use power mismatch to check for convergence
𝜀𝜀0 = max
𝑦𝑦𝑘𝑘 − 𝑓𝑓𝑘𝑘 𝑥𝑥
𝑦𝑦𝑘𝑘
= 0.9794
 Move on to the next iteration, 𝑖𝑖 = 1
 Create 𝐕𝐕1 using 𝐱𝐱1 values
 Calculate 𝐈𝐈1
 Calculate 𝐒𝐒1, 𝐏𝐏1, 𝐐𝐐1
 Create 𝐟𝐟 𝐱𝐱1 from 𝐏𝐏1 and 𝐐𝐐1
 Calculate Δ𝐲𝐲1, 𝐉𝐉1, Δ𝐱𝐱1
 Update 𝐱𝐱 to 𝐱𝐱2
 Check for convergence
 …
122
K. Webb ESE 470
Power-Flow Solution
 Convergence is achieved after four iterations
𝐕𝐕4 =
1.0∠0°
1.1∠ − 2.1°
0.97∠ − 8.8°
, 𝐒𝐒4 =
3.08 − 𝑗𝑗𝑗.82
2.0 + 𝑗𝑗𝑗.67
−5.0 − 𝑗𝑗𝑗.0
𝜀𝜀4 = 0.41 × 10−6
123
K. Webb ESE 470
Example Problems
124
K. Webb ESE 470
For the power system shown, determine
a) The type of each bus
b) The first row of the admittance matrix, 𝐘𝐘
c) The vector of unknowns, 𝐱𝐱
d) The vector of knowns, 𝐲𝐲
e) The Jacobian matrix, 𝐉𝐉, in symbolic form
125
K. Webb ESE 470
126
K. Webb ESE 470
127
K. Webb ESE 470
128

More Related Content

PDF
Introduction.power protection engineering
DOCX
Frequency analyis i
PPTX
Symmetrical component
PPT
Circuitanly
PPT
Ece4762011 lect11[1]
PDF
5. Power Flow Analaysis-updated SIMULINK
PDF
Ee423 fault analysis_notes
DOCX
Exp 5 (1)5. Newton Raphson load flow analysis Matlab Software
Introduction.power protection engineering
Frequency analyis i
Symmetrical component
Circuitanly
Ece4762011 lect11[1]
5. Power Flow Analaysis-updated SIMULINK
Ee423 fault analysis_notes
Exp 5 (1)5. Newton Raphson load flow analysis Matlab Software

Similar to Section 5 Power Flow.pdf (20)

PDF
Physics - Topic 11 Electric Circuits.pdf
PPTX
ECEN615_Fall2020_Lect4.pptx
PPTX
Power System Security_MMH.pptx
PPT
Power system analysis three phase system and power system operation
PPTX
Power system II Chapter-2 Load or power flow analysis.pptx
PPT
Lecture 10
PDF
[LEC-05] Load Flow Analysis Power System
PPTX
H06 elo f
PDF
Chapter Three-B Gauss-Seidel Load Flow Method.pdf
PDF
Chapter Three-B Gauss-Seidel Load Flow Method.pdf
PPTX
Analysis of unsymmetrical faults using bus impedence matrix
PPTX
Power system analysis in load flow analysis.pptx
PDF
Power System Analysis and Design
PPTX
W1_EE566.pptx
PPTX
class notes of electrical & electronics.pptx
PDF
Section 7 Fault Analysis.pdf
PDF
Fundamental Power System
PPTX
ECE476_2016_Lect 12.pptx
PDF
Ee 1351 power system analysis
PDF
MATEX @ DAC14
Physics - Topic 11 Electric Circuits.pdf
ECEN615_Fall2020_Lect4.pptx
Power System Security_MMH.pptx
Power system analysis three phase system and power system operation
Power system II Chapter-2 Load or power flow analysis.pptx
Lecture 10
[LEC-05] Load Flow Analysis Power System
H06 elo f
Chapter Three-B Gauss-Seidel Load Flow Method.pdf
Chapter Three-B Gauss-Seidel Load Flow Method.pdf
Analysis of unsymmetrical faults using bus impedence matrix
Power system analysis in load flow analysis.pptx
Power System Analysis and Design
W1_EE566.pptx
class notes of electrical & electronics.pptx
Section 7 Fault Analysis.pdf
Fundamental Power System
ECE476_2016_Lect 12.pptx
Ee 1351 power system analysis
MATEX @ DAC14
Ad

More from LucasMogaka (20)

PPTX
1502957399lectrure_5_KUET.pptx
PPT
Ch08_PPT_Fund_Elec_Circ_5e.ppt
PPTX
Power_plant_ecomices.pptx
PPTX
Transmission_and_Distribution_System.pptx
PPT
Basic_Laws.ppt
PPTX
loadforecasting-190205135237.pptx
PDF
NR-Power Flow.pdf
PPTX
Ac_steady_state_analyis.pptx
PDF
slides_12_ch 14-2- complex numbers.pdf
DOC
MATLAB DEKUT 2019.doc
PPT
LOAD FORECASTING.ppt
PDF
0ea1cdf161957c644e8c0b524c973c7e7b2c - Copy.pdf
PDF
Economic_Load_Dispatch.pdf
PDF
18053522.pdf
PPTX
CiT-03.pptx
PPTX
CiT-02.pptx
PPTX
Ac_steady_state_analyis.pptx
PPTX
CiT-03.pptx
PDF
1340050227.pdf
PDF
EE-8353 EDC COURSE MATERIAL.pdf
1502957399lectrure_5_KUET.pptx
Ch08_PPT_Fund_Elec_Circ_5e.ppt
Power_plant_ecomices.pptx
Transmission_and_Distribution_System.pptx
Basic_Laws.ppt
loadforecasting-190205135237.pptx
NR-Power Flow.pdf
Ac_steady_state_analyis.pptx
slides_12_ch 14-2- complex numbers.pdf
MATLAB DEKUT 2019.doc
LOAD FORECASTING.ppt
0ea1cdf161957c644e8c0b524c973c7e7b2c - Copy.pdf
Economic_Load_Dispatch.pdf
18053522.pdf
CiT-03.pptx
CiT-02.pptx
Ac_steady_state_analyis.pptx
CiT-03.pptx
1340050227.pdf
EE-8353 EDC COURSE MATERIAL.pdf
Ad

Recently uploaded (20)

PDF
electrical machines course file-anna university
PPTX
Agentic Artificial Intelligence (Agentic AI).pptx
PPTX
Environmental studies, Moudle 3-Environmental Pollution.pptx
PPTX
AI-Reporting for Emerging Technologies(BS Computer Engineering)
PDF
Present and Future of Systems Engineering: Air Combat Systems
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PPTX
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
PDF
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
PPTX
Environmental studies, Moudle 3-Environmental Pollution.pptx
PPTX
CT Generations and Image Reconstruction methods
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PDF
Unit1 - AIML Chapter 1 concept and ethics
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PPTX
CNS - Unit 1 (Introduction To Computer Networks) - PPT (2).pptx
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PDF
SEH5E Unveiled: Enhancements and Key Takeaways for Certification Success
PDF
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
PPTX
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
DOCX
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
PDF
Lesson 3 .pdf
electrical machines course file-anna university
Agentic Artificial Intelligence (Agentic AI).pptx
Environmental studies, Moudle 3-Environmental Pollution.pptx
AI-Reporting for Emerging Technologies(BS Computer Engineering)
Present and Future of Systems Engineering: Air Combat Systems
Computer System Architecture 3rd Edition-M Morris Mano.pdf
BBOC407 BIOLOGY FOR ENGINEERS (CS) - MODULE 1 PART 1.pptx
UEFA_Carbon_Footprint_Calculator_Methology_2.0.pdf
Environmental studies, Moudle 3-Environmental Pollution.pptx
CT Generations and Image Reconstruction methods
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
Unit1 - AIML Chapter 1 concept and ethics
20250617 - IR - Global Guide for HR - 51 pages.pdf
CNS - Unit 1 (Introduction To Computer Networks) - PPT (2).pptx
August -2025_Top10 Read_Articles_ijait.pdf
SEH5E Unveiled: Enhancements and Key Takeaways for Certification Success
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
WN UNIT-II CH4_MKaruna_BapatlaEngineeringCollege.pptx
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
Lesson 3 .pdf

Section 5 Power Flow.pdf

  • 1. ESE 470 – Energy Distribution Systems SECTION 5: POWER FLOW
  • 2. K. Webb ESE 470 Introduction 2
  • 3. K. Webb ESE 470 Nodal Analysis  Consider the following circuit  Three voltage sources  𝑉𝑉𝑠𝑠𝑠, 𝑉𝑉𝑠𝑠𝑠, 𝑉𝑉𝑠𝑠𝑠  Generic branch impedances  Could be any combination of R, L, and C  Three unknown node voltages  𝑉𝑉1, 𝑉𝑉2, and 𝑉𝑉3  Would like to analyze the circuit  Determine unknown node voltages  One possible analysis technique is nodal analysis 3
  • 4. K. Webb ESE 470 Nodal Analysis  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 𝑉𝑉1, we have 𝑉𝑉1 − 𝑉𝑉𝑠𝑠𝑠 𝑍𝑍𝑠𝑠𝑠 + 𝑉𝑉1 − 𝑉𝑉2 𝑍𝑍1 = 0  Every current term includes division by an impedance  Easier to work with admittances instead 4
  • 5. K. Webb ESE 470 Nodal Analysis  Now our first nodal equation becomes 𝑉𝑉1 − 𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠 + 𝑉𝑉1 − 𝑉𝑉2 𝑌𝑌1 = 0 where 𝑌𝑌𝑠𝑠𝑠 = 1/𝑍𝑍𝑠𝑠𝑠 and 𝑌𝑌1 = 1/𝑍𝑍1  Rearranging to place all unknown node voltages on the left and all source terms on the right 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌1 𝑉𝑉1 − 𝑌𝑌1𝑉𝑉2 = 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠  Applying KCL at node 𝑉𝑉2 𝑉𝑉2 − 𝑉𝑉1 𝑌𝑌1 + 𝑉𝑉2𝑌𝑌2 + 𝑉𝑉2 − 𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠 + 𝑉𝑉2 − 𝑉𝑉3 𝑌𝑌3 = 0 5
  • 6. K. Webb ESE 470 Nodal Analysis  Rearranging −𝑌𝑌1𝑉𝑉1 + 𝑌𝑌1 + 𝑌𝑌2 + 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌3 𝑉𝑉2 − 𝑌𝑌3𝑉𝑉3 = 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠  Finally, applying KCL at node 𝑉𝑉3, gives 𝑉𝑉3 − 𝑉𝑉2 𝑌𝑌3 + 𝑉𝑉3 − 𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠 = 0 −𝑌𝑌3𝑉𝑉2 + 𝑌𝑌3 + 𝑌𝑌𝑠𝑠𝑠 𝑉𝑉3 = 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠  Note that the source terms are the Norton equivalent current sources (short-circuit currents) associated with each voltage source 6
  • 7. K. Webb ESE 470 Nodal Analysis  Putting the nodal equations into matrix form 𝑌𝑌𝑠𝑠1 + 𝑌𝑌𝑌 −𝑌𝑌1 0 −𝑌𝑌1 𝑌𝑌1 + 𝑌𝑌2 + 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌3 −𝑌𝑌3 0 −𝑌𝑌3 𝑌𝑌3 + 𝑌𝑌𝑠𝑠𝑠 𝑉𝑉1 𝑉𝑉2 𝑉𝑉3 = 𝑌𝑌𝑠𝑠1𝑉𝑉𝑠𝑠1 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠 𝑌𝑌𝑠𝑠𝑠𝑉𝑉𝑠𝑠𝑠 or 𝒀𝒀𝒀𝒀 = 𝑰𝑰 where  𝒀𝒀 is the 𝑁𝑁 × 𝑁𝑁 admittance matrix  𝑰𝑰 is an 𝑁𝑁 × 1 vector of known source currents  𝑽𝑽 is an 𝑁𝑁 × 1 vector of unknown node voltages  This is a system of 𝑁𝑁 (here, three) linear equations with 𝑁𝑁 unknowns  We can solve for the vector of unknown voltages as 𝑽𝑽 = 𝒀𝒀−1 𝑰𝑰 7
  • 8. K. Webb ESE 470 The Admittance Matrix, 𝒀𝒀  Take a closer look at the form of the admittance matrix, 𝒀𝒀 𝑌𝑌𝑠𝑠1 + 𝑌𝑌𝑌 −𝑌𝑌1 0 −𝑌𝑌1 𝑌𝑌1 + 𝑌𝑌2 + 𝑌𝑌𝑠𝑠𝑠 + 𝑌𝑌3 −𝑌𝑌3 0 −𝑌𝑌3 𝑌𝑌3 + 𝑌𝑌𝑠𝑠𝑠 = 𝑌𝑌11 𝑌𝑌12 𝑌𝑌13 𝑌𝑌21 𝑌𝑌22 𝑦𝑦23 𝑌𝑌31 𝑌𝑌32 𝑌𝑌33  The elements of 𝒀𝒀 are  Diagonal elements, 𝑌𝑌𝑘𝑘𝑘𝑘:  𝑌𝑌𝑘𝑘𝑘𝑘 = sum of all admittances connected to node 𝑘𝑘  Self admittance or driving-point admittance  Off-diagonal elements, 𝑌𝑌𝑘𝑘𝑘𝑘 (𝑘𝑘 ≠ 𝑛𝑛):  𝑌𝑌𝑘𝑘𝑘𝑘 = −(total admittance between nodes 𝑘𝑘 and 𝑛𝑛)  Mutual admittance or transfer admittance  Note that, because the network is reciprocal, 𝒀𝒀 is symmetric 8
  • 9. K. Webb ESE 470 Nodal Analysis  Nodal analysis allows us to solve for unknown voltages given circuit admittances and current (Norton equivalent) inputs  An application of Ohm’s law 𝒀𝒀𝒀𝒀 = 𝑰𝑰  A linear equation  Simple, algebraic solution  For power-flow analysis, things get a bit more complicated 9
  • 10. K. Webb ESE 470 Power-Flow Analysis 10
  • 11. K. Webb ESE 470 The Power-Flow Problem  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 𝒀𝒀𝒀𝒀 = 𝑰𝑰  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 11
  • 12. K. Webb ESE 470 System One-Line Diagram  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 12
  • 13. K. Webb ESE 470 Bus Variables  The buses are the system nodes  Four variables associated with each bus, 𝑘𝑘  Voltage magnitude, 𝑉𝑉𝑘𝑘  Voltage phase angle, 𝛿𝛿𝑘𝑘  Real power delivered to the bus, 𝑃𝑃𝑘𝑘  Reactive power delivered to the bus, 𝑄𝑄𝑘𝑘 13
  • 14. K. Webb ESE 470 Bus Power  Net power delivered to bus 𝑘𝑘 is the difference between power flowing from generators to bus 𝑘𝑘 and power flowing from bus 𝑘𝑘 to loads 𝑃𝑃𝑘𝑘 = 𝑃𝑃𝐺𝐺𝐺𝐺 − 𝑃𝑃𝐿𝐿𝐿𝐿 𝑄𝑄𝑘𝑘 = 𝑄𝑄𝐺𝐺𝐺𝐺 − 𝑄𝑄𝐿𝐿𝐿𝐿  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, 𝒀𝒀𝑏𝑏𝑏𝑏𝑏𝑏 𝐈𝐈 = 𝐘𝐘𝑏𝑏𝑏𝑏𝑏𝑏𝐕𝐕  𝐘𝐘𝑏𝑏𝑏𝑏𝑏𝑏 contains the bus mutual and self admittances associated with transmission lines and transformers  For an 𝑁𝑁 bus system, 𝐕𝐕 is an 𝑁𝑁 × 1 vector of bus voltages  𝐈𝐈 is an 𝑁𝑁 × 1 vector of source currents flowing into each bus  From generators and loads 14
  • 15. K. Webb ESE 470 Types of Buses  There are four variables associated with each bus  𝑉𝑉𝑘𝑘 = 𝑽𝑽𝑘𝑘  𝛿𝛿𝑘𝑘 = ∠𝑽𝑽𝑘𝑘  𝑃𝑃𝑘𝑘  𝑄𝑄𝑘𝑘  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) 15
  • 16. K. Webb ESE 470 Bus Types  Slack bus (swing bus):  Reference bus  Typically bus 1  Inputs are voltage magnitude, 𝑉𝑉1, and phase angle, 𝛿𝛿1  Typically 1.0∠0°  Power, 𝑃𝑃1 and 𝑄𝑄1, is computed  Load bus (𝑷𝑷𝑷𝑷 bus):  Buses to which only loads are connected  Real power, 𝑃𝑃𝑘𝑘, and reactive power, 𝑄𝑄𝑘𝑘, are the knowns  𝑉𝑉𝑘𝑘 and 𝛿𝛿𝑘𝑘 are calculated  Majority of power system buses are load buses 16
  • 17. K. Webb ESE 470 Bus Types  Voltage-controlled bus (𝑷𝑷𝑷𝑷 bus):  Buses connected to generators  Buses with shunt reactive compensation  Real power, 𝑃𝑃𝑘𝑘, and voltage magnitude, 𝑉𝑉𝑘𝑘, are known inputs  Reactive power, 𝑄𝑄𝑘𝑘, and voltage phase angle, 𝛿𝛿𝑘𝑘, are calculated 17
  • 18. K. Webb ESE 470 Solving the Power-Flow Problem  The power-flow solution involves determining:  𝑉𝑉𝑘𝑘, 𝛿𝛿𝑘𝑘, 𝑃𝑃𝑘𝑘, and 𝑄𝑄𝑘𝑘  There are 𝑁𝑁 buses  Each with two unknown quantities  There are 2𝑁𝑁 unknown quantities in total  Need 2𝑁𝑁 equations  𝑁𝑁 of these equations are the nodal equations 𝑰𝑰 = 𝒀𝒀𝒀𝒀 (1)  The other 𝑁𝑁 equations are the power-balance equations 𝑺𝑺𝑘𝑘 = 𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑽𝑽𝑘𝑘𝑰𝑰𝑘𝑘 ∗ (2)  From (1), the nodal equation for the 𝑘𝑘𝑡𝑡𝑡 bus is 𝑰𝑰𝑘𝑘 = ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘𝑽𝑽𝑛𝑛 (3) 18
  • 19. K. Webb ESE 470 Solving the Power-Flow Problem  Substituting (3) into (2) gives 𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑽𝑽𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘𝑽𝑽𝑛𝑛 ∗ (4)  The bus voltages in (3) and (4) are phasors, which we can represent as 𝑽𝑽𝑛𝑛 = 𝑉𝑉 𝑛𝑛𝑒𝑒𝑗𝑗𝛿𝛿𝑛𝑛 and 𝑽𝑽𝑘𝑘 = 𝑉𝑉𝑘𝑘𝑒𝑒𝑗𝑗𝛿𝛿𝑘𝑘 (5)  The admittances can also be written in polar form 𝑌𝑌𝑘𝑘𝑘𝑘 = 𝑌𝑌𝑘𝑘𝑘𝑘 𝑒𝑒𝑗𝑗𝜃𝜃𝑘𝑘𝑘𝑘 (6)  Using (5) and (6) in (4) gives 𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘𝑒𝑒𝑗𝑗𝛿𝛿𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑒𝑒𝑗𝑗𝜃𝜃𝑘𝑘𝑘𝑘𝑉𝑉 𝑛𝑛𝑒𝑒𝑗𝑗𝛿𝛿𝑛𝑛 ∗ 𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛𝑒𝑒𝑗𝑗 𝛿𝛿𝑘𝑘−𝛿𝛿𝑛𝑛−𝜃𝜃𝑘𝑘𝑘𝑘 (7) 19
  • 20. K. Webb ESE 470 Solving the Power-Flow Problem  In Cartesian form, (7) becomes 𝑃𝑃𝑘𝑘 + 𝑗𝑗𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 [cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 +𝑗𝑗 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 ] (8)  From (8), active power is 𝑃𝑃𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (9)  And, reactive power is 𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (10) 20
  • 21. K. Webb ESE 470 Solving the Power-Flow Problem 𝑃𝑃𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (9) 𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 ∑𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (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 21
  • 22. K. Webb ESE 470 Solving the Power-Flow Problem  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 22
  • 23. K. Webb ESE 470 Linear Systems of Equations – Direct Solution 23
  • 24. K. Webb ESE 470 Solving Linear Systems of Equations  Gaussian elimination  Direct (i.e. non-iterative) solution  Two parts to the algorithm:  Forward elimination  Back substitution 24
  • 25. K. Webb ESE 470 Gaussian Elimination  Consider a system of equations −4𝑥𝑥1 + 7𝑥𝑥3 = −5 2𝑥𝑥1 − 3𝑥𝑥2 + 5𝑥𝑥3 = −12 𝑥𝑥2 − 3𝑥𝑥3 = 3  This can be expressed in matrix form: −4 0 7 2 −3 5 0 1 −3 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 = −5 −12 3  In general 𝐀𝐀 ⋅ 𝐱𝐱 = 𝐲𝐲  For a system of three equations with three unknowns: 𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 𝐴𝐴21 𝐴𝐴22 𝐴𝐴23 𝐴𝐴31 𝐴𝐴32 𝐴𝐴33 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 = 𝑦𝑦1 𝑦𝑦2 𝑦𝑦3 25
  • 26. K. Webb ESE 470 Gaussian Elimination  We’ll use a 3×3 system as an example to develop the Gaussian elimination algorithm 𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 𝐴𝐴21 𝐴𝐴22 𝐴𝐴23 𝐴𝐴31 𝐴𝐴32 𝐴𝐴33 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 = 𝑦𝑦1 𝑦𝑦2 𝑦𝑦3  First, create the augmented system matrix 𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 ⋮ 𝑦𝑦1 𝐴𝐴21 𝐴𝐴22 𝐴𝐴23 ⋮ 𝑦𝑦2 𝐴𝐴31 𝐴𝐴32 𝐴𝐴33 ⋮ 𝑦𝑦3  Each row represents and equation  𝑁𝑁 rows for 𝑁𝑁 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 26
  • 27. K. Webb ESE 470 Gaussian Elimination – Forward Elimination  Perform row operations to reduce the augmented matrix to upper triangular  Only zeros below the main diagonal  Eliminate 𝑥𝑥𝑖𝑖 from the 𝑖𝑖 + 1 st through the 𝑁𝑁th equations for 𝑖𝑖 = 1 … 𝑁𝑁  Forward elimination  After forward elimination, we have 𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 ⋮ 𝑦𝑦1 0 𝐴𝐴22 ′ 𝐴𝐴23 ′ ⋮ 𝑦𝑦2 ′ 0 0 𝐴𝐴33 ′ ⋮ 𝑦𝑦3 ′  Where the prime notation (e.g. 𝐴𝐴22 ′ ) indicates that the value has been changed from its original value 27
  • 28. K. Webb ESE 470 Gaussian Elimination – Back Substitution 𝐴𝐴11 𝐴𝐴12 𝐴𝐴13 ⋮ 𝑦𝑦1 0 𝐴𝐴22 ′ 𝐴𝐴23 ′ ⋮ 𝑦𝑦2 ′ 0 0 𝐴𝐴33 ′ ⋮ 𝑦𝑦3 ′  The last row represents an equation with only a single unknown 𝐴𝐴33 ′ ⋅ 𝑥𝑥3 = 𝑦𝑦3 ′  Solve for 𝑥𝑥3 𝑥𝑥3 = 𝑦𝑦3 ′ 𝐴𝐴33 ′  The second-to-last row represents an equation with two unknowns 𝐴𝐴22 ′ ⋅ 𝑥𝑥2 + 𝐴𝐴23 ′ ⋅ 𝑥𝑥3 = 𝑦𝑦2 ′  Substitute in newly-found value of 𝑥𝑥3  Solve for 𝑥𝑥2  Substitute values for 𝑥𝑥2 and 𝑥𝑥3 into the first-row equation  Solve for 𝑥𝑥1  This process is back substitution 28
  • 29. K. Webb ESE 470 Gaussian elimination  Gaussian elimination summary  Create the augmented system matrix  Forward elimination  Reduce to an upper-triangular matrix  Back substitution  Starting with 𝑥𝑥𝑁𝑁, solve for 𝑥𝑥𝑖𝑖 for 𝑖𝑖 = 𝑁𝑁 … 1  A direct solution algorithm  Exact value for each 𝑥𝑥𝑖𝑖 arrived at with a single execution of the algorithm  Alternatively, we can use an iterative algorithm  The Jacobi method 29
  • 30. K. Webb ESE 470 Linear Systems of Equations – Iterative Solution – Jacobi Method 30
  • 31. K. Webb ESE 470 Jacobi Method  Consider a system of 𝑁𝑁 linear equations 𝐀𝐀 ⋅ 𝐱𝐱 = 𝐲𝐲 𝐴𝐴1,1 ⋯ 𝐴𝐴1,𝑁𝑁 ⋮ ⋱ ⋮ 𝐴𝐴𝑁𝑁,1 ⋯ 𝐴𝐴𝑁𝑁,𝑁𝑁 𝑥𝑥1 ⋮ 𝑥𝑥𝑁𝑁 = 𝑦𝑦1 ⋮ 𝑦𝑦𝑁𝑁  The 𝑘𝑘th equation (𝑘𝑘th row) is 𝐴𝐴𝑘𝑘,1𝑥𝑥1 + 𝐴𝐴𝑘𝑘,2𝑥𝑥2 + ⋯ + 𝐴𝐴𝑘𝑘,𝑘𝑘𝑥𝑥𝑘𝑘 + ⋯ + 𝐴𝐴𝑘𝑘,𝑁𝑁𝑥𝑥𝑁𝑁 = 𝑦𝑦𝑘𝑘 (11)  Solve (11) for 𝑥𝑥𝑘𝑘 𝑥𝑥𝑘𝑘 = 1 𝐴𝐴𝑘𝑘,𝑘𝑘 [𝑦𝑦𝑘𝑘 − (𝐴𝐴𝑘𝑘,1𝑥𝑥1 + 𝐴𝐴𝑘𝑘,2𝑥𝑥2 + ⋯ + 𝐴𝐴𝑘𝑘,𝑘𝑘−1𝑥𝑥𝑘𝑘−1 + (12) +𝐴𝐴𝑘𝑘,𝑘𝑘+1𝑥𝑥𝑘𝑘+1 + ⋯ + 𝐴𝐴𝑘𝑘,𝑁𝑁𝑥𝑥𝑁𝑁)] 31
  • 32. K. Webb ESE 470 Jacobi Method  Simplify (12) using summing notation 𝑥𝑥𝑘𝑘 = 1 𝐴𝐴𝑘𝑘,𝑘𝑘 𝑦𝑦𝑘𝑘 − � 𝑛𝑛=1 𝑘𝑘−1 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛 − � 𝑛𝑛=𝑘𝑘+1 𝑁𝑁 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛 , 𝑘𝑘 = 1 … 𝑁𝑁  An equation for 𝑥𝑥𝑘𝑘  But, of course, we don’t yet know all other 𝑥𝑥𝑛𝑛 values  Use (13) as an iterative expression 𝑥𝑥𝑘𝑘,𝑖𝑖+1 = 1 𝐴𝐴𝑘𝑘,𝑘𝑘 𝑦𝑦𝑘𝑘 − � 𝑛𝑛=1 𝑘𝑘−1 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 − � 𝑛𝑛=𝑘𝑘+1 𝑁𝑁 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁  The 𝑖𝑖 subscript indicates iteration number  𝑥𝑥𝑘𝑘,𝑖𝑖+1 is the updated value from the current iteration  𝑥𝑥𝑛𝑛,𝑖𝑖 is a value from the previous iteration (13) (14) 32
  • 33. K. Webb ESE 470 Jacobi Method 𝑥𝑥𝑘𝑘,𝑖𝑖+1 = 1 𝐴𝐴𝑘𝑘,𝑘𝑘 𝑦𝑦𝑘𝑘 − � 𝑛𝑛=1 𝑘𝑘−1 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 − � 𝑛𝑛=𝑘𝑘+1 𝑁𝑁 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁  Old values of 𝑥𝑥𝑛𝑛, on the right-hand side, are used to update 𝑥𝑥𝑘𝑘 on the left-hand side  Start with an initial guess for all unknowns, 𝐱𝐱0  Iterate until adequate convergence is achieved  Until a specified stopping criterion is satisfied  Convergence is not guaranteed (14) 33
  • 34. K. Webb ESE 470 Convergence  An approximation of 𝐱𝐱 is refined on each iteration  Continue to iterate until we’re close to the right answer for the vector of unknowns, 𝐱𝐱  Assume we’ve converged to the right answer when 𝐱𝐱 changes very little from iteration to iteration  On each iteration, calculate a relative error quantity 𝜀𝜀𝑖𝑖 = max 𝑥𝑥𝑘𝑘,𝑖𝑖+1 − 𝑥𝑥𝑘𝑘,𝑖𝑖 𝑥𝑥𝑘𝑘,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁  Iterate until 𝜀𝜀𝑖𝑖 ≤ 𝜀𝜀𝑠𝑠 where 𝜀𝜀𝑠𝑠 is a chosen stopping criterion 34
  • 35. K. Webb ESE 470 Jacobi Method – Matrix Form  The Jacobi method iterative formula, (14), can be rewritten in matrix form: 𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1𝐲𝐲 where 𝐃𝐃 is the diagonal elements of A 𝐃𝐃 = 𝐴𝐴1,1 0 ⋯ 0 0 𝐴𝐴2,2 0 ⋮ ⋮ 0 ⋱ 0 0 ⋯ 0 𝐴𝐴𝑁𝑁,𝑁𝑁 and 𝐌𝐌 = 𝐃𝐃−1 𝐃𝐃 − 𝐀𝐀  Recall that the inverse of a diagonal matrix is given by inverting each diagonal element 𝐃𝐃−𝟏𝟏 = 1/𝐴𝐴1,1 0 ⋯ 0 0 1/𝐴𝐴2,2 0 ⋮ ⋮ 0 ⋱ 0 0 ⋯ 0 1/𝐴𝐴𝑁𝑁,𝑁𝑁 (15) (16) 35
  • 36. K. Webb ESE 470 Jacobi Method – Example  Consider the following system of equations −4𝑥𝑥1 + 7𝑥𝑥3 = −5 2𝑥𝑥1 − 3𝑥𝑥2 + 5𝑥𝑥3 = −12 𝑥𝑥2 − 3𝑥𝑥3 = 3  In matrix form: −4 0 7 2 −3 5 0 1 −3 𝑥𝑥1 𝑥𝑥2 𝑥𝑥3 = −5 −12 3  Solve using the Jacobi method 36
  • 37. K. Webb ESE 470 Jacobi Method – Example  The iteration formula is 𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1𝐲𝐲 where 𝐃𝐃 = −4 0 0 0 −3 0 0 0 −3 𝐃𝐃−1 = −0.25 0 0 0 −0.333 0 0 0 −0.333 𝐌𝐌 = 𝐃𝐃−1 𝐃𝐃 − 𝐀𝐀 = 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, 𝐱𝐱  Often, we have some idea of the answer  Here, arbitrarily choose 𝐱𝐱0 = 10 25 10 𝑇𝑇 37
  • 38. K. Webb ESE 470 Jacobi Method – Example  At each iteration, calculate 𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1𝐲𝐲 𝑥𝑥1,𝑖𝑖+1 𝑥𝑥2,𝑖𝑖+1 𝑥𝑥3,𝑖𝑖+1 = 0 0 1.75 0.667 0 1.667 0 0.333 0 𝑥𝑥1,𝑖𝑖 𝑥𝑥2,𝑖𝑖 𝑥𝑥3,𝑖𝑖 + 1.25 4 −1  For 𝑖𝑖 = 1: 𝐱𝐱1 = 𝑥𝑥1,1 𝑥𝑥2,1 𝑥𝑥3,1 = 0 0 1.75 0.667 0 1.667 0 0.333 0 10 25 10 + 1.25 4 −1 𝐱𝐱1 = 18.75 27.33 7.33 𝑇𝑇  The relative error is 𝜀𝜀1 = max 𝑥𝑥𝑘𝑘,1 − 𝑥𝑥𝑘𝑘,0 𝑥𝑥𝑘𝑘,0 = 0.875 38
  • 39. K. Webb ESE 470 Jacobi Method – Example  For 𝑖𝑖 = 2: 𝐱𝐱2 = 𝑥𝑥1,2 𝑥𝑥2,2 𝑥𝑥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 𝐱𝐱2 = 14.08 28.72 8.11 𝑇𝑇  The relative error is 𝜀𝜀2 = max 𝑥𝑥𝑘𝑘,2 − 𝑥𝑥𝑘𝑘,1 𝑥𝑥𝑘𝑘,1 = 0.249  Continue to iterate until relative error falls below a specified stopping condition 39
  • 40. K. Webb ESE 470 Jacobi Method – Example  Automate with computer code, e.g. MATLAB  Setup the system of equations  Initialize matrices and parameters for iteration 40
  • 41. K. Webb ESE 470 Jacobi Method – Example  Loop to continue iteration as long as:  Stopping criterion is not satisfied  Maximum number of iterations is not exceeded  On each iteration  Use previous 𝐱𝐱 values to update 𝐱𝐱  Calculate relative error  Increment the number of iterations 41
  • 42. K. Webb ESE 470 Jacobi Method – Example  Set 𝜀𝜀𝑠𝑠 = 1 × 10−6 and iterate: 𝒊𝒊 𝐱𝐱𝒊𝒊 𝜺𝜺𝒊𝒊 0 10 25 10 𝑇𝑇 - 1 18.75 27.33 7.33 𝑇𝑇 0.875 2 14.08 28.72 8.11 𝑇𝑇 0.249 3 15.44 26.91 8.57 𝑇𝑇 0.097 4 16.25 28.59 7.97 𝑇𝑇 0.071 5 15.20 28.12 8.53 𝑇𝑇 0.070 6 16.18 28.35 8.37 𝑇𝑇 0.065 ⋮ ⋮ ⋮ 371 20.50 36.00 11.00 𝑇𝑇 0.995×10-6  Convergence achieved in 371 iterations 42
  • 43. K. Webb ESE 470 Linear Systems of Equations – Iterative Solution – Gauss-Seidel 43
  • 44. K. Webb ESE 470 Gauss-Seidel Method  The iterative formula for the Jacobi method is 𝑥𝑥𝑘𝑘,𝑖𝑖+1 = 1 𝐴𝐴𝑘𝑘,𝑘𝑘 𝑦𝑦𝑘𝑘 − � 𝑛𝑛=1 𝑘𝑘−1 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 − � 𝑛𝑛=𝑘𝑘+1 𝑁𝑁 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁  Note that only old values of 𝑥𝑥𝑛𝑛 (i.e. 𝑥𝑥𝑛𝑛,𝑖𝑖) are used to update the value of 𝑥𝑥𝑘𝑘  Assume the 𝑥𝑥𝑘𝑘,𝑖𝑖+1 values are determined in order of increasing 𝑘𝑘  When updating 𝑥𝑥𝑘𝑘,𝑖𝑖+1, all 𝑥𝑥𝑛𝑛,𝑖𝑖+1 values are already known for 𝑛𝑛 < 𝑘𝑘  We can use those updated values to calculate 𝑥𝑥𝑘𝑘,𝑖𝑖+1  The Gauss-Seidel method (14) 44
  • 45. K. Webb ESE 470 Gauss-Seidel Method  Now use the 𝑥𝑥𝑛𝑛 values already updated on the current iteration to update 𝑥𝑥𝑘𝑘  That is, 𝑥𝑥𝑛𝑛,𝑖𝑖+1 for 𝑛𝑛 < 𝑘𝑘  Gauss-Seidel iterative formula 𝑥𝑥𝑘𝑘,𝑖𝑖+1 = 1 𝐴𝐴𝑘𝑘,𝑘𝑘 𝑦𝑦𝑘𝑘 − � 𝑛𝑛=1 𝑘𝑘−1 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖+1 − � 𝑛𝑛=𝑘𝑘+1 𝑁𝑁 𝐴𝐴𝑘𝑘,𝑛𝑛𝑥𝑥𝑛𝑛,𝑖𝑖 , 𝑘𝑘 = 1 … 𝑁𝑁  Note that only the first summation has changed  For already updated 𝑥𝑥 values  𝑥𝑥𝑛𝑛 for 𝑛𝑛 < 𝑘𝑘  Number of already-updated values used depends on 𝑘𝑘 (17) 45
  • 46. K. Webb ESE 470 Gauss-Seidel – Matrix Form  In matrix form the iterative formula is the same as for the Jacobi method 𝐱𝐱𝑖𝑖+1 = 𝐌𝐌𝐱𝐱𝑖𝑖 + 𝐃𝐃−1 𝐲𝐲 where, again 𝐌𝐌 = 𝐃𝐃−1 𝐃𝐃 − 𝐀𝐀 but now 𝐃𝐃 is the lower triangular part of 𝐀𝐀 𝐃𝐃 = 𝐴𝐴1,1 0 ⋯ 0 𝐴𝐴2,1 𝐴𝐴2,2 0 ⋮ ⋮ ⋮ ⋱ 0 𝐴𝐴𝑁𝑁,1 𝐴𝐴𝑁𝑁,2 ⋯ 𝐴𝐴𝑁𝑁,𝑁𝑁  Otherwise, the algorithm and computer code is identical to that of the Jacobi method (15) (16) 46
  • 47. K. Webb ESE 470 Gauss-Seidel – Example  Apply Gauss-Seidel to our previous example  𝑥𝑥0 = 10 25 10 𝑇𝑇  𝜀𝜀𝑠𝑠 = 1 × 10−6 𝒊𝒊 𝐱𝐱𝒊𝒊 𝜺𝜺𝒊𝒊 0 10 25 10 𝑇𝑇 - 1 18.75 33.17 10.06 𝑇𝑇 0.875 2 18.85 33.32 10.11 𝑇𝑇 0.005 3 18.94 33.47 10.16 𝑇𝑇 0.005 4 19.03 33.61 10.20 𝑇𝑇 0.005 ⋮ ⋮ ⋮ 151 20.50 36.00 11.00 𝑇𝑇 0.995×10-6  Convergence achieved in 151 iterations  Compared to 371 for the Jacobi method 47
  • 48. K. Webb ESE 470 Nonlinear Equations 48
  • 49. K. Webb ESE 470 Nonlinear Equations  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 49
  • 50. K. Webb ESE 470 Newton-Raphson Method  Want to solve 𝑦𝑦 = 𝑓𝑓(𝑥𝑥) where 𝑓𝑓 𝑥𝑥 is a nonlinear function  That is, we want to find 𝑥𝑥, given a known nonlinear function, 𝑓𝑓, and a known output, 𝑦𝑦  Newton-Raphson method  Based on a first-order Taylor series approximation to 𝑓𝑓 𝑥𝑥  The nonlinear 𝑓𝑓 𝑥𝑥 is approximated as linear to update our approximation to the solution, 𝑥𝑥, on each iteration 50
  • 51. K. Webb ESE 470 Taylor Series Approximation  Taylor series approximation  Given:  A function, 𝑓𝑓 𝑥𝑥  Value of the function at some value of 𝑥𝑥, 𝑓𝑓 𝑥𝑥0  Approximate:  Value of the function at some other value of 𝑥𝑥  First-order Taylor series approximation  Approximate 𝑓𝑓 𝑥𝑥 using only its first derivative  𝑓𝑓 𝑥𝑥 approximated as linear – constant slope 𝑦𝑦 = 𝑓𝑓 𝑥𝑥 ≈ 𝑓𝑓 𝑥𝑥0 + 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 � 𝑥𝑥=𝑥𝑥0 𝑥𝑥 − 𝑥𝑥0 = � 𝑦𝑦 51
  • 52. K. Webb ESE 470 First-Order Taylor Series Approximation  Approximate value of the function at 𝑥𝑥 𝑓𝑓 𝑥𝑥 ≈ � 𝑦𝑦 = 𝑓𝑓 𝑥𝑥0 + 𝑓𝑓′ 𝑥𝑥0 𝑥𝑥 − 𝑥𝑥0 52
  • 53. K. Webb ESE 470 Newton-Raphson Method  First order Taylor series approximation is 𝑦𝑦 ≈ 𝑓𝑓 𝑥𝑥0 + 𝑓𝑓′ 𝑥𝑥0 𝑥𝑥 − 𝑥𝑥0  Letting this be an equality and rearranging gives an iterative formula for updating an approximation to 𝑥𝑥 𝑦𝑦 = 𝑓𝑓 𝑥𝑥𝑖𝑖 + 𝑓𝑓′ 𝑥𝑥𝑖𝑖 𝑥𝑥𝑖𝑖+1 − 𝑥𝑥𝑖𝑖 𝑓𝑓′ 𝑥𝑥𝑖𝑖 𝑥𝑥𝑖𝑖+1 − 𝑥𝑥𝑖𝑖 = 𝑦𝑦 − 𝑓𝑓 𝑥𝑥𝑖𝑖 𝑥𝑥𝑖𝑖+1 = 𝑥𝑥𝑖𝑖 + 1 𝑓𝑓′ 𝑥𝑥𝑖𝑖 𝑦𝑦 − 𝑓𝑓 𝑥𝑥𝑖𝑖  Initialize with a best guess at 𝑥𝑥, 𝑥𝑥0  Iterate (18) until  A stopping criterion is satisfied, or  The maximum number of iterations is reached (18) 53
  • 54. K. Webb ESE 470 First-Order Taylor Series Approximation  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 𝑥𝑥𝑖𝑖+1 = 𝑥𝑥𝑖𝑖 + 1 𝑓𝑓′ 𝑥𝑥𝑖𝑖 𝑦𝑦 − 𝑓𝑓 𝑥𝑥𝑖𝑖 54
  • 55. K. Webb ESE 470 Newton-Raphson – Example  Consider the following nonlinear equation 𝑦𝑦 = 𝑓𝑓 𝑥𝑥 = 𝑥𝑥3 + 10 = 20  Apply Newton-Raphson to solve  Find 𝑥𝑥, such that 𝑦𝑦 = 𝑓𝑓 𝑥𝑥 = 20  The derivative function is 𝑓𝑓′ 𝑥𝑥 = 3𝑥𝑥2  Initial guess for 𝑥𝑥 𝑥𝑥0 = 1  Iterate using the formula given by (18) 55
  • 56. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 1: 𝑥𝑥1 = 𝑥𝑥0 + 𝑓𝑓′ 𝑥𝑥0 −1 𝑦𝑦 − 𝑓𝑓 𝑥𝑥0 𝑥𝑥1 = 1 + 3 ⋅ 12 −1 20 − 13 + 10 𝑥𝑥1 = 4 𝜀𝜀1 = 𝑥𝑥1 − 𝑥𝑥0 𝑥𝑥0 𝜀𝜀1 = 4 − 1 1 = 3 𝑥𝑥1 = 4, 𝜀𝜀1 = 3 56
  • 57. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 2: 𝑥𝑥2 = 𝑥𝑥1 + 𝑓𝑓′ 𝑥𝑥1 −1 𝑦𝑦 − 𝑓𝑓 𝑥𝑥1 𝑥𝑥2 = 4 + 3 ⋅ 42 −1 20 − 43 + 10 𝑥𝑥2 = 2.875 𝜀𝜀2 = 𝑥𝑥2 − 𝑥𝑥1 𝑥𝑥1 𝜀𝜀2 = 2.875 − 4 4 𝜀𝜀2 = 0.281 𝑥𝑥2 = 2.875, 𝜀𝜀2 = 0.281 57
  • 58. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 3: 𝑥𝑥3 = 𝑥𝑥2 + 𝑓𝑓′ 𝑥𝑥2 −1 𝑦𝑦 − 𝑓𝑓 𝑥𝑥2 𝑥𝑥3 = 2.875 + 3 ⋅ 2.8752 −1 20 − 2.8753 + 10 𝑥𝑥3 = 2.32 𝜀𝜀3 = 𝑥𝑥3 − 𝑥𝑥2 𝑥𝑥2 𝜀𝜀3 = 2.32 − 2.875 2.875 𝜀𝜀3 = 0.193 𝑥𝑥3 = 2.32, 𝜀𝜀3 = 0.193 58
  • 59. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 4: 𝑥𝑥4 = 2.166, 𝜀𝜀4 = 0.066  𝑖𝑖 = 5: 𝑥𝑥5 = 2.155, 𝜀𝜀5 = 0.005  𝑖𝑖 = 6: 𝑥𝑥6 = 2.154, 𝜀𝜀6 = 28.4 × 10−6  𝑖𝑖 = 7: 𝑥𝑥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
  • 60. K. Webb ESE 470 Example Problems 60
  • 61. K. Webb ESE 470 Perform three iterations toward the solution of the following system of equations using the Jacobi method. Let 𝐱𝐱0 = 0, 0 𝑇𝑇. 2𝑥𝑥1 + 𝑥𝑥2 = 12 2𝑥𝑥1 + 3𝑥𝑥2 = 5 61
  • 62. K. Webb ESE 470 62
  • 63. K. Webb ESE 470 63
  • 64. K. Webb ESE 470 64
  • 65. K. Webb ESE 470 Perform three iterations toward the solution of the following system of equations using the Gauss-Seidel method. Let 𝐱𝐱0 = 0, 0 𝑇𝑇. 2𝑥𝑥1 + 𝑥𝑥2 = 12 2𝑥𝑥1 + 3𝑥𝑥2 = 5 65
  • 66. K. Webb ESE 470 66
  • 67. K. Webb ESE 470 67
  • 68. K. Webb ESE 470 68
  • 69. K. Webb ESE 470 Perform three iterations toward the solution of the following equation using the Newton-Raphson method. Let 𝐱𝐱0 = 0. 𝑓𝑓 𝑥𝑥 = cos 𝑥𝑥 + 3𝑥𝑥 = 10 69
  • 70. K. Webb ESE 470 70
  • 71. K. Webb ESE 470 Nonlinear Systems of Equations 71
  • 72. K. Webb ESE 470 Nonlinear Systems of Equations  Now, consider a system of nonlinear equations  Can be represented as a vector of 𝑁𝑁 functions  Each is a function of an 𝑁𝑁-vector of unknown variables 𝐲𝐲 = 𝑦𝑦1 𝑦𝑦2 ⋮ 𝑦𝑦𝑁𝑁 = 𝐟𝐟 𝐱𝐱 = 𝑓𝑓1 𝑥𝑥1, 𝑥𝑥2, ⋯ , 𝑥𝑥𝑁𝑁 𝑓𝑓2 𝑥𝑥1, 𝑥𝑥2, ⋯ , 𝑥𝑥𝑁𝑁 ⋮ 𝑓𝑓𝑁𝑁 𝑥𝑥1, 𝑥𝑥2, ⋯ , 𝑥𝑥𝑁𝑁  We can again approximate this function using a first-order Taylor series 𝐲𝐲 = 𝐟𝐟 𝐱𝐱 ≈ 𝐟𝐟 𝐱𝐱0 + 𝐟𝐟′ 𝐱𝐱0 𝐱𝐱 − 𝐱𝐱0  Note that all variables are 𝑁𝑁-vectors  𝐟𝐟 is an 𝑁𝑁-vector of known, nonlinear functions  𝐱𝐱 is an 𝑁𝑁-vector of unknown values – this is what we want to solve for  𝐲𝐲 is an 𝑁𝑁-vector of known values  𝐱𝐱𝟎𝟎 is an 𝑁𝑁-vector of 𝐱𝐱 values for which 𝐟𝐟 𝐱𝐱0 is known (19) 72
  • 73. K. Webb ESE 470 Newton-Raphson Method  Equation (19) is the basis for our Newton-Raphson iterative formula  Again, let it be an equality and solve for 𝐱𝐱 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 = 𝐟𝐟′ 𝐱𝐱0 𝐱𝐱 − 𝐱𝐱0 𝐟𝐟′ 𝐱𝐱0 −𝟏𝟏 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 = 𝐱𝐱 − 𝐱𝐱0 𝐱𝐱 = 𝐱𝐱0 + 𝐟𝐟′ 𝐱𝐱0 −𝟏𝟏 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0  This last expression can be used as an iterative formula 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐟𝐟′ 𝐱𝐱𝑖𝑖 −𝟏𝟏 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖  The derivative term on the right-hand side of (20) is an 𝑁𝑁 × 𝑁𝑁 matrix  The Jacobian matrix, 𝐉𝐉 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖 −𝟏𝟏 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖 (20) 73
  • 74. K. Webb ESE 470 The Jacobian Matrix 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖 −𝟏𝟏 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖  Jacobian matrix  𝑁𝑁 × 𝑁𝑁 matrix of partial derivatives for 𝐟𝐟 𝐱𝐱  Evaluated at the current value of 𝐱𝐱, 𝐱𝐱𝑖𝑖 𝐉𝐉𝑖𝑖 = 𝜕𝜕𝑓𝑓1 𝜕𝜕𝑥𝑥1 𝜕𝜕𝑓𝑓1 𝜕𝜕𝑥𝑥2 ⋯ 𝜕𝜕𝑓𝑓1 𝜕𝜕𝑥𝑥𝑁𝑁 𝜕𝜕𝑓𝑓2 𝜕𝜕𝑥𝑥1 𝜕𝜕𝑓𝑓2 𝜕𝜕𝑥𝑥2 ⋯ 𝜕𝜕𝑓𝑓2 𝜕𝜕𝑥𝑥𝑁𝑁 ⋮ ⋮ ⋱ ⋮ 𝜕𝜕𝑓𝑓𝑁𝑁 𝜕𝜕𝑥𝑥1 𝜕𝜕𝑓𝑓𝑁𝑁 𝜕𝜕𝑥𝑥2 ⋯ 𝜕𝜕𝑓𝑓𝑁𝑁 𝜕𝜕𝑥𝑥𝑁𝑁 𝐱𝐱=𝐱𝐱𝑖𝑖 (20) 74
  • 75. K. Webb ESE 470 Newton-Raphson Method 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖 −𝟏𝟏 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖  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 𝐲𝐲 = 𝐟𝐟 𝐱𝐱𝑖𝑖 + 𝐉𝐉𝑖𝑖 𝐱𝐱𝑖𝑖+1 − 𝐱𝐱𝑖𝑖 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖 = 𝐉𝐉𝑖𝑖 𝐱𝐱𝑖𝑖+1 − 𝐱𝐱𝑖𝑖  Left side of (21) represents a difference between the known and approximated outputs  Right side represents an increment of the approximation for 𝐱𝐱 Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖 (20) (21) (22) 75
  • 76. K. Webb ESE 470 Newton-Raphson Method Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖  On each iteration:  Compute Δ𝐲𝐲𝑖𝑖 and 𝐉𝐉𝑖𝑖  Solve for Δ𝐱𝐱𝑖𝑖 using Gaussian elimination  Matrix inversion not required  Computationally robust  Update 𝐱𝐱 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖 (22) (23) 76
  • 77. K. Webb ESE 470 Newton-Raphson – Example  Apply Newton-Raphson to solve the following system of nonlinear equations 𝐟𝐟 𝐱𝐱 = 𝐲𝐲 𝑥𝑥1 2 + 3𝑥𝑥2 𝑥𝑥1𝑥𝑥2 = 21 12  Initial condition: 𝐱𝐱0 = 1 2 𝑇𝑇  Stopping criterion: 𝜀𝜀𝑠𝑠 = 1 × 10−6  Jacobian matrix 𝐉𝐉𝑖𝑖 = 𝜕𝜕𝑓𝑓1 𝜕𝜕𝑥𝑥1 𝜕𝜕𝑓𝑓1 𝜕𝜕𝑥𝑥2 𝜕𝜕𝑓𝑓2 𝜕𝜕𝑥𝑥1 𝜕𝜕𝑓𝑓2 𝜕𝜕𝑥𝑥2 𝐱𝐱=𝐱𝐱𝑖𝑖 = 2𝑥𝑥1,𝑖𝑖 3 𝑥𝑥2,𝑖𝑖 𝑥𝑥1,𝑖𝑖 77
  • 78. K. Webb ESE 470 Newton-Raphson – Example Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖  Adjusting the indexing, we can equivalently write (22) and (23) as: Δ𝐲𝐲𝑖𝑖−1 = 𝐉𝐉𝑖𝑖−1Δ𝐱𝐱𝑖𝑖−1 𝐱𝐱𝑖𝑖 = 𝐱𝐱𝑖𝑖−1 + Δ𝐱𝐱𝑖𝑖−1  For iteration 𝑖𝑖:  Compute Δ𝐲𝐲𝑖𝑖−1 and 𝐉𝐉𝑖𝑖−1  Solve (22) for Δ𝐱𝐱𝑖𝑖−1  Update 𝐱𝐱 using (23) (22) (23) (22) (23) 78
  • 79. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 1: Δ𝑦𝑦0 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 = 21 12 − 7 2 = 14 10 𝐉𝐉0 = 2𝑥𝑥1,0 3 𝑥𝑥2,0 𝑥𝑥1,0 = 2 3 2 1 Δ𝐱𝐱0 = 4 2 𝐱𝐱1 = 𝐱𝐱0 + Δ𝐱𝐱0 = 1 2 + 4 2 = 5 4 𝜀𝜀1 = max 𝑥𝑥𝑘𝑘,1 − 𝑥𝑥𝑘𝑘,0 𝑥𝑥𝑘𝑘,0 , 𝑘𝑘 = 1 … 𝑁𝑁 𝑥𝑥1 = 5 4 , 𝜀𝜀1 = 4 79
  • 80. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 2: Δ𝑦𝑦1 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱1 = 21 12 − 37 20 = −16 −8 𝐉𝐉1 = 2𝑥𝑥1,1 3 𝑥𝑥2,1 𝑥𝑥1,1 = 10 3 4 5 Δ𝐱𝐱1 = −1.474 −0.421 𝐱𝐱2 = 𝐱𝐱1 + Δ𝐱𝐱1 = 5 4 + −1.474 −0.421 = 3.526 3.579 𝜀𝜀2 = max 𝑥𝑥𝑘𝑘,2 − 𝑥𝑥𝑘𝑘,1 𝑥𝑥𝑘𝑘,1 , 𝑘𝑘 = 1 … 𝑁𝑁 𝑥𝑥2 = 3.526 3.579 , 𝜀𝜀2 = 0.295 80
  • 81. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 3: Δ𝑦𝑦2 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱2 = 21 12 − 23.172 12.621 = −2.172 −0.621 𝐉𝐉2 = 2𝑥𝑥1,2 3 𝑥𝑥2,2 𝑥𝑥1,2 = 7.053 3 3.579 3.526 Δ𝐱𝐱2 = −0.410 0.240 𝐱𝐱3 = 𝐱𝐱2 + Δ𝐱𝐱2 = 3.526 3.579 + −0.410 0.240 = 3.116 3.819 𝜀𝜀3 = max 𝑥𝑥𝑘𝑘,3 − 𝑥𝑥𝑘𝑘,2 𝑥𝑥𝑘𝑘,2 , 𝑘𝑘 = 1 … 𝑁𝑁 𝑥𝑥3 = 3.116 3.819 , 𝜀𝜀3 = 0.116 81
  • 82. K. Webb ESE 470 Newton-Raphson – Example  𝑖𝑖 = 7: Δ𝑦𝑦6 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱6 = 21 12 − 21.000 12.000 = −0.527 × 10−7 0.926 × 10−7 𝐉𝐉6 = 2𝑥𝑥1,6 3 𝑥𝑥2,6 𝑥𝑥1,6 = 6.000 3 4.000 3.000 Δ𝐱𝐱6 = −0.073 × 10−6 0.128 × 10−6 𝐱𝐱7 = 𝐱𝐱6 + Δ𝐱𝐱6 = 3.000 4.000 + −0.073 × 10−6 0.128 × 10−6 = 3.000 4.000 𝜀𝜀7 = max 𝑥𝑥𝑘𝑘,7 − 𝑥𝑥𝑘𝑘,6 𝑥𝑥𝑘𝑘,6 , 𝑘𝑘 = 1 … 𝑁𝑁 𝑥𝑥7 = 3.000 4.000 , 𝜀𝜀7 = 31.9 × 10−9 82
  • 83. K. Webb ESE 470 Newton-Raphson – MATLAB Code  Define the system of equations  Initialize 𝐱𝐱  Set up solution parameters 83
  • 84. K. Webb ESE 470 Newton-Raphson – MATLAB Code  Iterate:  Compute Δ𝐲𝐲𝑖𝑖−1 and 𝐉𝐉𝑖𝑖−1  Solve for Δ𝐱𝐱𝑖𝑖−1  Update 𝐱𝐱 84
  • 85. K. Webb ESE 470 Example Problems 85
  • 86. K. Webb ESE 470 Perform three iterations toward the solution of the following system of equations using the Newton-Raphson method. Let 𝐱𝐱0 = 1, 1 𝑇𝑇. 10𝑥𝑥1 2 + 𝑥𝑥2 = 20 𝑒𝑒𝑥𝑥1 − 𝑥𝑥2 = 10 86
  • 87. K. Webb ESE 470 87
  • 88. K. Webb ESE 470 88
  • 89. K. Webb ESE 470 89
  • 90. K. Webb ESE 470 Power-Flow Solution – Overview 90
  • 91. K. Webb ESE 470 Solving the Power-Flow Problem - Overview  Consider an 𝑁𝑁-bus power-flow problem  1 slack bus  𝑛𝑛𝑃𝑃𝑃𝑃 PV buses  𝑛𝑛𝑃𝑃𝑃𝑃 PQ buses 𝑁𝑁 = 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 + 1  Each bus has two unknown quantities  Two of 𝑉𝑉𝑘𝑘, 𝛿𝛿𝑘𝑘, 𝑃𝑃𝑘𝑘, and 𝑄𝑄𝑘𝑘  For the N-R power-flow problem, 𝑉𝑉𝑘𝑘 and 𝛿𝛿𝑘𝑘 are the unknown quantities  These are the inputs to the nonlinear system of equations – the 𝑃𝑃𝑘𝑘 and 𝑄𝑄𝑘𝑘 equations – of (9) and (10)  Finding unknown 𝑉𝑉𝑘𝑘 and 𝛿𝛿𝑘𝑘 values allows us to determine unknown 𝑃𝑃𝑘𝑘 and 𝑄𝑄𝑘𝑘 values 91
  • 92. K. Webb ESE 470 Solving the Power-Flow Problem - Overview  The nonlinear system of equations is 𝐲𝐲 = 𝐟𝐟(𝐱𝐱)  The unknowns , 𝐱𝐱, are bus voltages  Unknown phase angles from PV and PQ buses  Unknown magnitudes from PQ bus 𝐱𝐱 = 𝛅𝛅 𝐕𝐕 = 𝛿𝛿2 ⋮ 𝛿𝛿𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1 𝑉𝑉𝑛𝑛𝑃𝑃𝑃𝑃+2 ⋮ 𝑉𝑉𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 (24) 92
  • 93. K. Webb ESE 470 Solving the Power-Flow Problem - Overview 𝐲𝐲 = 𝐟𝐟(𝐱𝐱)  The knowns , 𝐲𝐲, are bus powers  Known real power from PV and PQ buses  Known reactive power from PQ bus 𝐲𝐲 = 𝐏𝐏 𝐐𝐐 = 𝑃𝑃2 ⋮ 𝑃𝑃𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1 𝑄𝑄𝑛𝑛𝑃𝑃𝑃𝑃+2 ⋮ 𝑄𝑄𝑛𝑛𝑃𝑃𝑃𝑃+𝑛𝑛𝑃𝑃𝑃𝑃+1 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 (25) 93
  • 94. K. Webb ESE 470 Solving the Power-Flow Problem - Overview 𝐲𝐲 = 𝐟𝐟(𝐱𝐱)  The system of equations , 𝐟𝐟, consists of the nonlinear functions for 𝐏𝐏 and 𝐐𝐐  Nonlinear functions of 𝐕𝐕 and 𝛅𝛅 𝐟𝐟(𝐱𝐱) = 𝐏𝐏(𝐱𝐱) 𝐐𝐐(𝐱𝐱) = 𝑃𝑃2 𝐱𝐱 ⋮ ⋮ 𝑄𝑄𝑛𝑛𝑃𝑃𝑃𝑃+2 𝐱𝐱 ⋮ ⋮ 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 (26) 94
  • 95. K. Webb ESE 470 Solving the Power-Flow Problem - Overview  𝑃𝑃𝑘𝑘 𝐱𝐱 and 𝑄𝑄𝑘𝑘 𝐱𝐱 are given by 𝑃𝑃𝑘𝑘 = 𝑉𝑉𝑘𝑘 � 𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝑄𝑄𝑘𝑘 = 𝑉𝑉𝑘𝑘 � 𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘 𝑉𝑉 𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘  Admittance matrix terms are 𝑌𝑌𝑘𝑘𝑘𝑘 = 𝑌𝑌𝑘𝑘𝑘𝑘 ∠𝜃𝜃𝑘𝑘𝑘𝑘 (9) (10) 95
  • 96. K. Webb ESE 470 Solving the Power-Flow Problem - Overview  The iterative N-R formula is 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖  The increment term, Δ𝐱𝐱𝑖𝑖, is computed through Gaussian elimination of Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖  The Jacobian, 𝐽𝐽𝑖𝑖, is computed on each iteration  The power mismatch vector is Δ𝐲𝐲𝑖𝑖 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖  𝐲𝐲 is the vector of known powers, as given in (25)  𝐟𝐟 𝐱𝐱𝑖𝑖 are the 𝑃𝑃 and 𝑄𝑄 equations given by (9) and (10) 96
  • 97. K. Webb ESE 470 Power-Flow Solution – Procedure 97
  • 98. K. Webb ESE 470 Solving the Power-Flow Problem - Procedure  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, 𝐘𝐘  And magnitude, Y = 𝐘𝐘 , and angle, θ = ∠𝐘𝐘, matrices 98
  • 99. K. Webb ESE 470 Solving the Power-Flow Problem - Procedure 3. Initialize known quantities  Slack bus: 𝑉𝑉1 and 𝛿𝛿1  PV buses: 𝑉𝑉𝑘𝑘 and 𝑃𝑃𝑘𝑘  PQ buses: 𝑃𝑃𝑘𝑘 and 𝑄𝑄𝑘𝑘  Output vector: 𝐲𝐲 = 𝐏𝐏 𝐐𝐐 4. Initialize unknown quantities 𝐱𝐱𝒐𝒐 = 𝛅𝛅𝟎𝟎 𝐕𝐕𝟎𝟎 = 0 ⋮ 0 1.0 ⋮ 1.0 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 (24) 99
  • 100. K. Webb ESE 470 Solving the Power-Flow Problem - Procedure 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: 𝑖𝑖 = 0 6. while (𝜀𝜀 > reltol) && (𝑖𝑖 < max_iter)  Update bus voltage phasor vector, 𝐕𝐕𝑖𝑖, using magnitude and phase values from 𝐱𝐱𝑖𝑖 and from knowns  Calculate the current injected into each bus, a vector of phasors 𝐈𝐈𝑖𝑖 = 𝐘𝐘 ⋅ 𝐕𝐕𝑖𝑖 100
  • 101. K. Webb ESE 470 Solving the Power-Flow Problem - Procedure 6. while (𝜀𝜀 > reltol) && (𝑖𝑖 < max_iter) – cont’d  Calculate complex, real, and reactive power injected into each bus  This can be done using 𝐕𝐕𝑖𝑖 and 𝐈𝐈𝑖𝑖 vectors and element-by-element multiplication (the .* operator in MATLAB) 𝐒𝐒𝑘𝑘,𝑖𝑖 = 𝐕𝐕𝑘𝑘,𝑖𝑖 ⋅ 𝐈𝐈𝑘𝑘,𝑖𝑖 ∗ 𝑃𝑃𝑘𝑘,𝑖𝑖 = 𝑅𝑅𝑅𝑅 𝐒𝐒𝑘𝑘,𝑖𝑖 𝑄𝑄𝑘𝑘,𝑖𝑖 = 𝐼𝐼𝐼𝐼 𝐒𝐒𝑘𝑘,𝑖𝑖  Create 𝑓𝑓 𝑥𝑥𝑖𝑖 from 𝐏𝐏𝑖𝑖 and 𝐐𝐐𝑖𝑖 vectors  Calculate power mismatch, Δ𝐲𝐲𝑖𝑖 Δ𝐲𝐲𝑖𝑖 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱𝑖𝑖  Compute the Jacobian, 𝐉𝐉𝑖𝑖, using voltage magnitudes and phase angles from 𝐕𝐕𝑖𝑖 101
  • 102. K. Webb ESE 470 Solving the Power-Flow Problem - Procedure 6. while (𝜀𝜀 > reltol) && (𝑖𝑖 < max_iter) – cont’d  Solve for Δ𝐱𝐱𝑖𝑖 using Gaussian elimination Δ𝐲𝐲𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐱𝐱𝑖𝑖  Use the mldivide (, backslash) operator in MATLAB: Δ𝐱𝐱𝑖𝑖 = 𝐉𝐉𝑖𝑖Δ𝐲𝐲𝑖𝑖  Update 𝐱𝐱 𝐱𝐱𝑖𝑖+1 = 𝐱𝐱𝑖𝑖 + Δ𝐱𝐱𝑖𝑖  Check for convergence using power mismatch 𝜀𝜀𝑖𝑖+1 = max 𝑦𝑦𝑘𝑘 − 𝑓𝑓𝑘𝑘 𝐱𝐱 𝑦𝑦𝑘𝑘  Update the number of iterations 𝑖𝑖 = 𝑖𝑖 + 1 102
  • 103. K. Webb ESE 470 The Jacobian Matrix  The Jacobian matrix has four quadrants of varying dimension depending on the number of different types of buses: 𝐉𝐉 = 𝜕𝜕𝐏𝐏 𝜕𝜕𝛅𝛅 𝜕𝜕𝐏𝐏 𝜕𝜕𝐕𝐕 𝜕𝜕𝐐𝐐 𝜕𝜕𝛅𝛅 𝜕𝜕𝐐𝐐 𝜕𝜕𝐕𝐕 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 𝑛𝑛𝑃𝑃𝑃𝑃 + 𝑛𝑛𝑃𝑃𝑃𝑃 𝐉𝐉1 𝐉𝐉2 𝐉𝐉3 𝐉𝐉4 103
  • 104. K. Webb ESE 470 The Jacobian Matrix  Jacobian elements are partial derivatives of (9) and (10) with respect to 𝛿𝛿 or 𝑉𝑉  Formulas for the Jacobian elements:  𝑛𝑛 ≠ 𝑘𝑘 𝐉𝐉1𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑃𝑃𝑘𝑘 𝜕𝜕𝛿𝛿𝑛𝑛 = 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘𝑉𝑉 𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝐉𝐉2𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑃𝑃𝑘𝑘 𝜕𝜕𝑉𝑉 𝑛𝑛 = 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝐉𝐉3𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑄𝑄𝑘𝑘 𝜕𝜕𝛿𝛿𝑛𝑛 = −𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘𝑉𝑉 𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝐉𝐉4𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑄𝑄𝑘𝑘 𝜕𝜕𝑉𝑉 𝑛𝑛 = 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (29) (27) (28) (30) 104
  • 105. K. Webb ESE 470 The Jacobian Matrix  Formulas for the Jacobian elements, cont’d:  𝑛𝑛 = 𝑘𝑘 𝐉𝐉1𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑃𝑃𝑘𝑘 𝜕𝜕𝛿𝛿𝑘𝑘 = −𝑉𝑉𝑘𝑘 � 𝑛𝑛=1 𝑛𝑛≠𝑘𝑘 𝑁𝑁 𝑌𝑌𝑘𝑘𝑛𝑛𝑉𝑉 𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝐉𝐉2𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑃𝑃𝑘𝑘 𝜕𝜕𝑉𝑉𝑘𝑘 = 𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 cos 𝜃𝜃𝑘𝑘𝑘𝑘 + � 𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑛𝑛𝑉𝑉 𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝐉𝐉3𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑄𝑄𝑘𝑘 𝜕𝜕𝛿𝛿𝑘𝑘 = 𝑉𝑉𝑘𝑘 � 𝑛𝑛=1 𝑛𝑛≠𝑘𝑘 𝑁𝑁 𝑌𝑌𝑘𝑘𝑛𝑛𝑉𝑉 𝑛𝑛 cos 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 𝐉𝐉4𝑘𝑘𝑘𝑘 = 𝜕𝜕𝑄𝑄𝑘𝑘 𝜕𝜕𝑉𝑉𝑘𝑘 = −𝑉𝑉𝑘𝑘𝑌𝑌𝑘𝑘𝑘𝑘 sin 𝜃𝜃𝑘𝑘𝑘𝑘 + � 𝑛𝑛=1 𝑁𝑁 𝑌𝑌𝑘𝑘𝑘𝑘𝑉𝑉 𝑛𝑛 sin 𝛿𝛿𝑘𝑘 − 𝛿𝛿𝑛𝑛 − 𝜃𝜃𝑘𝑘𝑘𝑘 (33) (31) (32) (34) 105
  • 106. K. Webb ESE 470 Power-Flow Solution – Example 106
  • 107. K. Webb ESE 470 Power-Flow Solution – Buses  Determine all bus voltages and power flows for the following three- bus power system  Three buses, 𝑛𝑛𝑃𝑃𝑃𝑃 = 1, 𝑛𝑛𝑃𝑃𝑃𝑃 = 1, ordered PV first, then PQ:  Bus 1: slack bus  𝑉𝑉1 and 𝛿𝛿1 are known, find 𝑃𝑃1 and 𝑄𝑄1  Bus 2: PV bus  𝑃𝑃2 and 𝑉𝑉2 are known, find 𝛿𝛿2 and 𝑄𝑄2  Bus 3: PQ bus  𝑃𝑃3 and 𝑄𝑄3 are known, find 𝑉𝑉3 and 𝛿𝛿3 107
  • 108. K. Webb ESE 470  Per-unit, per-length impedance of all transmission lines: 𝑧𝑧 = 31.1 + 𝑗𝑗𝑗𝑗𝑗 × 10−6 𝑝𝑝𝑝𝑝/𝑘𝑘𝑘𝑘  Admittance of each line: 𝑌𝑌12 = 𝑌𝑌23 = 1 𝑧𝑧 ⋅ 150 𝑘𝑘𝑘𝑘 = 2.06 − 𝑗𝑗𝑗𝑗.9 𝑝𝑝𝑝𝑝 𝑌𝑌13 = 1 𝑧𝑧 ⋅ 200 𝑘𝑘𝑘𝑘 = 1.54 − 𝑗𝑗15.7 𝑝𝑝𝑝𝑝 Power-Flow Solution – Admittance Matrix 108
  • 109. K. Webb ESE 470  The admittance matrix (see p. 8): 𝐘𝐘 = 𝑌𝑌11 −𝑌𝑌12 −𝑌𝑌13 −𝑌𝑌21 𝑌𝑌22 −𝑌𝑌23 −𝑌𝑌31 −𝑌𝑌32 𝑌𝑌33 = 3.6 − 𝑗𝑗𝑗𝑗.6 −2.06 + 𝑗𝑗𝑗𝑗.9 −1.5 + 𝑗𝑗𝑗𝑗.7 −2.06 + 𝑗𝑗𝑗𝑗.9 4.1 − 𝑗𝑗𝑗𝑗.8 −2.06 + 𝑗𝑗𝑗𝑗.9 −1.5 + 𝑗𝑗𝑗𝑗.7 −2.06 + 𝑗𝑗𝑗𝑗.9 3.6 − 𝑗𝑗𝑗𝑗.6  Admittance magnitude and angle matrices: Y = 𝐘𝐘 = 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 – Admittance Matrix 109
  • 110. K. Webb ESE 470 Power-Flow Solution – Initialize Knowns  Known quantities  Slack bus: 𝑉𝑉1 = 1.0 𝑝𝑝𝑝𝑝, 𝛿𝛿1 = 0°  PV bus: 𝑉𝑉2 = 1.05 𝑝𝑝𝑝𝑝, 𝑃𝑃2 = 2.0 𝑝𝑝𝑝𝑝  PQ bus: 𝑃𝑃3 = −5.0 𝑝𝑝𝑝𝑝, 𝑄𝑄3 = −1.0 𝑝𝑝𝑝𝑝  Output vector 𝐲𝐲 = 𝐏𝐏 𝐐𝐐 = 𝑃𝑃2 𝑃𝑃3 𝑄𝑄3 = 2.0 −5.0 −1.0 110
  • 111. K. Webb ESE 470 Power-Flow Solution – Initialize Unknowns  The vector of unknown quantities to be solved for is 𝐱𝐱 = 𝛅𝛅 𝐕𝐕 = 𝛿𝛿2 𝛿𝛿3 𝑉𝑉3  Initialize all unknown bus voltage phasors to 𝐕𝐕𝑘𝑘 = 1.0∠0° 𝑝𝑝𝑝𝑝 𝐱𝐱0 = 𝛅𝛅0 𝐕𝐕0 = 𝛿𝛿2,0 𝛿𝛿3,0 𝑉𝑉3,0 = 0 0 1.0  The complete vector of bus voltage phasors – partly known, partly unknown – is 𝐕𝐕 = 𝑉𝑉1∠𝛿𝛿1 𝑉𝑉2∠𝛿𝛿2 𝑉𝑉3∠𝛿𝛿3 = 1.0∠0° 1.05∠𝛿𝛿2,0 𝑉𝑉3,0∠𝛿𝛿3,0 = 1.0∠0° 1.05∠0° 1.0∠0° 111
  • 112. K. Webb ESE 470 Power-Flow Solution – Jacobian Matrix  The Jacobian matrix for this system is 𝐉𝐉 = 𝜕𝜕𝑃𝑃2 𝜕𝜕𝛿𝛿2 𝜕𝜕𝑃𝑃2 𝜕𝜕𝛿𝛿3 𝜕𝜕𝑃𝑃2 𝜕𝜕𝑉𝑉3 𝜕𝜕𝑃𝑃3 𝜕𝜕𝛿𝛿2 𝜕𝜕𝑃𝑃3 𝜕𝜕𝛿𝛿3 𝜕𝜕𝑃𝑃3 𝜕𝜕𝑉𝑉3 𝜕𝜕𝑄𝑄3 𝜕𝜕𝛿𝛿2 𝜕𝜕𝑄𝑄3 𝜕𝜕𝛿𝛿3 𝜕𝜕𝑄𝑄3 𝜕𝜕𝑉𝑉3  This matrix will be computed on each iteration using the current approximation to the vector of unknowns, 𝐱𝐱𝑖𝑖 112
  • 113. K. Webb ESE 470 Power-Flow Solution – Set Up and Iterate  Set up N-R iteration parameters  reltol = 1e-6  max_iter = 1e3  𝜀𝜀0 = 10  𝑖𝑖 = 0  Iteratively update the approximation to the vector of unknowns as long as  Stopping criterion is not satisfied 𝜀𝜀𝑖𝑖 > 𝜀𝜀𝑠𝑠  Maximum number of iterations is not exceeded 𝑖𝑖 ≤ 𝑚𝑚𝑚𝑚𝑚𝑚 _𝑖𝑖𝑖𝑖𝑖𝑖𝑖𝑖 113
  • 114. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Vector of bus voltage phasors 𝐕𝐕0 = 𝑉𝑉1∠𝛿𝛿1 𝑉𝑉2∠𝛿𝛿2,0 𝑉𝑉3,0∠𝛿𝛿3,0 = 1.0∠0° 1.05∠0° 1.0∠0°  Current injected into each bus 𝐈𝐈0 = 𝐘𝐘 ⋅ 𝐕𝐕0 𝐈𝐈0 = 3.6 − 𝑗𝑗𝑗𝑗.6 −2.1 + 𝑗𝑗𝑗𝑗.9 −1.5 + 𝑗𝑗𝑗𝑗.7 −2.1 + 𝑗𝑗𝑗𝑗.9 4.1 − 𝑗𝑗𝑗𝑗.8 −2.1 + 𝑗𝑗𝑗𝑗.9 −1.5 + 𝑗𝑗𝑗𝑗.7 −2.1 + 𝑗𝑗𝑗𝑗.9 3.6 − 𝑗𝑗𝑗𝑗.6 1.0∠0° 1.05∠0° 1.0∠0° 𝐈𝐈0 = 1.05∠95.6° 2.10∠ − 84.4° 1.05∠95.6° 114
  • 115. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Complex power injected into each bus 𝐒𝐒0 = 𝐕𝐕0 .∗ 𝐈𝐈0 ∗ 𝐒𝐒0 = 1.0∠0° 1.05∠0° 1.0∠0° .∗ 1.05∠95.6° 2.10∠ − 84.4° 1.05∠95.6° ∗ 𝐒𝐒0 = −0.103 − 𝑗𝑗𝑗.045 0.216 + 𝑗𝑗𝑗.195 −0.103 − 𝑗𝑗𝑗.045  Real and reactive power 𝐏𝐏0 = −0.103 0.216 −0.103 , 𝐐𝐐0 = −1.045 2.195 −1.045 115
  • 116. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Power mismatch Δ𝐲𝐲0 = 𝐲𝐲 − 𝐟𝐟 𝐱𝐱0 Δ𝐲𝐲0 = 2.0 −5.0 −1.0 − 0.216 −0.103 −1.045 = 1.784 −4.897 0.045  Next, compute the Jacobian matrix 𝐉𝐉0 = 𝜕𝜕𝑃𝑃2 𝜕𝜕𝛿𝛿2 𝜕𝜕𝑃𝑃2 𝜕𝜕𝛿𝛿3 𝜕𝜕𝑃𝑃2 𝜕𝜕𝑉𝑉3 𝜕𝜕𝑃𝑃3 𝜕𝜕𝛿𝛿2 𝜕𝜕𝑃𝑃3 𝜕𝜕𝛿𝛿3 𝜕𝜕𝑃𝑃3 𝜕𝜕𝑉𝑉3 𝜕𝜕𝑄𝑄3 𝜕𝜕𝛿𝛿2 𝜕𝜕𝑄𝑄3 𝜕𝜕𝛿𝛿3 𝜕𝜕𝑄𝑄3 𝜕𝜕𝑉𝑉3 𝐱𝐱=𝐱𝐱0 116
  • 117. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Elements of the Jacobian matrix are computed using 𝑉𝑉 and 𝛿𝛿 values from 𝐕𝐕0 and 𝑌𝑌 and 𝜃𝜃 values from 𝐘𝐘: 𝑉𝑉0 = 1.0 1.05 1.0 𝛿𝛿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° 117
  • 118. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Jacobian, 𝐉𝐉1 𝜕𝜕𝑃𝑃2 𝜕𝜕𝛿𝛿2 = −𝑉𝑉2 𝑌𝑌21𝑉𝑉1 sin 𝛿𝛿2 − 𝛿𝛿1 − 𝜃𝜃21 + 𝑌𝑌23𝑉𝑉3 sin 𝛿𝛿2 − 𝛿𝛿3 − 𝜃𝜃23 𝜕𝜕𝑃𝑃3 𝜕𝜕𝛿𝛿3 = −𝑉𝑉3 𝑌𝑌31𝑉𝑉1 sin 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 sin 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32 𝜕𝜕𝑃𝑃2 𝜕𝜕𝛿𝛿3 = 𝑉𝑉2𝑌𝑌23𝑉𝑉3 sin 𝛿𝛿2 − 𝛿𝛿3 − 𝜃𝜃23 𝜕𝜕𝑃𝑃3 𝜕𝜕𝛿𝛿2 = 𝑉𝑉3𝑌𝑌32𝑉𝑉2 sin 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32 118
  • 119. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Jacobian, 𝐉𝐉2 𝜕𝜕𝑃𝑃2 𝜕𝜕𝑉𝑉3 = 𝑉𝑉2𝑌𝑌23 cos 𝛿𝛿2 − 𝛿𝛿3 − 𝜃𝜃23 𝜕𝜕𝑃𝑃3 𝜕𝜕𝑉𝑉3 = 2 ⋅ 𝑉𝑉3𝑌𝑌33 cos 𝜃𝜃33 + 𝑌𝑌31𝑉𝑉1 cos 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32  Jacobian, 𝐉𝐉3 𝜕𝜕𝑄𝑄3 𝜕𝜕𝛿𝛿2 = −𝑉𝑉3𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32 𝜕𝜕𝑄𝑄3 𝜕𝜕𝛿𝛿3 = 𝑉𝑉3 𝑌𝑌31𝑉𝑉1 cos 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32 119
  • 120. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Jacobian, 𝐉𝐉4 𝜕𝜕𝑄𝑄3 𝜕𝜕𝑉𝑉3 = 𝑉𝑉3𝑌𝑌33 cos 𝜃𝜃33 + 𝑌𝑌31𝑉𝑉1 cos 𝛿𝛿3 − 𝛿𝛿1 − 𝜃𝜃31 + 𝑌𝑌32𝑉𝑉2 cos 𝛿𝛿3 − 𝛿𝛿2 − 𝜃𝜃32  Evaluating the Jacobian expressions using 𝑉𝑉 and 𝛿𝛿 values from 𝐕𝐕0 and 𝑌𝑌 and 𝜃𝜃 values from 𝐘𝐘, gives 𝐉𝐉0 = 43.89 −21.95 −2.160 −21.95 37.62 3.497 2.160 −3.702 35.53 120
  • 121. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Use Gaussian elimination to solve for Δ𝐱𝐱0 Δ𝐲𝐲0 = 𝐉𝐉0Δ𝐱𝐱0 = 43.89 −21.95 −2.160 −21.95 37.62 3.497 2.160 −3.702 35.53 Δ𝑥𝑥1,0 Δ𝑥𝑥2,0 Δ𝑥𝑥3,0 = 1.784 −4.897 0.045 Δ𝐱𝐱0 = −0.0345 −0.1492 −0.0122  Update the vector of unknowns, 𝐱𝐱 𝐱𝐱1 = 𝐱𝐱0 + Δ𝐱𝐱0 = 0 0 1.0 + −0.0345 −0.1492 −0.0122 = −0.0345 −0.1492 0.9878 121
  • 122. K. Webb ESE 470 Power-Flow Solution – Iterate  𝑖𝑖 = 0:  Use power mismatch to check for convergence 𝜀𝜀0 = max 𝑦𝑦𝑘𝑘 − 𝑓𝑓𝑘𝑘 𝑥𝑥 𝑦𝑦𝑘𝑘 = 0.9794  Move on to the next iteration, 𝑖𝑖 = 1  Create 𝐕𝐕1 using 𝐱𝐱1 values  Calculate 𝐈𝐈1  Calculate 𝐒𝐒1, 𝐏𝐏1, 𝐐𝐐1  Create 𝐟𝐟 𝐱𝐱1 from 𝐏𝐏1 and 𝐐𝐐1  Calculate Δ𝐲𝐲1, 𝐉𝐉1, Δ𝐱𝐱1  Update 𝐱𝐱 to 𝐱𝐱2  Check for convergence  … 122
  • 123. K. Webb ESE 470 Power-Flow Solution  Convergence is achieved after four iterations 𝐕𝐕4 = 1.0∠0° 1.1∠ − 2.1° 0.97∠ − 8.8° , 𝐒𝐒4 = 3.08 − 𝑗𝑗𝑗.82 2.0 + 𝑗𝑗𝑗.67 −5.0 − 𝑗𝑗𝑗.0 𝜀𝜀4 = 0.41 × 10−6 123
  • 124. K. Webb ESE 470 Example Problems 124
  • 125. K. Webb ESE 470 For the power system shown, determine a) The type of each bus b) The first row of the admittance matrix, 𝐘𝐘 c) The vector of unknowns, 𝐱𝐱 d) The vector of knowns, 𝐲𝐲 e) The Jacobian matrix, 𝐉𝐉, in symbolic form 125
  • 126. K. Webb ESE 470 126
  • 127. K. Webb ESE 470 127
  • 128. K. Webb ESE 470 128