Docsity

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

Partial preview of the text

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

Bisection Method

Basis of Bisection Method

Theorem

x

f(x)

xu^ x

An equation f(x)=0, where f(x) is a real continuous function, has at least one root between x (^) l and x (^) u if f(xl) f(xu ) < 0.

Figure 1 At least one root exists between the two points if the function is real, continuous, and changes sign.

x

f(x)

xu^ x

Basis of Bisection Method

Figure 3 If the function does not change sign between two points, there may not be any roots for the equation between the two points.

x

f(x)

xu x

f ( ) x f ( ) x = 0

x

f(x)

xu (^) x

Basis of Bisection Method

Figure 4 If the function changes sign between two points, more than one root for the equation may exist between the two points.

f ( ) x f ( ) x = 0

Step 1

x

f(x)

xu^ x

Choose x and xu as two guesses for the root such that f(x) f(xu) < 0, or in other words, f(x) changes sign between x and xu. This was demonstrated in Figure 1.

Figure 1

x

f(x)

xu^ x

xm

Step 2

Estimate the root, x (^) m of the equation f (x) = 0 as the mid point between x and xu as

x

x m =^

 + x^ u 2

Figure 5 Estimate of x (^) m

Step 4

x

x m =^

 + x^ u 2

× 100

− ∈ = new m

old m

new a (^) x

x (^) m x

xmnew =currentestimateof root

xmold =previousestimateof root

Find the new estimate of the root

Find the absolute relative approximate error

where

Step 5

Is?

Yes

No

Go to Step 2 using new upper and lower guesses.

Stop the algorithm

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

∈ a

∈ s

∈ a >∈ s

Note one should also check whether the number of

iterations is more than the maximum number of iterations

allowed. If so, one needs to terminate the algorithm and

notify the user about it.

Example 1 Cont.

The equation that gives the depth x to which the ball is submerged under water is given by

a) Use the bisection 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.

b) Find the absolute relative approximate error at the end of each iteration, and the number of significant digits at least correct at the end of each iteration.

x^3 − 0. 165 x^2 + 3. 993 × 10 −^4 = 0

Example 1 Cont.

From the physics of the problem, the ball would be submerged

between x = 0 and x = 2 R ,

where R = radius of the ball,

that is

x

x

x R

Figure 6 Diagram of the floating ball

Example 1 Cont.

Let us assume

x u

x 

Check if the function changes sign between x and x (^) u. ( ) ( ) ( ) ( ) ( ) ( ) ( )^3 ( )^2

(^3244)

  1. 11 0. 11 0. 1650. 11 3. 993 10 2. 662 10

0 0 0. 1650 3. 993 10 3. 993 10 − −

− −

= = − + × =− ×

= = − + × = × f x f

f x f

u

l

Hence

f ( xl ) f ( xu ) = f ( ) 0 f ( 0. 11 ) =( 3. 993 × 10 −^4 )(− 2. 662 × 10 −^4 ) < 0

So there is at least on root between x and x (^) u, that is between 0 and 0.

Example 1 Cont.

Figure 8 Graph demonstrating sign change between initial limits

Example 1 Cont.

Figure 9 Estimate of the root for Iteration 1

Example 1 Cont.

m =^ u

x x x

( ) ( ) ( ) ( )

  1. 0825 0. 0825 0. 165 0. 0825 3. 993 10 1. 622 10 4 5

(^3244)

= = − × × <

= = − + × = − × − −

− −

f x f x f f

f x f

l m

m

Iteration 2 The estimate of the root is

Hence the root is bracketed between x and x^ m, that is, between 0. and 0.0825. So, the lower and upper limits of the new bracket are xl = 0. 055 , xu = 0. 0825