Академический Документы
Профессиональный Документы
Культура Документы
P0 starting value
P1 = g(P0)
P2 = g(P1)
P3 = g(P2)
.
.
.
Pk = g(Pk-1)
Pk+1 = g(Pk)
Numerical Methods Module -
Petrochemical Department 3
Numerical Methods Module - Petrochemical Department 4
Introduction
Bisection Method:
• f(a) = 0
Introduction (cont.)
Example:
Function: f(x) = x2 - 4
Roots: x = -2, x = 2
Because:
f(-2) = (-2)2 - 4 = 4 - 4 = 0
f(2) = (2)2 - 4 = 4 - 4 = 0
A Mathematical Property
Well-known Mathematical Property:
Example:
Basis of Bisection Method
Theorem An equation f(x)=0, where f(x) is a real continuous function,
has at least one root between xl and xu if f(xl) f(xu) < 0.
f(x)
x
x
xu
Figure 1 At least one root exists between the two points if the function is
real, continuous, andNumerical
changes sign.
Methods Module -
Petrochemical Department 10
Basis of Bisection Method
f(x)
x x
xu
x xu
x x
x xu
Figure 3 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.
xu
x
x
f(x)
Figure 1
x
x
xu
x xu
xm =
2
x xm
x
xu
Figure 5 Estimate of xm
Numerical Methods Module -
Petrochemical Department 16
Step 3
Now check the following
a 100
m m
new
xm
where
xmold previous estimate of root
xmnew current estimate of root
Numerical Methods Module -
Petrochemical Department 18
Step 5
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.
Let εabs = 0.01 and start with the interval [1, 2].
c=
a b f(a) f(b) (a + b)/2
f(c) Update new b − a
1.0 2.0 - 2.0 1.0 1.5 - 0.75 a=c 0.5
1.5 2.0 - 0.75 1.0 1.75 0.062 b=c 0.25
1.5 1.75 - 0.75 0.0625 1.625 - 0.359 a=c 0.125
1.625 1.75 - 0.3594 0.0625 1.6875 - 0.1523 a=c 0.0625
1.6875 1.75 - 0.1523 0.0625 1.7188 - 0.0457 a=c 0.0313
1.7188 1.75 - 0.0457 0.0625 1.7344 0.0081 b=c 0.0156
1.71988
1.7344 - 0.0457 0.0081 1.7266 - 0.0189 a=c 0.0078
/td>
Thus, with the seventh iteration, we note that the final interval, [1.7266, 1.7344], has a
width less than 0.01 and |f(1.7344)| < 0.01, and therefore we chose b = 1.7344 to be our
approximation of the root
H.W.
2. Apply the bisection method to f(x) = sin(x) starting with [1, 99],
εabs = 0.00001, and comment.
Example
You are working for ‘MOMO COMPANY’ that makes floats
for ABC commodes. The floating ball has a radius of
0.055 cm. You are asked to find the depth to which the
ball is submerged when floating in water.
0 x 2R
0 x 20.055
0 x 0.11
Hence
f xl f xu f 0 f 0.11 3.993104 2.662104 0
So there is at least on root between x and xu, that is between 0 and 0.11
f xl f xm f 0 f 0.055 3.993104 6.655105 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.
f xl f xm f 0.055 f (0.0825) 1.622104 6.655105 0
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
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%.
f xl f xm f 0.055 f 0.06875 6.655105 5.563105 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
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.
Iteration x xu xm a % f(xm)
f x x 2
f x
f(x)
1
x
x