Declectures Non Linear Equations
Declectures Non Linear Equations
Out
November 2001 10.001 Introduction to Computer
Methods
Nonlinear Algebraic Equations Example
r
s r
s
N
(in)
i i ,i s
1
s
N N
(in) (in) (in)
i p,i i p,i
i 1 1
T
1 2 N
(F/ V) c c r 0 i 1, 2,..., N
Massbalancefor spieces1, 2,..., N
(F/ V) c c T c c T H r 0
Energybalance
Column of unknownvariables :x [c , c ,..., c , T]
1
+
]
1
]
November 2001 10.001 Introduction to Computer
Methods
Nonlinear Algebraic Equations Example
i 1 2 N
1 1 2 N
2 1 2 N
N 1 2 N
Each of the above equations may be written in the general form:
f (x , x ,..., x ) 0:
f (x , x ,..., x ) 0
f (x , x ,..., x ) 0
...
f (x , x ,..., x ) 0
Let x be the solution staisfying f(x)=0.
We do not know x and
[0]
take x as initial guess.
1
2
N
In vector form:
f(x)=0
f (x)
f (x)
f(x)=
...
f (x)
1
1
1
1
1
1
]
November 2001 10.001 Introduction to Computer
Methods
Nonlinear Algebraic Equations
[1] [2] [3]
[m]
m
[m]
m
We need to form a sequence of estimates to the solution:
x , x , x ,... that will hopehully converge to x.
Thus we want: lim x x
lim x x 0
Unlike with linear equations, we cant say much
about
existence or uniqueness of solutions, even for
a single equation.
November 2001 10.001 Introduction to Computer
Methods
Single Nonlinear Equation
2 3
[0]
We assume f(x) is infinitely differentiable at the solution x.
Then f(x) may be Taylor expanded around x :
1 1
f (x) f (x) (x x)f (x) (x x) f (x) (x x) f (x) ...
2 3!
Assume x being close to x so t
+ + + +
[0] [0] [0]
[0]
[0] [0] [1] [0] [1] [0]
[0]
3 2
hat the series may be truncated:
f (x ) (x x)f (x ), or
f (x )
f (x ) (x x )f (x ) x x
f (x )
Newton s method
Example : f (x) (x 3)(x 2)(x 1) x 6x 11x 6
+
November 2001 10.001 Introduction to Computer
Methods
Single Nonlinear Equation
November 2001 10.001 Introduction to Computer
Methods
Single Nonlinear Equation
November 2001 10.001 Introduction to Computer
Methods
Single Nonlinear Equation
For f(x)=(x-3)(x-2)(x-1)=x
3
-6x
2
+11x+6=0, we se that
Newtons method converges to the root at x=2 only if
1.6<x
[0]
<2.4.
We may look at the direction of the first step and see
why: x
[1]
- x
[0]
=-f(x
[0]
)/ f
(x
[0]
).
So, we have 2 easy roots: x=1, x=3 and a more
difficult one.
We may factorize out the roots we already know.
November 2001 10.001 Introduction to Computer
Methods
Single Nonlinear Equation
[i+1] [i]
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 Newtons method to find the roots of g(x):
g(x)
x x get x 2.
g (x)
_
+
,
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations
Lets extend the method to multiple equations:
f
1
(x
1
,x
2
,x,,x
N
)=0
f
2
(x
1
,x
2
,x,,x
N
)=0 => f(x)=0
.. Start from initial guess x
[0]
f
N
(x
1
,x
2
,x,,x
N
)=0
2
N N N
i i
j j k
i i j j k
j 1 j 1 k 1
j j k
[0]
As before expand each equation at the solution x with f( x )=0:
f (x) 1 f (x)
f (x) f (x) (x x ) (x x ) (x x ) ...
x 2 x x
Assume x is close to x and discard quadratic terms
+ + +
N
i
j
i j
j 1
j
:
f (x)
f (x) (x x )
x
_
,
:
f (x) J(x)(x x)
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations
[i ] [i ] [i ] [i 1]
i
[i ] [i 1] [i ]
[i ]
f (x ) J(x )(x x ) J(x)(x x)
Note, Jacobian is evaluated at the position of
an old iteration, not at an unknown solution
Defining x x x , we rewrite the equation as
J(x )
+
+
_
,
[i ] [i ] [i ] [i ] [i ]
[i ] [0]
rel
[i ]
abs
x f (x ) or just J x f
The iterations are continued untill some convergence
criteria are met:
relative error f f
absolute error f
+ + +
p)
What is the upper bound on this error?
f(x) and J(x) are continuous:
J(x+sp)-J(x) 0 as p 0 for all 0 s 1.
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations
[ ] [ ]
v 0
1 1
0 0
Av
The norm of the matrix is defined as: A max ,
v
Ay
so for any y A , or Ay A y , therefore
y
J(x sp) J(x) pds J(x sp) J(x) ds p
The error goes down at least as fast as p because for
a continuous Jaco
+ +
bian J(x+sp)-J(x) 0 as p 0.
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations
[ ] [ ]
[ ]
1 1
0 0
1
0
If we suggest that there exist some L>0 such that
J(y)-J(z) L y z
or there is some upper bound on the "stretching" effect of J.
f (x sp) J(x sp) J(x) pds J(x sp) J(x) ds p
and J(x sp) J(x) ds L s p , so in t
+ + +
+
[ ] ( )
( )
( )
1
0
2 2
his case
f (x sp) J(x sp) J(x) pds L s p p
L s p O p
+ +
1
]
:
:
:
:
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations, Example
1
]
1
1
1
1
1
]
1
1
]
1
+
+
2
2 1
2
2
1
2
2
1
2
2
1
1
1
3
2
2
1 2
2
2
3
1 1
x 3 x 8
x 8 x 9
x
f
x
f
x
f
x
f
J
: is Jacobian The
4
3
x
0 28 x x 4 f
0 145 x 4 x 3 f
: system simple a for works
method s Newton how examine s Let
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations, Example
( )
( )
( ) ( )
( ) ( )
] i [ ] i [ ] 1 i [ ] i [ ] i [ ] i [
3
] i [
2
2
] i [
1
2
] i [
2
3
] i [
1
] i [
2
] i [
2
] i [
1
] i [
2
2
] i [
1
] i [
x x x f x J
28 x x 4
145 x 4 x 3
f
x 3 x 8
x 8 x 9
J
: solve to
system following the have we step each At
+
1
1
]
1
+
+
1
1
]
1
+
November 2001 10.001 Introduction to Computer
Methods
Systems of Nonlinear Equations, Example
{ }
10
bs
abs 2 1
10
f , f max f criterion
e convergenc with the method s Newton
of e performanc examine us Let
<