Docsity

Secant Method - Numerical Methods - Lecture Slides, Slides of Mathematical Methods for Numerical Analysis and Optimization

Partial preview of the text

Download Secant Method - Numerical Methods - Lecture Slides and more Slides Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Secant Method

Secant Method – Derivation

f(x )

f(x )

x = x -

i

i i i

  • 1

f(x)

f(xi)

f(xi- 1 )

xi+2 xi+1 xi X

θ

[ x (^) i (^) , f ( xi )]

1

−

−

−

i i

i i i x x

f x f x f x

1

1 1 −

−

i i

i i i i i

f x f x

f x x x

x x

Newton’s Method

Approximate the derivative

Substituting Equation (2)

into Equation (1) gives the

Secant method

Figure 1 Geometrical illustration of

the Newton-Raphson method.

Algorithm for Secant Method

Step 1

1

1

x

x - x

i

i i a

∈ ×

Calculate the next estimate of the root from two initial guesses

Find the absolute relative approximate error

1

1 1

−

−

i i

i i i i i

f x f x

f x x x

x x

Example 1

You are working for ‘DOWN THE TOILET COMPANY’ that

makes floats for ABC commodes. The floating ball has a

specific gravity of 0.6 and has a radius of 5.5 cm. You are

asked to find the depth to which the ball is submerged when

floating in water.

Figure 3 Floating Ball Problem.

Example 1 Cont.

Use the Secant 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.

  • Find the absolute relative approximate error and the

number of significant digits at least correct at the end

of each iteration.

The equation that gives the depth x to which the ball is

submerged under water is given by

3 2 4 0 165 3993 10

- f x = x -. x +. ×

Example 1 Cont.

Let us assume the initial guesses of the root of

as and

f ( ) x = 0

1

−

x

Iteration 1

The estimate of the root is

3 2 4 3 2 4

3 2 4

0 1

0 0 1 1 0

− + × − − + ×

− + × −

− −

−

−

−

f x f x

f x x x

x x

0

x =

Example 1 Cont.

The absolute relative approximate error at the end of

Iteration 1 is

1

1 0

×

×

x

x x

a

a

The number of significant digits at least correct is 0, as you

need an absolute relative approximate error of 5% or less

for one significant digits to be correct in your result.

Example 1 Cont.

Iteration 2

The estimate of the root is

( )( )

( ) ( )

3 2 4 3 2 4

3 2 4

1 0

1 1 0 2 1

− + × − − + ×
− + × −

− −

−

f x f x

f x x x x x

Example 1 Cont.

The absolute relative approximate error at the end of

Iteration 2 is

2

2 1

×

×

x

x x

a

a

The number of significant digits at least correct is 1, as you

need an absolute relative approximate error of 5% or less.

Example 1 Cont.

Iteration 3

The estimate of the root is

( )( )

( ) ( )

3 2 4 3 2 4

3 2 4

2 1

2 2 1 3 2

− + × − − + ×
− + × −

− −

−

f x f x

f x x x x x

Example 1 Cont.

The absolute relative approximate error at the end of

Iteration 3 is

3

3 2

×

×

x

x x

a

a

The number of significant digits at least correct is 5, as you

need an absolute relative approximate error of 0.5% or

less.

Advantages

• Converges fast, if it converges

• Requires two guesses that do not need to bracket

the root

Drawbacks

Division by zero

10 5 0 5 10

2

1

0

1

2

f(x) prev. guess new guess

2

− 2

0

f x( )

f x( )

f x( )

− 10 x x, (^) guess1,x (^) guess2 10

f ( ) x = Sin ( ) x = 0