Sie sind auf Seite 1von 14

Newton-Raphsons Method

f(x)

f(xi)
x f x 
i, i
f(xi )
xi 1 = xi -
f (xi )
f(xi-1)


xi+2 xi+1 xi X
Newton-Raphsons Method-cont.

f(x)
AB
tan(  
AC
f(xi) B

f ( xi )
f ' ( xi ) 
xi  xi 1

f ( xi )
C 
xi 1  xi 
A X f ' ( xi )
xi+1 xi
Algorithm for Newton-Raphson Method

Calculate the next estimate of the root

f(xi )
xi 1 = xi -
f'(xi )
Find the absolute relative approximate error

xi 1- xi
a =
xi 1
Algorithm for Newton-Raphson Method-cont.

Find if the absolute relative approximate error is


greater than the pre-specified relative error tolerance.

If so, go back to step 2, else stop the algorithm.

Also check if the number of iterations has exceeded


the maximum number of iterations.
Example

Again consider the ‘Thermistor’s’ example

To find the range of the resistance that is within


this acceptable limit at 190 C, we need to solve
the two equations below

 1.129241x10 3  2.341077 x10 3 ln( R)  8.775468 x10 8 ln R 


1 3

19.01  273.15
and

 1.129241x10 3  2.341077 x10 3 ln( R)  8.775468 x10 8 ln R 


1 3

18.99  273.15
Solution-Dry Run
Graph of function f(x)
f ( R)  2.341077 x10 3 ln( R)  8.775468 x10 8 ln R   2.293775 x10 3
3

4
0.001
9.5188110

0
0

f ( x) 0.001

0.002

3
 2.2937810 0.003
1 1.5 2 2.5 3 3.5 4
1 x 4
f(x)
Solution-cont.
First iteration:
Entered function along given interval with curre nt and next root and the
tangent line of the curve at the current root
3
1.6701710

0.001 R0  2
f R0 
R1  R0  /
f R 0 
f ( x)
0
0
f ( x)

f ( x)

tan( x)
 6.71035 x10  4
0.001 R1  2 
1.1706 x10 3
0.002
 2.57324
3

a  22.277%
 2.2937810
1 1.5 2 2.5 3 3.5
1 x x 0  x 1  x 4
f(x)
prev. guess
new guess
tangent line
Solution-cont.
Second iteration:
Entered function along given interval with curre nt and next root and the
tangent line of the curve at the current root
3
1.2171710
0.001

R1  2.57324
5 10

f R1 
4

R2  R1 
f / R 1 
0
0
f ( x)

f ( x)
5 10
 8.09957 x10 5
4

R2  2.57324 
f ( x)

9.0987 x10  4
tan( x)
0.001

0.0015
 2.66226

0.002
a  3.34374%
3
 2.2937810
1 1.5 2 2.5 3 3.5
1 x x 1  x 2  x 4
f(x)
prev. guess
new guess
tangent
Solution-cont.
Third iteration:

3
1.1751110 0.001

R2  2.66226
f R2 
0
0

R3  R2 
f ( x)

f / R 2 
f ( x)

f ( x)

 1.3692 x10 6
tan( x) 0.001

 2.66226 
8.79452 x10  4
 2.2937810
3
0.002
 2.66382
1 1.5 2 2.5 3 3.5
1
f(x)
x x 2  x 3  x 4
a  0.05845%
prev. guess
new guess
tangent
Advantages and Drawbacks of Newton-Raphsons
Method

Advantages: Converges fast, if it converges and requires only one guess


Drawbacks:

10
f(x)

0
2
-2 -1 0 3 1 2
1 x
-5

-10

-15

-20

Inflection point
Drawbacks cont.
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

f x   x3  0.03x 2  2.4x106  0
-7.50E-06

-1.00E-05

Division by zero
Drawbacks cont.
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
Drawbacks cont.
6
f(x)
5

3
3

AM2032 JAYANTA MUKHERJEE


2
2 f x   x 2  2  0
11
4
x
0
-2 -1 0 1 2 3
-1.75 -0.3040 0.5 3.142
-1

Oscillations near Local Maxima or Minima


Newton Raphsons Method-Pseudo Code

AM2032 JAYANTA MUKHERJEE


Next lecture :
Secant Method, and
some other methods

Das könnte Ihnen auch gefallen