Newton-Raphson SECANT METHOD

Preview:

Citation preview

Newton-Raphson

SECANT METHOD&

Newton-Raphson Method

)(xf

)f(x - = xx

i

iii

+1

f(x)

f(xi)

f(xi-1)

xi+2 xi+1 xi X

( ) ii xfx ,

Figure 1 Geometrical illustration of the Newton-Raphson method.

http://numericalmethods.eng.usf.edu

2

Derivation

f(x)

f(xi)

xi+1 xi

X

B

C A )(

)(1

i

iii

xf

xfxx

−=+

1

)()('

+−=

ii

ii

xx

xfxf

AC

AB=)tan(

Figure 2 Derivation of the Newton-Raphson method.

http://numericalmethods.eng.usf.edu

Algorithm for Newton-Raphson Method

Step 1

)(xf Evaluate symbolically.

Step 2Use an initial guess of the root, , to estimate the new value of the root, , as

ix

1+ix

( )( )i

iii

xf

xf - = xx

+1

Step 3

0101

1 x

- xx =

i

iia

+

+

Find the absolute relative approximate error asa

Step 4

Compare the absolute relative approximate error with the pre-specified relative error tolerance .

Also, check if the number of iterations has exceeded the maximum number of iterations allowed. If so, one needs to

terminate the algorithm and notify the user.

Is ?

Yes

No

Go to Step 2 using new estimate of the root.

Stop the algorithm

sa

Newton-Raphson

Convergence of Newton’s Method

SECANT METHOD

14

)(xf

)f(x - = xx

i

iii

+1

f(x)

f(xi)

f(xi-1)

xi+2 xi+1 xi X

( ) ii xfx ,

1

1)()()(

−=

ii

ii

ixx

xfxfxf

)()(

))((

1

11

−+

−−=

ii

iiiii

xfxf

xxxfxx

Newton’s Method

Approximate the derivative

Substituting Equation (2) into Equation (1) gives the Secant method

(1)

(2)

Figure 1 Geometrical illustration of the Newton-Raphson method.

Secant Method – Derivation

http://numericalmethods.eng.usf.edu

Secant Method – Derivation

http://numericalmethods.eng.usf.edu

)()(

))((

1

11

−+

−−=

ii

iiiii

xfxf

xxxfxx

The Geometric Similar Triangles

f(x)

f(xi)

f(xi-1)

xi+1 xi-1 xi X

B

C

E D A

11

1

1

)()(

+−

+ −=

− ii

i

ii

i

xx

xf

xx

xf

DE

DC

AE

AB=

Figure 2 Geometrical representation of the Secant method.

The secant method can also be derived from geometry:

can be written as

On rearranging, the secant method is given as

Algorithm Secant Method

Step 1

http://numericalmethods.eng.usf.edu

0101

1 x

- xx =

i

iia

+

+

Calculate the next estimate of the root from two initial guesses

Find the absolute relative approximate error

)()(

))((

1

11

−+

−−=

ii

iiiii

xfxf

xxxfxx

Step 2

http://numericalmethods.eng.usf.edu

Find if the absolute relative approximate error is greater than the prespecified relative error tolerance.

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

Also check if the number of iterations has exceeded the maximum number of iterations.

Secant Method