Mws Gen Nle TXT Falseposition

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

Chapter 03.

06 False-Position Method Equation

of

Solving

Nonlinear

After reading this chapter, you should be able to 1. follow the algorithm of the false-position method of solving a nonlinear equation, 2. apply the false-position method to find roots of a nonlinear equation. Introduction In chapter 03.03, the bisection method was described as one of the simple bracketing methods for solving a nonlinear equation of the general form f ( x) = 0 (1)
f ( x)

f ( xU )

Exact root

xL

O
f ( xL )

xr

xU

Figure 1 False-Position Method The above nonlinear equation can be stated as finding the value of x such that Equation (1) is satisfied. In the bisection method, we identify proper values of x L (lower bound value) and xU (upper bound value) for the current bracket, such that f ( x L ) f ( xU ) < 0 . (2) The next predicted/improved root x m can be computed as the midpoint between x L and xU as x + xU xm = L (3) 2 03.06.1

03.06.2

Chapter 03.06

The new upper and lower bounds are then established, and the procedure is repeated until the convergence is achieved (such that the new lower and upper bounds are sufficiently close to each other). However, in the example shown in Figure 1, the bisection method may not be efficient because it does not take into consideration that f ( x L ) is much closer to the zero of the function f (x) as compared to f ( xU ) . In other words, the next predicted root xr would be closer to xL (in the example as shown in Figure 1), than the mid-point between x L and xU . The false-position method takes advantage of this observation mathematically by drawing a secant from the function value at xL to the function value at xU , and estimates the root as where it crosses the x-axis. False-Position Method Based on two similar triangles, shown in Figure 1, one gets 0 f ( x L ) 0 f ( xU ) = xm x L x m xU From Equation (4), one obtains ( xm x L ) f ( xU ) = ( xm xU ) f ( x L ) xU f ( x L ) x L f ( xU ) = x m { f ( x L ) f ( xU ) } The above equation can be solved to obtain the next predicted root x m as x f ( x L ) x L f ( xU ) xm = U f ( x L ) f ( xU ) The above equation, through simple algebraic manipulations, can also be expressed as f ( xU ) x m = xU f ( x L ) f ( xU ) x L xU or f ( xL ) xm = x L f ( xU ) f ( x L ) xU x L False-Position Algorithm The steps to apply the false-position method to find the root of the equation f ( x ) = 0 are as follows. Choose x L and xU as two guesses for the root such that f ( x L ) f ( xU ) < 0 , or in other words, f ( x ) changes sign between x L and xU . Estimate the root, x m of the equation f ( x ) = 0 as x f ( x L ) x L f ( xU ) xm = U f ( x L ) f ( xU ) Now check the following

(4)

(5)

(6)

(7)

False-Position Method of Solving a Nonlinear Equation

03.06.3

If f ( x L ) f ( x m ) < 0 , then the root lies between x L and x m ; then x L = x L and xU = x m . If f ( x L ) f ( x m ) > 0 , then the root lies between x m and xU ; then x L = x m and xU = xU . If f ( x L ) f ( x m ) = 0 , then the root is x m . Stop the algorithm. Find the new estimate of the root x f ( x L ) x L f ( xU ) xm = U f ( x L ) f ( xU ) Find the absolute relative approximate error as x new x old a = m new m 100 xm where new x m = estimated root from present iteration
old x m = estimated root from previous iteration

Compare the absolute relative approximate error a with the pre-specified relative error tolerance s . If a >s , 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. Note that the false-position and bisection algorithms are quite similar. The only difference is the formula used to calculate the new estimate of the root x m as shown in steps #2 and #4! 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.5cm. 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 x 3 0.165 x 2 + 3.993 10 4 = 0 Use the false-position 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 third iteration.

03.06.4 Figure 2 Floating ball problem. Solution

Chapter 03.06

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 2R 0 x 2(0.055) 0 x 0.11 Let us assume x L = 0, xU = 0.11 Check if the function changes sign between x L and xU f ( x L ) = f ( 0) = ( 0) 0.165( 0 ) + 3.993 10 4 = 3.993 10 4
3 2 3 2

