Roots of A Nonlinear Equation
Roots of A Nonlinear Equation
Equation
07/20/09 http://numericalmethods.eng.usf.edu 1
Newton-Raphson Method
f(x)
f(xi )
f(xi)
[x f( x )] xi +1 = xi -
i, i
f ′(xi )
f(xi-1)
θ
xi+2 xi+1 xi X
2
Derivation
f(x)
AB
tan(α ) =
AC
f(xi) B
f ( xi )
f ' ( xi ) =
xi − xi +1
f ( xi )
xi +1 = xi −
C α A X f ' ( xi )
xi+1 xi
3
Algorithm for Newton-
Raphson Method
4
Step 1
5
Step 2
f(xi )
xi +1 = xi -
f'(xi )
Find the absolute relative approximate error
xi +1- xi
∈a = x 100
xi +1
6
Step 3
Find if the absolute relative approximate error is
greater than the pre-specified relative error
tolerance.
7
Example
You are working for ‘DOWN THE TOILET COMPANY’ that
makes floats for ABC commodes. The ball has a specific
gravity of 0.6 and has a radius of 5.5 cm. You are asked
to find the distance to which the ball will get submerged
when floating in water.
8
Solution
The equation that gives the depth ‘x’ to which the ball is
submerged under water is given by
f ( x ) = x 3-0.165 x 2+3.993x10- 4
f ( x ) = 3x 2-0.33x
Use the Newton’s method of finding
roots of equations to find the depth
‘x’ to which the ball is submerged
under water. Conduct three
iterations to estimate the root of the
above equation.
9
Graph of function f(x)
f ( x ) = x -0.165 x +3.993x10
3 2 -4
10
Iteration #1
x0 = 0.02
f ( x0 )
x1 = x0 −
f ' ( x0 )
3.413x10−4
x1 = 0.02 −
− 5.4 x10−3
= 0.08320
∈a = 75.96%
11
Iteration #2
x1 = 0.08320
f ( x1 )
x2 = x1 −
f ' ( x1 )
−1.670x10 −4
x2 = 0.08320 −
− 6.689 x10 −3
= 0.05824
∈a = 42.86%
12
Iteration #3
x2 = 0.05824
f ( x2 )
x3 = x2 −
f ' ( x2 )
3.717 x10−5
= 0.05284 −
− 9.043x10−3
= 0.06235
∈a = 6.592%
13
Advantages
14
Drawbacks
10
f(x)
0 x
-2 -1 2 0 3 1 2
1
-5
f ( x ) = ( x − 1) = 0
-10
3
-15
-20
Inflection Point
15
Drawbacks (continued)
1.00E-05
f(x)
7.50E-06
5.00E-06
2.50E-06
0.00E+00 x
-0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04
-2.50E-06
0.02
-5.00E-06
-1.00E-05
Division by zero
16
Drawbacks (continued)
1.5
f(x)
1
0.5
x
0
-2
-0.063069
0
0.54990 2 4
4.462 6
7.53982
8 10
-0.5
-1 f ( x ) = Sin x = 0
-1.5
Root Jumping
17
Drawbacks (continued)
6
f(x)
3
3
2
2 f ( x) = x2 + 2 = 0
11
4
x
0
-2 -1 0 1 2 3
-1.75 -0.3040 0.5 3.142
-1