# Bisection Method - Numerical Analysis - Solved Exam, Past Exams for Mathematical Methods for Numerical Analysis and Optimization

8 pages
1000+Number of visits
Description
Main Points are:Bisection Method, Nonlinear Equation, Binary-Search Method, Bracketing Methods, Roots of Equation, Algorithm for Bisection Method, New Estimate of Root, Absolute Relative Approximate Error
20 points
this document
Preview3 pages / 8

03.03.1

Chapter 03.03 Bisection Method of Solving a Nonlinear Equation After reading this chapter, you should be able to:

1. follow the algorithm of the bisection method of solving a nonlinear equation, 2. use the bisection method to solve examples of finding roots of a nonlinear equation,

What is the bisection method and what is it based on? One of the first numerical methods developed to find the root of a nonlinear equation

0)( =xf was the bisection method (also called binary-search method). The method is based on the following theorem. Theorem An equation 0)( =xf , where )(xf is a real continuous function, has at least one root between

x and ux if 0)()( <uxfxf  (See Figure 1). Note that if 0)()( >uxfxf  , there may or may not be any root between x and ux

(Figures 2 and 3). If 0)()( <uxfxf  , then there may be more than one root between x and

ux (Figure 4). So the theorem only guarantees one root between x and ux .

Bisection method Since the method is based on finding the root between two points, the method falls

under the category of bracketing methods. Since the root is bracketed between two points,

x and ux , one can find the mid- point, mx between x and ux . This gives us two new intervals

1. 

x and mx , and 2. mx and ux .

Docsity.com

03.03.2 Chapter 03.03

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

Figure 2 If the function )(xf does not change sign between the two points, roots of the equation 0)( =xf may still exist between the two points.

f (x)

xℓ xu

x

f (x)

xℓ xu

x

Docsity.com

Bisection Method 03.03.3

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

Figure 4 If the function )(xf changes sign between the two points, more than one root for the equation 0)( =xf may exist between the two points. Is the root now between

x and mx or between mx and ux ? Well, one can find the sign of )()( mxfxf  , and if 0)()( <mxfxf  then the new bracket is between x and mx , otherwise,

it is between mx and ux . So, you can see that you are literally halving the interval. As one repeats this process, the width of the interval [ ]uxx , becomes smaller and smaller, and you can zero in to the root of the equation 0)( =xf . The algorithm for the bisection method is given as follows.

f (x)

xℓ xu x

f (x)

xℓ xu x

f (x)

xℓ xu x

Docsity.com

03.03.4 Chapter 03.03

Algorithm for the bisection method

The steps to apply the bisection method to find the root of the equation 0)( =xf are 1. Choose

x and ux as two guesses for the root such that 0)()( <uxfxf  , or in other words, )(xf changes sign between

x and ux . 2. Estimate the root, mx , of the equation 0)( =xf as the mid-point between x and ux

as

2

= um xx

x +

3. Now check the following a) If 0)()( <mxfxf  , then the root lies between x and mx ; then  xx = and

mu xx = . b) If 0)()( >mxfxf  , then the root lies between mx and ux ; then mxx = and

uu xx = . c) If 0)()( =mxfxf  ; then the root is mx . Stop the algorithm if this is true.

4. Find the new estimate of the root

2 = um xxx +

Find the absolute relative approximate error as

100 - = new

oldnew

×∈ m

mm a x

xx

where newmx = estimated root from present iteration oldmx = estimated root from previous iteration

5. Compare the absolute relative approximate error a∈ with the pre-specified relative error tolerance s∈ . If sa >∈∈ , then go to Step 3, else stop the algorithm. 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 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. The equation that gives the depth x to which the ball is submerged under water is given by

010993.3165.0 423 =×+− −xx 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. 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.

Docsity.com

Bisection Method 03.03.5

Solution

From the physics of the problem, the ball would be submerged between 0=x and Rx 2= , where

Rx 20 ≤≤ )055.0(20 ≤≤ x

11.00 ≤≤ x

Figure 5 Floating ball problem. Lets us assume

11.0 ,0 == uxx Check if the function changes sign between

x and ux . 4423 10993.310993.3)0(165.0)0()0()( −− ×=×+−== fxf

4423 10662.210993.3)11.0(165.0)11.0()11.0()( −− ×−=×+−== fxf u

Hence 0)10662.2)(10993.3()11.0()0()()( 44 <×−×== −−ffxfxf u So there is at least one root between

x and ux , that is between 0 and 0.11. Iteration 1 The estimate of the root is

2 u

m xxx += 

2

11.00 + =

055.0= ( ) ( ) ( ) ( ) 5423 10655.610993.3055.0165.0055.0055.0 −− ×=×+−== fxf m

( )( ) 010655.610993.3)055.0()0()()( 44 >××== −−ffxfxf m

Docsity.com

03.03.6 Chapter 03.03

Hence the root is bracketed between mx and ux , that is, between 0.055 and 0.11. So, the lower and upper limit of the new bracket is

11.0 ,055.0 == uxx At this point, the absolute relative approximate error a∈ cannot be calculated as we do not have a previous approximation. Iteration 2 The estimate of the root is

2 u

m xxx += 

2

11.0055.0 + =

0825.0= 4423 10622.110993.3)0825.0(165.0)0825.0()0825.0()( −− ×−=×+−== fxf m ( ) ( ) ( ) ( ) ( ) ( ) 010622.110655.60825.0055.0 45 <×−××== −−ffxfxf m Hence, the root is bracketed between

x and mx , that is, between 0.055 and 0.0825. So the lower and upper limit of the new bracket is

0825.0 ,055.0 == uxx The absolute relative approximate error a∈ at the end of Iteration 2 is

100new oldnew

× −

=∈ m

mm a x

xx

100 0825.0

055.00825.0 ×

− =

%33.33= None of the significant digits are at least correct in the estimated root of 0825.0=mx because the absolute relative approximate error is greater than 5%. Iteration 3

2 u

m xxx += 

2

0825.0055.0 + =

06875.0= 5423 10563.510993.3)06875.0(165.0)06875.0()06875.0()( −− ×−=×+−== fxf m

0)105.563()10655.6()06875.0()055.0()()( 55 <×−××== −ffxfxf m Hence, the root is bracketed between

x and mx , that is, between 0.055 and 0.06875. So the lower and upper limit of the new bracket is

06875.0 ,055.0 == uxx The absolute relative approximate error a∈ at the ends of Iteration 3 is

Docsity.com

Bisection Method 03.03.7

100new oldnew

× −

=∈ m

mm a x

xx

100 06875.0

0825.006875.0 ×

− =

%20= Still none of the significant digits are at least correct in the estimated root of the equation as the absolute relative approximate error is greater than 5%. Seven more iterations were conducted and these iterations are shown in Table 1. Table 1 Root of 0)( =xf as function of number of iterations for bisection method.

Iteration 

x ux mx a∈ % )( mxf 1 0.00000 0.11 0.055 ---------- 510655.6 −× 2 0.055 0.11 0.0825 33.33 410622.1 −×− 3 0.055 0.0825 0.06875 20.00 510563.5 −×− 4 0.055 0.06875 0.06188 11.11 610484.4 −× 5 0.06188 0.06875 0.06531 5.263 510593.2 −×− 6 0.06188 0.06531 0.06359 2.702 5100804.1 −×− 7 0.06188 0.06359 0.06273 1.370 610176.3 −×− 8 0.06188 0.06273 0.0623 0.6897 710497.6 −× 9 0.0623 0.06273 0.06252 0.3436 610265.1 −×− 10 0.0623 0.06252 0.06241 0.1721 7100768.3 −×−

At the end of 10th iteration,

%1721.0=∈a Hence the number of significant digits at least correct is given by the largest value of m for which

m a

−×≤∈ 2105.0 m−×≤ 2105.01721.0

m−≤ 2103442.0 m−≤ 2)3442.0log(

463.2)3442.0log(2 =−≤m So

2=m The number of significant digits at least correct in the estimated root of 06241.0 at the end of the th10 iteration is 2. Advantages of bisection method

a) The bisection method is always convergent. Since the method brackets the root, the method is guaranteed to converge.

b) As iterations are conducted, the interval gets halved. So one can guarantee the error in the solution of the equation.

Docsity.com

03.03.8 Chapter 03.03

Drawbacks of bisection method a) The convergence of the bisection method is slow as it is simply based on halving

the interval. b) If one of the initial guesses is closer to the root, it will take larger number of

iterations to reach the root. c) If a function )(xf is such that it just touches the x -axis (Figure 6) such as 0)( 2 == xxf it will be unable to find the lower guess,

x , and upper guess, ux , such that 0)()( <uxfxf  d) For functions )(xf where there is a singularity1 and it reverses sign at the

singularity, the bisection method may converge on the singularity (Figure 7). An example includes

x xf 1)( =

where 2−= 

x , 3=ux are valid initial guesses which satisfy 0)()( <uxfxf

However, the function is not continuous and the theorem that a root exists is also not applicable.

Figure 6 The equation 0)( 2 == xxf has a single root at 0=x that cannot be bracketed. 1 A singularity in a function is defined as a point where the function becomes infinite. For example, for a function such as x/1 , the point of singularity is 0=x as it becomes infinite.

f (x)

x

Docsity.com