Newton-Raphson Method Nonlinear Equations

11 downloads 291 Views 240KB Size Report
7/17/2003 http://numericalmethods.eng.usf.edu. 1. Roots of a Nonlinear Equation . Topic: Newton-Raphson Method. Major: General Engineering ...
Roots of a Nonlinear Equation

Topic: Newton-Raphson Method Major: General Engineering

7/17/2003

http://numericalmethods.eng.usf.edu

1

Newton-Raphson Method f(x)

[x f (x )]

f(xi)

i,

i

f(xi ) xi +1 = xi ′ i) f (x

f(xi-1) θ xi+2

2

xi+1

xi

X

http://numericalmethods.eng.usf.edu

Derivation f(x)

tan(α ) = f(xi)

AB AC

B

f ( xi ) f ' ( xi ) = xi − xi +1

3

C α

A

xi+1

xi

X

f ( xi ) xi +1 = xi − f ' ( xi ) http://numericalmethods.eng.usf.edu

Algorithm for NewtonRaphson Method

4

http://numericalmethods.eng.usf.edu

Step 1

Evaluate f′(x) symbolically

5

http://numericalmethods.eng.usf.edu

Step 2 Calculate the next estimate of the root

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

xi +1- xi ∈a = x 100 xi +1 6

http://numericalmethods.eng.usf.edu

Step 3 „

„

„

7

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.

http://numericalmethods.eng.usf.edu

Example „

8

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.

http://numericalmethods.eng.usf.edu

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

9

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.

http://numericalmethods.eng.usf.edu

Graph of function f(x) f ( x ) = x -0.165 x +3.993x10 3

10

2

-4

http://numericalmethods.eng.usf.edu

Iteration #1 x 0 = 0 . 02

f (x 0 ) x1 = x 0 − f ' (x 0 ) 3 .413x 10 − 4 x 1 = 0 . 02 − − 5 . 4 x 10 − 3 = 0.08320 ∈ a = 75 . 96 %

11

http://numericalmethods.eng.usf.edu

Iteration #2 x 1 = 0 . 08320 x 2 = x1 −

f (x1 ) f ' (x1 )

− 1 . 670 x 10 − 4 x 2 = 0 . 08320 − − 6 . 689 x 10 − 3 = 0.05824 ∈ a = 42 . 86 %

12

http://numericalmethods.eng.usf.edu

Iteration #3 x 2 = 0 . 05824

f (x 2 ) x3 = x2 − f ' (x 2 ) 3 . 717 x 10 − 5 = 0 . 05284 − − 9 . 043 x 10 − 3 = 0.06235 ∈ a = 6 . 592 %

13

http://numericalmethods.eng.usf.edu

Iteration #4 x 3 = 0 . 06235 ?????? x 3 = ???? − ?????? ?????? = ???? − ?????? = ??????? ∈ a = ????? % 14

http://numericalmethods.eng.usf.edu

Advantages

„ „

15

Converges fast, if it converges Requires only one guess

http://numericalmethods.eng.usf.edu

Drawbacks 10

f(x)

5

x

0 -2

2

-1

0

3

1

2

1 -5

-10

f ( x ) = ( x − 1) = 0 3

-15

-20

Inflection Point 16

http://numericalmethods.eng.usf.edu

Drawbacks (continued) 1.00E-05

f(x)

7.50E-06 5.00E-06 2.50E-06

x

0.00E+00 -0.03

-0.02

-0.01

-2.50E-06

0

0.01

0.02

0.03

0.04

0.02

-5.00E-06 -7.50E-06

f ( x ) = x 3 − 0.03 x 2 + 2.4 x10 −6 = 0

-1.00E-05

Division by zero 17

http://numericalmethods.eng.usf.edu

Drawbacks (continued) f(x)

1.5

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 18

http://numericalmethods.eng.usf.edu

Drawbacks (continued) 6

f(x)

5

4

3

3 2

f (x ) = x 2 + 2 = 0

2

11 4

x

0 -2

-1.75

-1

-0.3040

0

0.5

1

2

3

3.142

-1

Oscillations near Local Maxima or Minima 19

http://numericalmethods.eng.usf.edu