Nonlinear Algebraic Equations Example: (In) S I (In) (In) P, I
Nonlinear Algebraic Equations Example: (In) S I (In) (In) P, I
Nonlinear Algebraic Equations Example: (In) S I (In) (In) P, I
Nr
(F/ V) ci(in) − ci + ∑σα ,i rα = 0 i = 1, 2,..., Ns
α =1
Energy balance
Column of unknown variables :x = [c1 ,c2 ,...,cNs ,T] T
∧
Let x be the solution staisfying f(x)=0.
∧
We do not know x and take x[0] as initial guess.
November 2001 10.001 Introduction to Computer
Methods
Nonlinear Algebraic Equations
2 3!
∧
[0]
Assume x being close to x so that the series may be truncated:
∧
f (x ) ≈ (x
[0] [0]
− x)f ’(x[0] ), or
[0]
f (x )
f (x[0] ) ≈ (x[0] − x[1] )f ’(x[0] ) x = x − ’ [0] −
[1] [0]
f (x )
− Newton ’s method
Example : f (x) = (x − 3)(x − 2)(x − 1) = x 3 − 6x 2 + 11x − 6
November 2001 10.001 Introduction to Computer
Methods
Single Nonlinear Equation
f (x)
Introduce g(x) =
(x − 3)(x −1)
f (x) ’
f (x) 1 1
g (x) =
’
− +
(x − 3)(x −1) (x − 3)(x −1) (x − 3) (x −1)
We now use Newton’s method to find the roots of g(x):
g(x)
x [i+1]
=x − ’[i]
→ get x = 2.
g (x)
i
Note, Jacobian is evaluated at the position of
an old iteration, not at an unknown solution
Defining ∆x [i] = x [i +1] − x [i] , we rewrite the equation as
J(x [i] ) ∆x [i] = −f (x [i] ) or just J[i] ∆x [i] = −f [i]
The iterations are continued untill some convergence
criteria are met:
relative error f [i] ≤ δ rel f [0]
absolute error f [i] ≤ δ abs
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations
∂f x+sp x+p
J(x + sp) = T
∂x x + sp
1 x
f (x + p) = f (x) + ∫ J(x + sp) p ds
0
Av
The norm of the matrix is defined as: A = max ,
v≠0 v
Ay
so for any y A ≥ , or Ay ≤ A y , therefore
y
1 1
1
and ∫ [ J(x + sp) − J(x) ] ds
0
≤ L s p , so in this case
1
f (x + sp) = ∫ [ J(x + sp) − J(x) ] pds ≤ ( L s p ) p
0
≤ (L s ) p = O p
2
( ) 2
∧
[i +1]
x − x : 0.01 = 10−2
∧
[i + 2]
x − x : 0.00001 = 10−4
∧
[i + 3]
x − x : 0.000000001 = 10−8
J =
[i]
( )
9 x1
[i ] 2
8x 2
[i ]
8x1 ( )
[i ] [i ] 2
− 3 x 2
f =
[i ]
( ) ( )
3 x [i ] 3 + 4 x [i ] 2 − 145
1 2
( ) ( )
4 x [i ] 2 − x [i ] 3 + 28
1 2
[ i +1]
J ∆x = −f
[i] [i ] [i ]
x = x + ∆x
[i ] [i ]
How do we choose λi ?
Simplest way - weak line search:
- start with λi =2-m for m=0,1,2,…
As we reduce the value of λi bya a factor of 2 at
each step, we accept the first one that satisfies a
descent criterion:
(
f x + λi p < f x
[i ] [i ]
)
[i ]
( )
It can be proven that if the Jacobian is not singular,
the correct solution will be found by the reduced
step Newton’s algorithm.
November 2001 10.001 Introduction to Computer
Methods