f ( xU ) = f ( 0.11) = ( 0.11) 0.165( 0.11) + 3.993 10 4 = 2.662 10 4 Hence f ( x L ) f ( xU ) = f ( 0) f ( 0.11) = ( 3.993 10 4 ) ( 2.662 10 4 ) < 0 Therefore, there is at least one root between x L and xU , that is between 0 and 0.11. Iteration 1 The estimate of the root is x f ( x L ) x L f ( xU ) xm = U f ( x L ) f ( xU ) 0.11 3.993 10 4 0 2.662 10 4 3.993 10 4 2.662 10 4 = 0.0660 =

f ( x m ) = f ( 0.0660 ) = ( 0.0660 ) 0.165( 0.0660 ) + 3.993 10 4 = 3.1944 10 5 f ( x L ) f ( x m ) = f ( 0 ) f ( 0.0660 ) = ( + )( ) < 0 Hence, the root is bracketed between x L and x m , that is, between 0 and 0.0660. So, the lower and upper limit of the new bracket is, x L = 0, xU = 0.0660 , respectively.
3 2

Iteration 2 The estimate of the root is x f ( x L ) x L f ( xU ) xm = U f ( x L ) f ( xU )

0.0660 3.993 10 4 0 3.1944 10 5 = 3.993 10 4 3.1944 10 5 = 0.0611 The absolute relative approximate error for this iteration is

False-Position Method of Solving a Nonlinear Equation 0.0611 0.0660 100 8% 0.0611


3 2

03.06.5

a =

f ( x m ) = f ( 0.0611) = ( 0.0611) 0.165( 0.0611) + 3.993 10 4 = 1.1320 10 5 f ( x L ) f ( x m ) = f ( 0 ) f ( 0.0611) = ( + )( + ) > 0 Hence, the lower and upper limit of the new bracket is, x L = 0.0611, xU = 0.0660 Iteration 3 The estimate of the root is x f ( x L ) x L f ( xU ) xm = U f ( x L ) f ( xU ) =

0.0660 1.132 10 5 0.0611 3.1944 10 5 1.132 10 5 3.1944 10 5 = 0.0624 The absolute relative approximate error for this iteration is 0.0624 0.0611 a = 100 2.05% 0.0624 f ( x m ) = 1.1313 10 7 f ( x L ) f ( x m ) = f ( 0.0611) f ( 0.0624 ) = ( + )( ) < 0 Hence, the lower and upper limit of the new bracket is, x L = 0.0611, xU = 0.0624

All iterations results are summarized in Table 1. Table 1 Root of f ( x ) = x 3 0.165 x 2 + 3.993 10 4 = 0 for false-position method. Iteration xL xU xm a % f ( xm ) 1 2 3 0.0000 0.1100 0.0660 ---0.0000 0.0660 0.0611 8.00 0.0611 0.0660 0.0624 2.05 3.1944 10 5 1.1320 10 5 1.1313 10 7

To find how many significant digits are at least correct in the last iterative value, a 0.5 10 2m 2.05 0.5 10 2m m 1.387 The number of significant digits at least correct in the estimated root of 0.0624 at the end of 3rd iteration is 1. Example 2 Find the root of f ( x ) = ( x 4) 2 ( x + 2 ) = 0 , using the initial guesses of x L = 2.5 and xU = 1.0, and a pre-specified tolerance of s = 0.1% .

03.06.6 Solution

Chapter 03.06

The individual iterations are not shown for this example, but the results are summarized in Table 2. It takes five iterations to meet the pre-specified tolerance. Table 2 Root of f ( x ) = ( x 4) 2 ( x + 2 ) = 0 for false-position method. Iteration x L xU f ( x L ) f ( xU ) xm a % 1 2 3 4 5 -2.5 -2.5 -2.5 -2.5 -2.5 -1 -1.813 -1.971 -1.996 -1.999 -21.13 -21.13 -21.13 -21.13 -21.13 25.00 6.319 1.028 0.1542 0.02286 -1.813 -1.971 -1.996 -1.999 -2.000 N/A 8.024 1.229 0.1828 0.02706 f ( xm ) 6.319 1.028 0.1542 0.02286 0.003383

To find how many significant digits are at least correct in the last iterative answer, a 0.5 10 2m 0.02706 0.5 10 2m m 3.2666 Hence, at least 3 significant digits can be trusted to be accurate at the end of the fifth iteration. FALSE-POSITION METHOD OF SOLVING A NONLINEAR EQUATION Topic Summary Major Authors Date False-Position Method of Solving a Nonlinear Equation Textbook Chapter of False-Position Method General Engineering Duc Nguyen October 7, 2012

You might also like