Example 1 (Bisection Methods) You are working for `DOWN THE

advertisement

Example 1 (Bisection Methods)

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

3 

0 .

165 x

2 

3 .

993

10

4 

0 x

to which the ball is submerged under water is given by

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.

Solution

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

0

 x

2 R

0

 x

2 ( 0 .

055 )

0

 x

0 .

11

Figure 5 Floating ball problem.

Lets us assume x

0 , x u

0 .

11

Check if the function changes sign between x

 and x u .

f ( x

)

 f ( 0 )

( 0 )

3 

0 .

165 ( 0 )

2 

3 .

993

10

4 

3 .

993

10

4 f ( x u

)

 f ( 0 .

11 )

( 0 .

11 )

3 

0 .

165 ( 0 .

11 )

2 

3 .

993

10

4  

2 .

662

10

4

Hence f ( x

) f ( x u

)

 f ( 0 ) f ( 0 .

11 )

( 3 .

993

10

4

)(

2 .

662

10

4

)

0

So there is at least one root between x

 and x u , that is between 0 and 0.11.

Iteration 1

The estimate of the root is x m

 x

 x u

2

0

0 .

11

2

0 .

055 f

  m

 f

0 .

055

 

0 .

055

3 

0 .

165

0 .

055

2 

3 .

993

10

4 

6 .

655

10

5 f ( x

) f ( x m

)

 f ( 0 ) f ( 0 .

055 )

3 .

993

10

4



6 .

655

10

4

0

Hence the root is bracketed between x m and x u , that is, between 0.055 and 0.11. So, the lower and upper limit of the new bracket is x

0 .

055 , x u

0 .

11

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 x m

 x

 x u

2

0 .

055

0 .

11

2

0 .

0825 f ( x m

)

 f ( 0 .

0825 )

( 0 .

0825 )

3 

0 .

165 ( 0 .

0825 )

2 

3 .

993

10

4  

1 .

622

10

4

f

    m

 f

0 .

055

 

0 .

0825

6 .

655

10

5

 

1 .

622

10

4

0

Hence, the root is bracketed between x

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

0 .

055 , x u

0 .

0825

The absolute relative approximate error

 a at the end of Iteration 2 is

 a

 x new m

 x new m x old m

100

0 .

0 .

0 5 5

0 .

0 8 2 5

1 0 0

33 .

33 %

None of the significant digits are at least correct in the estimated root of x m

0 .

0825

because the absolute relative approximate error is greater than 5%.

Iteration 3 x m

 x

 x u

2

0 .

0 5 5

0 .

0 8 2 5

2

0 .

06875 f ( x m

)

 f ( 0 .

06875 )

( 0 .

06875 )

3 

0 .

165 ( 0 .

06875 )

2 

3 .

993

10

4  

5 .

563

10

5 f ( x

) f ( x m

)

 f ( 0 .

055 ) f ( 0 .

06875 )

( 6 .

655

10

5

)

(

5.563

10

5

)

0

Hence, the root is bracketed between x

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

0 .

055 , x u

0 .

06875

The absolute relative approximate error

 a

at the ends of Iteration 3 is

 a

 x new m

 x new m x old m

100

0 .

20 %

0 .

0 8 2 5

0 .

0 6 8 7 5

1 0 0

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 f ( x )

0

as function of number of iterations for bisection method.

Iteration x

 x u x m

 a % f ( x m

)

1

2

3

4

5

6

7

8

9

10

At the end of 10 th iteration,

0.00000 0.11

0.055

0.055

0.055

0.11

0.0825

0.055 ----------

0.0825 33.33

6 .

655

10

5

1 .

622

10

4

0.06875 20.00

0.06875 0.06188 11.11

5 .

563

10

5

4 .

484

10

6

0.06188 0.06875 0.06531 5.263

0.06188 0.06531 0.06359 2.702

0.06188 0.06359 0.06273 1.370

0.06188 0.06273 0.0623

0.0623

0.0623

0.6897

0.06273 0.06252 0.3436

0.06252 0.06241 0.1721

2 .

593

10

5

1 .

0804

10

5

3 .

176

10

6

6 .

497

10

7

1 .

265

10

6

3 .

0768

10

7

 a

0 .

1721 %

Hence the number of significant digits at least correct is given by the largest value of m

for which

 a

0 .

5

10

2

 m

0 .

1721

0 .

5

10

2

 m

0 .

3442 log(

10

2

0 .

3442 )

 m

2 m

2

 log(

 m

0 .

3442 )

2 .

463

So m

2

The number of significant digits at least correct in the estimated root of

0 .

06241

at the end of the

10 th

iteration is 2.

Example 2 (newton-raphson methods)

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 2 Floating ball problem.

The equation that gives the depth x

in meters to which the ball is submerged under water is given by x

3 

0 .

165 x

2 

3 .

993

10

4 

0

Use the Newton-Raphson method of finding roots of equations to find a) the depth x

to which the ball is submerged under water. Conduct three iterations to estimate the root of the above equation. b) the absolute relative approximate error at the end of each iteration, and c) the number of significant digits at least correct at the end of each iteration.

Solution f

  x f

 x

 

3

3 x

2

0 .

165 x

2

0 .

33 x

3 .

993

10

4

Let us assume the initial guess of the root of f

0

is x

0

0 .

05 m .

This is a reasonable guess

(discuss why x

0

and x

0 .

11 m

are not good choices) as the extreme values of the depth x would be 0 and the diameter (0.11 m) of the ball.

Iteration 1

The estimate of the root is x

1

 x

0

 f f

 

0  

0

0 .

05

0 .

05

3 

3

0 .

165

0 .

05

2

0 .

05

2

0 .

33

3 .

993

0 .

05

10

4

0 .

05

0 .

05

1 .

118

10

4

9

10

3

0 .

01242

0 .

06242

The absolute relative approximate error

 a at the end of Iteration 1 is

 a

 x

1

 x

0 x

1

100

0 .

06242

0

0 .

06242

1 9 . 9 0 %

.

05

100

The number of significant digits at least correct is 0, as you need an absolute relative approximate error of 5% or less for at least one significant digit to be correct in your result.

Iteration 2

The estimate of the root is x

2

 x

1

 f f

 

1

  

1

0 .

06242

0 .

06242

3

3 

0 .

165

0 .

06242

2

0 .

06242

0 .

33

2 

3 .

993

0 .

06242

10

4

3 .

97781

10

7

0 .

06242

0 .

06242

0 .

06238

8 .

90973

4 .

4646

10

10

5

3

The absolute relative approximate error

 a

at the end of Iteration 2 is

 a

 x

2

 x

1 x

2

100

0 .

0 .

0 .

0 6 2 3 8

1 0 0

0 .

0716 %

The maximum value of m

for which

 a

0 .

5

10

2

 m

is 2.844. Hence, the number of significant digits at least correct in the answer is 2.

Iteration 3

The estimate of the root is x

3

 x

2

 f f

  x

2

 

2

0 .

06238

0 .

06238

3

3 

0 .

165

0 .

06238

2

0 .

06238

0 .

33

2 

3 .

993

0 .

06238

10

4

0 .

06238

4 .

44

8 .

91171

0 .

06238

0 .

06238

10

11

10

3

4 .

9822

10

9

The absolute relative approximate error

 a at the end of Iteration 3 is

 a

0 .

06238

0 .

06238

100

0 .

06238

0

The number of significant digits at least correct is 4, as only 4 significant digits are carried through in all the calculations.

Example 3 (secant methods)

You are working for ‘DOWN THE TOILET COMPANY’ that makes floats (Figure 2) for ABC commodes. The floating ball has a specific gravity of 0.6 and 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 3 

0 .

165 x 2 

3 .

993

10

4 x

to which the ball is submerged under water is given by

0

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.

Solution f

 x

3 

0 .

165 x

2 

3 .

993

10

4

Let us assume the initial guesses of the root of f

0

as x

1

0 .

02

and x

0

0 .

05

.

Figure 2 Floating ball problem.

Iteration 1

The estimate of the root is x

1

 x

0

 f f

 

0 x

0 x

1    

0 f

 x

1

 x

0

 x

0

3 

0 .

165

 x x

0

2

3

0

0 .

165 x

0

2

3 .

993

10

4

3 .

993

10

4 x

3

1

 x

0

0 .

165 x

2

1 x

1

3 .

993

10

4

0 .

05

0 .

05

3 

0 .

05

3

0 .

165

0 .

05

2

0 .

165

0 .

05

2

3 .

993

10

4

3 .

993

10

0 .

02

3 

4

0 .

05

0 .

02

0 .

165

0 .

02

2 

3 .

993

10

4

0 .

06461

The absolute relative approximate error

 a at the end of Iteration 1 is

 a

 x

1

 x

0 x

1

100

0 .

06461

0 .

05

100

0 .

06461

22 .

62 %

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 digit to be correct in your result.

Iteration 2 x

2

 x

1

 x

1 f f

  x

1

1 x

1

 x

0

   

0

 x

1

3

 x

1

3 

0 .

165 x

1

2 

0 .

165 x

1

2 

3 .

993

10

4

3 .

993

10

4 x

0

3 

 x

1

0 .

165 x

0

2

 x

0

3 .

993

10

4

0 .

06461

 

0 .

06461

3 

0 .

06461

3 

0 .

165

0 .

06461

2

0 .

165

0 .

06461

2 

3 .

993

10

4

3 .

993

10

0 .

05

3

4

0 .

06461

0 .

165

0 .

05

2

0 .

05

3 .

993

10

4

0 .

06241

The absolute relative approximate error

 a at the end of Iteration 2 is

 a

 x

2

 x

1 x

2

100

0 .

0 .

0 .

0 6 2 4 1

3 .

525 %

1 0 0

The number of significant digits at least correct is 1, as you need an absolute relative approximate error of 5% or less.

Iteration 3 x

3

 x

2

 x

2

 f f

 

2 x

2 x

2

 x

1

   

1

 x

2

3

 x

2

3 

0 .

165 x

2

2

0 .

165 x

2

2 

3 .

993

10

4

3 .

993

10

4 x

1

3

 x

2

0 .

165 x

1

2

 x

1

3 .

993

10

4

0 .

06241

 

0 .

06241

3 

0 .

06241

3 

0 .

165

0 .

06241

2

0 .

165

0 .

06241

2 

3 .

993

10

4

3 .

993

10

4

0 .

06461

3

0 .

06241

0 .

06461

0 .

165

0 .

06461

2 

3 .

993

10

4

0 .

06238

The absolute relative approximate error

 a

at the end of Iteration 3 is

 a

 x

3

 x

2 x

3

100

0 .

06238

0 .

06241

100

0 .

06238

0 .

0595 %

The number of significant digits at least correct is 2, as you need an absolute relative approximate error of 0.5% or less. Table 1 shows the secant method calculations for the results from the above problem.

Table 1 Secant method results as a function of iterations.

Iteration

Number, i x i

1 x i x i

1  a

% f

  i 1

1

2

3

4

0.02

0.05

0.06461

0.06241

0.05

0.06461

0.06241

0.06238

0.06461

0.06241

0.06238

0.06238

22.62

3.525

0.0595

3 .

64

10

4

1 .

9812

10

5

3 .

2852

10

7

2 .

0252

1 .

8576

10

10

13

9

Example 4

Derive the solution to ax

2  bx

 c

0

.

Solution ax

2  bx

 c

0

Dividing both sides by a

,

 a

0

, we get x

2  b a

Note if x a

 c

 a

0

0

, the solution to ax

2  bx

 c

0 is

Rewrite x

  c b x

2  b a x

 c a

0 as

x b

2 a

2 b

2

4 a

2

 c a

0 b

2 a

2

 b

2

4 a

2

 c a x

 b

2 a

 

  b

2

 b

2 

4 ac

4 a

2

4 ac b

4 a

2

2 

4 ac

2 a b

2 

4 ac x

  b

2 a

 b

 b

2

2 a

4 ac

2 a

Example 5

A ball is thrown down at 50 mph from the top of a building. The building is 420 feet tall. Derive the equation that would let you find the time the ball takes to reach the ground.

Solution

The distance s

covered by the ball is given by s

 ut

1

2 gt

2 where u

= initial velocity (ft/s) g

= acceleration due to gravity ( ft/s

2

) t

= time

( s )

Given u

50 miles hour

1 hour

3600 s

5280 ft

1 mile

73.33

ft s

g

 ft

32.2

s

2 s

420 ft we have

420

73.33

t

1

2

32 .

2

 t

2

16 .

1 t

2 

73 .

33 t

420

0

The above equation is a quadratic equation, the solution of which would give the time it would take the ball to reach the ground. The solution of the quadratic equation is t

73 .

33

73 .

33

2 

4

16 .

1

(

420 )

2 ( 16 .

1 )

3 .

315 ,

7 .

870

Since t

0 ,

the valid value of time t

is

3.315

s

.

Download