Professional Documents
Culture Documents
2.1 Nonlinear Equs - BisectionFalse-Position
2.1 Nonlinear Equs - BisectionFalse-Position
2.1 Nonlinear Equs - BisectionFalse-Position
Numerical Methods 2
Let’s look at the function
f(x)=ex+sin(x)
It’s a periodic function
With many roots.
Numerical Methods 3
Theorem
x
x
xu
f(x)
x x
xu
Numerical Methods 5
If the function f ( x ) does not change sign between two
points, there may not be any roots for the equation f ( x ) = 0
between the two points.
f(x)
f(x)
x xu
x x
x xu
Numerical Methods 6
f(x)
xu
x
x
If the function f ( x ) changes sign between two points, more than one
root for the equation f ( x ) = 0 may exist between the two points.
Numerical Methods 7
These graphs show some exceptions to the
general cases illustrated on the left. In (i), a
multiple root occurs where the function is
tangential to the x axis. There are an even
number of intersections for the interval. In
(ii) is depicted a discontinuous function with
an even number of roots and end points of
opposite signs. Finding the roots in such
cases requires special strategies.
In (i) and (iii), if the function is positive at both
the rule can be broken by two functions:
boundaries, there will be either an even number of
roots or no roots; in the other two graphs, if the 1. if the function is tangential to the x-axis between the two points.
function has opposite signs at the boundary points,
there will be an odd number of roots within the 2. if the function is a piecewise function and has two parts between
interval. the two points.
Numerical Methods 8
Numerical Methods 9
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.
f(x)
x
x
xu
Numerical Methods 10
Estimate the root, xm of the equation f (x) = 0 as
the mid point between x and xu as
f(x)
x + xu
xm =
2
x xm
x
xu
Estimate of xm
Numerical Methods 11
Now check the following
Numerical Methods 12
Find the new estimate of the root
x + xu
xm =
2
Find the absolute relative approximate error
x new − x old
a = 100
m m
new
x m
where
xmold = previous estimate of root
xmnew = current estimate of root
Numerical Methods 13
Compare the absolute relative approximate error a with
the pre-specified error tolerance s .
Go to Step 2 using new
Yes upper and lower
Is a s ? guesses.
Numerical Methods 14
You are asked to find the depth to which the ball is
submerged when floating in water. The floating
ball has a specific gravity of 0.6 and has a radius of
5.5 cm.
Numerical Methods 15
The equation that gives the depth x to which the ball
is submerged under water is given by
x3 0.165x 2 3.993 10 4
0
Numerical Methods 16
From the physics of the problem, the ball would be
submerged between x = 0 and x = 2R,
where R = radius of the ball,
that is:
0 x 2R
R
0 x 2(0.055 )
0 x 0.11
Numerical Methods 17
Solution
f ( x ) = x 3 − 0.165 x 2 + 3.993 10 - 4
Graph of the function f(x)
Numerical Methods 18
Let us assume
x = 0.00
xu = 0.11
Check if the function changes sign between x and xu .
Hence
( )( )
f ( xl ) f ( xu ) = f (0 ) f (0.11) = 3.993 10 −4 − 2.662 10 −4 0
So there is at least one root between x and xu, that is between 0 and 0.11
Numerical Methods 19
Iteration 1
x + xu 0 + 0.11
The estimate of the root is xm = = = 0.055
2 2
( )(
f ( xl ) f ( xm ) = f (0 ) f (0.055) = 3.993 10 − 4 6.655 10 −5 0 )
Hence the root is bracketed between xm and xu, that is, between 0.055
and 0.11. So, the lower and upper limits of the new bracket are
xl = 0.055, xu = 0.11
At this point, the absolute relative approximate error a cannot be
calculated as we do not have a previous approximation.
Numerical Methods 20
Iteration 2
Hence the root is bracketed between x and xm, that is, between 0.055
and 0.0825. So, the lower and upper limits of the new bracket are
xl = 0.055, xu = 0.0825
Numerical Methods 21
The absolute relative approximate error a at the end of Iteration 2 is
xmnew − xmold
a = new
100
xm
0.0825 − 0.055
= 100
0.0825
= 33.333%
None of the significant digits are at least correct in the estimate root of
xm = 0.0825 because the absolute relative approximate error is greater
than 5%.
Numerical Methods 22
Iteration 3
( )( )
f ( xl ) f ( xm ) = f (0.055) f (0.06875 ) = 6.655 10 −5 − 5.563 10 −5 0
Hence the root is bracketed between x and xm, that is, between 0.055
and 0.06875. So, the lower and upper limits of the new bracket are
xl = 0.055, xu = 0.06875
Numerical Methods 23
The absolute relative approximate error a at the end of Iteration 3 is
xmnew − xmold
a = new
100
xm
0.06875 − 0.0825
= 100
0.06875
= 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.
Numerical Methods 24
Table 1 Root of f(x)=0 as function of number of iterations for
bisection method.
m 2 - log 10 2 a
%
Numerical Methods 25
Hence the number of significant digits at least correct is given by the
largest value or m for which
a 0.5 10 2 − m
0.1721 0.5 10 2 − m
0.3442 10 2 − m
log (0.3442 ) 2 − m
m 2 − log (0.3442 ) = 2.463 m 2 - log 10 2 a
%
So
m=2
Numerical Methods 26
Always convergent
The root bracket gets halved with each
iteration - guaranteed.
Numerical Methods 27
◼ Slow convergence
◼ If one of the initial guesses is close to
the root, the convergence is slower
Numerical Methods 28
If a function f(x) is such that it just touches
the x-axis it will be unable to find the lower
and upper guesses.
f(x) f (x ) = x 2
Numerical Methods 29
◼ Function changes sign but root does not
exist
1
f(x) f (x ) =
x
Numerical Methods 30
The bisection method is relatively inefficient.
It requires large number of iterations to
converge for a solution.
False-position refines the interval narrowing
technique in the Bisection method.
Instead of halving the interval, f(xl) and f(xu)
are joined by a straight line. The intersection
of this line with the x-axis represent the
improved estimate of the root.
Numerical Methods 31
f(x)
f(x u)
xl
xu x
f(xl)
Numerical Methods 32
In this case the computation of the root estimate can
be derived, by using the similarity between the two
triangles:
f(x)
f xl f xu
f(xu)
xr xl xu xr
xl
x
f x u xl xu xu
xr xu
f xl f xu f(xl)
Numerical Methods 34
Numerical Methods 35
i xl xu f(xl) f(xu) xm f(xm) |Ɛa|% m Using the initial guess:
1 1 20 51.11962 -8.40215 10.5 9.953 - - xl= 1
2 10.5 20 9.953 -8.40215 15.25 -0.90234 31.14754 0 xu=20
3 10.5 15.25 9.953 -0.90234 12.875 4.004873 18.4466 0
4 12.875 15.25 4.004873 -0.90234 14.0625 1.435811 8.444444 0
5 14.0625 15.25 1.435811 -0.90234 14.65625 0.239504 4.051173 1
8 iterations are needed to
6 14.65625 15.25 0.239504 -0.90234 14.95313 -0.33803 1.985371 1
7 14.65625 14.95313 0.239504 -0.33803 14.80469 -0.05094 1.002639 1
get the needed accuracy of
8 14.65625 14.80469 0.239504 -0.05094 14.73047 0.093859 0.503845 1 an error less than 1%
9 14.73047 14.80469 0.093859 -0.05094 14.76758 0.021353 0.25129 2
10 14.76758 14.80469 0.021353 -0.05094 14.78613 -0.01482 0.125487 2
Numerical Methods 36