Newton`s Method for Systems of Non Linear Equations

Newton’s Method for Systems of Non Linear
Equations
Given: X 0 an initial guess of the root of F ( x)  0
Newton' s Iteration
X k 1  X k  F ' ( X k ) F ( X k )
1
 f1 ( x1 , x2 ,...) 
F ( X )   f 2 ( x1 , x2 ,...) ,



 f1
 x
 1
f 2

F'(X ) 
 x1
 


f1
x2
f 2
x2








1
Example
• Solve the following system of equations:
y  x 2  0.5  x  0
x 2  5 xy  y  0
Initial guess x  1, y  0
 y  x 2  0.5  x 
1 
 2x 1
1
F  2
, X0   
, F '  

 x  5 xy  y 
2 x  5 y  5 x  1
0 
2
Solution Using Newton’s Method
Iteration 1 :
1  1 1 
 y  x 2  0.5  x   0.5
 2x 1
F  2


,
F
'


 




1
2
x

5
y

5
x

1
2

6
x

5
xy

y


 


 
1 1 1 
X1     

0
2

6
  

Iteration 2 :
1
 0.5 1.25 
 1   0.25

 

1 
0.0625
 1.5
F 
, F '  


0.25
1
.
25

7
.
25




1 
1.25   1.5
X2  



0.25 1.25  7.25
1
0.0625 1.2332 
 - 0.25   0.2126

 

3
Example
Try this
• Solve the following system of equations:
y  x2 1  x  0
x2  2 y 2  y  0
Initial guess x  0, y  0
1 
 y  x 2  1  x
2 x  1
0
F  2
, X0   
, F '  

2
 4 y  1
 2x
0
 x  2y  y 
4
Example
Solution
Iteration
0
1
2
3
4
5
_____________________________________________________________
Xk
0 
0 
 
 1
0
 
 0.6
 0.2 


 0.5287
 0.1969 


 0.5257
 0.1980 


 0.5257
 0.1980 


5
Comparison of Root
Finding Methods
 Advantages/disadvantages
 Examples
6
Summary
Method
Pros
Cons
Bisection
- Easy, Reliable, Convergent
- One function evaluation per
iteration
- No knowledge of derivative is
needed
- Slow
- Needs an interval [a,b]
containing the root, i.e.,
f(a)f(b)<0
Newton
- Fast (if near the root)
- Two function evaluations per
iteration
- May diverge
- Needs derivative and an
initial guess x0 such that
f’(x0) is nonzero
Secant
- Fast (slower than Newton)
- One function evaluation per
iteration
- No knowledge of derivative is
needed
- May diverge
- Needs two initial points
guess x0, x1 such that
f(x0)- f(x1) is nonzero
7
Example
Use Secant method to find the root of :
f ( x)  x 6  x  1
Two initial points x0  1 and x1  1.5
( xi  xi 1 )
xi 1  xi  f ( xi )
f ( xi )  f ( xi 1 )
8
Solution
_______________________________
k
xk
f(xk)
_______________________________
0 1.0000 -1.0000
1 1.5000 8.8906
2 1.0506 -0.7062
3 1.0836 -0.4645
4 1.1472 0.1321
5 1.1331 -0.0165
6 1.1347 -0.0005
9
Example
Use Newton' s Method to find a root of :
f ( x)  x 3  x  1
Use the initial point : x0  1.
Stop after three iterations , or
if xk 1  xk  0.001, or
if
f ( xk )  0.0001.
10
Five Iterations of the Solution
• k
xk
f(xk)
f’(xk) ERROR
• ______________________________________
•
•
•
•
•
•
0
1
2
3
4
5
1.0000
1.5000
1.3478
1.3252
1.3247
1.3247
-1.0000
0.8750
0.1007
0.0021
0.0000
0.0000
2.0000
5.7500
4.4499
4.2685
4.2646
4.2646
0.1522
0.0226
0.0005
0.0000
0.0000
11
Example
Use Newton' s Method to find a root of :
f ( x)  e  x  x
Use the initial point : x0  1.
Stop after three iterations , or
if xk 1  xk  0.001, or
if
f ( xk )  0.0001.
12
Example
Use Newton' s Method to find a root of :
f ( x )  e  x  x,
xk
f ( xk )
f ' ( x )  e  x  1
f ' ( xk )
f ( xk )
f ' ( xk )
1.0000 - 0.6321 - 1.3679 0.4621
0.5379 0.0461 - 1.5840 - 0.0291
0.5670 0.0002 - 1.5672 - 0.0002
0.5671 0.0000 - 1.5671 - 0.0000
13
Example
Estimates of the root of: x-cos(x)=0.
0.60000000000000
0.74401731944598
0.73909047688624
0.73908513322147
0.73908513321516
Initial guess
1 correct digit
4 correct digits
10 correct digits
14 correct digits
14
Example
In estimating the root of: x-cos(x)=0, to get more than 13 correct
digits:
• 4 iterations of Newton (x0=0.8)
• 43 iterations of Bisection method (initial
interval [0.6, 0.8])
• 5 iterations of Secant method
( x0=0.6, x1=0.8)
15