ece 530 – analysis techniques for large-scale electrical systems prof. hao zhu dept. of electrical...
TRANSCRIPT
ECE 530 – Analysis Techniques for Large-Scale Electrical Systems
Prof. Hao ZhuDept. of Electrical and Computer Engineering
University of Illinois at Urbana-Champaign
1
Lecture 4: Newton-Raphson Method
Power Flow Analysis
2
i1
In the Newton-Raphson power flow we use Newton's
method to determine the voltage magnitude and angle
at each bus in the power system.
We need to solve the power balance equations
P ( cosn
i k ik ikk
V V G
i1
sin )
Q ( sin cos )
ik ik Gi Di
n
i k ik ik ik ik Gi Dik
B P P
V V G B Q Q
• When analyzing power systems, we know the complex power being consumed by the load, and the power being injected by the generators plus their voltage magnitudes• Want to find voltage magnitude and angle at every bus
Solving Nonlinear Equations
• Most common technique for solving the nonlinear power flow is to use the Newton-Raphson method•
• Key idea behind Newton-Raphson is to use sequential linearization• More tractable for linear systems
General form of problem: Find an x such that
( ) 0ˆf x
3
Linear Equations
• Linear system of equations
• Here we will use the style of bolding matrices and vectors• Later in course we’ll consider solution methods for
sparse linear equations, which are quite common in electric power systems• Linear equations are conceptually easy to solve,
provided A is nonsingular; then there is a single solution
4
Ax = b
Linear Power System Elements
5
Resistors, inductors, capacitors, independent
voltage sources and current sources are linear
circuit elements
1V = R I V = V =
Such systems may be analyzed by superposition
j L I Ij C
Nonlinear Equations
• Motivated by power flow analysis, we’ll consider the solution of nonlinear equations of the form:
• Problem may be restated as finding a root x of f where both x and f(x) are n-vectors• A key challenge with nonlinear equations is there may
be one, none or multiple solutions!
6
f(x) = 0
Nonlinear Example of Multiple Solutions and No Solution
7
f(x) = x2 - 2 f(x) = x2 + 2
two solutions where f(x) = 0 no solution f(x) = 0
Example 1: x2 - 2 = 0 has solutions x = 1.414…
Example 2: x2 + 2 = 0 has no real solution
Nonlinear Equations
• The notation f(x) is short-hand for the vector function
so the problem is to solve n equations for n unknowns
8
1 1 2
2 1 2
1 2
, , ,
, , ,
, , ,
n
n
n n
f x x x
f x x x
f x x x
Newton-Raphson Method
• Newton developed his method for solving for the roots of nonlinear equations in 1671, but it wasn’t published until 1736• Raphson developed a similar method in 1690;
Raphson’s approach was actually simpler than Newton’s, and is what is used today • General form of scalar problem is to find an x such that
f(x) = 0• Key idea behind the Newton-Raphson method is to use
sequential linearization
9
Newton-Raphson Method (scalar)
10
( )
( ) ( )
( )( ) ( )
2 ( ) 2( )2
1. For each guess of , , define
-
2. Represent ( ) by a Taylor series about ( )
( )( ) ( )
1 ( )higher order terms
2
v
v v
vv v
vv
x x
x x x
f x f x
df xf x f x x
dx
d f xx
dx
Note, a priori we do NOT know x
Newton-Raphson Method, cont’d
11
( )( ) ( )
( )
1( )( ) ( )
3. Approximate ( ) by neglecting all terms
except the first two
( )( ) 0 ( )
4. Use this linear approximation to solve for
( )( )
5. Solve for a new estimat
vv v
v
vv v
f x
df xf x f x x
dx
x
df xx f x
dx
( 1) ( ) ( )
e of xv v vx x x
Newton-Raphson Example
12
2
1( )( ) ( )
( ) ( ) 2( )
( 1) ( ) ( )
( 1) ( ) ( ) 2( )
Use Newton-Raphson to solve ( ) - 2 0
The equation we must iteratively solve is
( )( )
1(( ) - 2)
2
1(( ) - 2)
2
vv v
v vv
v v v
v v vv
f x x
df xx f x
dx
x xx
x x x
x x xx
Newton-Raphson Example, cont’d
13
( 1) ( ) ( ) 2( )
(0)
( ) ( ) ( )
3 3
6
1(( ) - 2)
2
Guess x 1. Iteratively solving we get
v ( )
0 1 1 0.5
1 1.5 0.25 0.08333
2 1.41667 6.953 10 2.454 10
3 1.41422 6.024 10
v v vv
v v v
x x xx
x f x x
Sequential Linear Approximations
14
Function is f(x) = x2 - 2 = 0.Solutions are points wheref(x) intersects f(x) = 0 axis
At each iteration theN-R methoduses a linearapproximationto determine the next valuefor x
Newton’s Method for a Scalar Equation
x (3) x (2) x (0)
root x*
x (4) x (1) x
f (x)
15
Example 2
• Find the positive root of
using Newton’s method starting
• Computation must be done using radians!!!
. .. .
.
0
1 0
0
1 0 0 785391 57079 2 00001
0 0 5
f x x x
f x
0.5 0sin x x
x (0) 2
16
Example 2 Graphical View
2
x
2
xf x sin x
17
Example 2 Iterations
• We continue the iterations to obtain the following set of results
iteration number v
0 1.57079
1 2.00001
2 1.90100
3 1.89551
4 1.89549
vx
18
Example 2, Changed Initial Guess
• It is interesting to note that we get to the value of 1.89549 also if we start at 3.14159
iteration number v
0 3.14159
1 2.09440
2 1.91322
3 1.89567
4 1.89549
vx
19
Newton-Raphson Comments
• When close to the solution the error decreases quite quickly -- method has quadratic convergence• f(x(v)) is known as the mismatch, which we would like
to drive to zero• Stopping criteria is when f(x(v)) < • Results are dependent upon the initial guess. What if
we had guessed x(0) = 0, or x (0) = -1?• A solution’s region of attraction (ROA) is the set of
initial guesses that converge to the particular solution. The ROA is often hard to determine
20
Normal Convergence
desired root
( )x 0( )1x ( )2x x
f (x)
21
Oscillatory Convergence
x (3) x
(1) x (2) x
(0)x
(4)
f (x)Note that we actuallyovershoot the solution
22
Convergence to an Unwanted Root
x
desired root
undesired root
x (1)
x (0)
f (x)
23
Divergence
x (1) x
(0)
x (2) x
f (x)
24
Multi-Variable Newton-Raphson
25
1 1
2 2
Next we generalize to the case where is an n-
dimension vector, and ( ) is an n-dimension function
( )
( )( )
( )
Define the solution so ( ) 0 andˆ ˆ
ˆ
n n
x f
x f
x f
x
f x
x
xx f x
x
x f x
x x x
Multi-Variable Case, cont’d
26
i
1 11 1 1 2
1 2
1
n nn n 1 2
1 2
n
The Taylor series expansion is written for each f ( )
f ( ) f ( )f ( ) f ( )ˆ
f ( )higher order terms
f ( ) f ( )f ( ) f ( )ˆ
f ( )higher order terms
nn
nn
x xx x
xx
x xx x
xx
x
x xx x
x
x xx x
x
Multi-Variable Case, cont’d
27
1 1 1
1 21 1
2 2 22 2
1 2
1 2
This can be written more compactly in matrix form
( ) ( ) ( )
( )( ) ( ) ( )
( )( )ˆ
( )( ) ( ) ( )
n
n
nn n n
n
f f fx x x
f xf f f
f xx x x
ff f fx x x
x x x
xx x x
xf x
xx x x
higher order terms
nx
Jacobian Matrix
28
1 1 1
1 2
2 2 2
1 2
1 2
The n by n matrix of partial derivatives is known
as the Jacobian matrix, ( )
( ) ( ) ( )
( ) ( ) ( )
( )
( ) ( ) ( )
n
n
n n n
n
f f fx x x
f f fx x x
f f fx x x
J x
x x x
x x x
J x
x x x
Multi-Variable N-R Procedure
29
1
( 1) ( ) ( )
( 1) ( ) ( ) 1 ( )
( )
Derivation of N-R method is similar to the scalar case
( ) ( ) ( ) higher order termsˆ
( ) 0 ( ) ( )ˆ
( ) ( )
( ) ( )
Iterate until ( )
v v v
v v v v
v
f x f x J x x
f x f x J x x
x J x f x
x x x
x x J x f x
f x
Multi-Variable Example
30
1
2
2 21 1 2
2 22 1 2 1 2
1 1
1 2
2 2
1 2
xSolve for = such that ( ) 0 where
x
f ( ) 2 8 0
f ( ) 4 0
First symbolically determine the Jacobian
f ( ) f ( )
( ) =f ( ) f ( )
x x
x x x x
x x
x x
x f x
x
x
x x
J xx x
Multi-variable Example, cont’d
31
1 2
1 2 1 2
11 1 2 1
2 1 2 1 2 2
(0)
1(1)
4 2( ) =
2 2
Then
4 2 ( )
2 2 ( )
1Arbitrarily guess
1
1 4 2 5 2.1
1 3 1 3 1.3
x x
x x x x
x x x f
x x x x x f
J x
x
x
x
x
Multi-variable Example, cont’d
32
1(2)
(2)
2.1 8.40 2.60 2.51 1.8284
1.3 5.50 0.50 1.45 1.2122
Each iteration we check ( ) to see if it is below our
specified tolerance
0.1556( )
0.0900
If = 0.2 then we wou
x
f x
f x
ld be done. Otherwise we'd
continue iterating.
Stopping Criteria: Vector Norms
• When x is a vector the stopping criteria is determined by calculating the vector norm. Any norm could be used, but the most common norm used is the infinity norm, , where
• Other common norms are the one norm, which is the sum of the element absolute values and the Euclidean (or two norm) defined as
max iixx
=
x
1
22
2 21
n
ii
x @
33
=
=
Newton-Raphson Power Flow
i1
In the Newton-Raphson power flow we use Newton's
method to determine the voltage magnitude and angle
at each bus in the power system.
We need to solve the power balance equations
P ( cosn
i k ik ikk
V V G
i1
sin )
Q ( sin cos )
ik ik Gi Di
n
i k ik ik ik ik Gi Dik
B P P
V V G B Q Q
34
Power Flow Variables
2 2 2
n
2
Assume the slack bus is the first bus (with a fixed
voltage angle/magnitude). We then need to determine
the voltage angle/magnitude at the other buses.
( )
( )
G
n
P P
V
V
x
x f x
2
2 2 2
( )
( )
( )
D
n Gn Dn
G D
n Gn Dn
P
P P P
Q Q Q
Q Q Q
x
x
x
35
N-R Power Flow Solution
( )
( )
( 1) ( ) ( ) 1 ( )
The power flow is solved using the same procedure
discussed with the general Newton-Raphson:
Set 0; make an initial guess of ,
While ( ) Do
( ) ( )
1
End While
v
v
v v v v
v
v v
x x
f x
x x J x f x
36
Power Flow Jacobian Matrix
1 1 1
1 2
2 2 2
1 2
1 2
The most difficult part of the algorithm is determining
and inverting the n by n Jacobian matrix, ( )
( ) ( ) ( )
( ) ( ) ( )
( )
( ) ( ) ( )
n
n
n n n
n
f f fx x x
f f fx x x
f f fx x x
J x
x x x
x x x
J x
x x x
37
Power Flow Jacobian Matrix, cont’d
i
i
i1
Jacobian elements are calculated by differentiating
each function, f ( ), with respect to each variable.
For example, if f ( ) is the bus i real power equation
f ( ) ( cos sin )n
i k ik ik ik ik Gik
x V V G B P P
x
x
i
1
i
f ( )( sin cos )
f ( )( sin cos ) ( )
Di
n
i k ik ik ik iki k
k i
i j ik ik ik ikj
xV V G B
xV V G B j i
38