Professional Documents
Culture Documents
Skf2133-Chapter3na 2
Skf2133-Chapter3na 2
Saharudin Haron
Page 3 - 1
Roots of Equations
Definitions:
Root of an equation can be defined as the value of x that makes f(x) = 0
or can be called as the zeros of the equation.
The quadratic formula normally used to calculate the roots of equation
f(x) = ax2 + bx +c = 0,
b b 2 4ac
x=
2a
cannot solve the root for many other equations, such as,
f(x) =
e-x
f (c) =
gm
1 e ( c / m ) t v
c
Page 3 - 2
Bracketing Method
Called bracketing method because two initial guesses
for the root are required
The name implies that the guesses bracketing the root
There are two types of bracketing method
Bisection Method
False Position Algorithm
The difference of both method lies through their
strategies to systematically reduce the width of the
bracket
Page 3 - 3
f(x)
One root
No roots
x
f(x)
x
f(x)
Odd # of root
Even # of roots
x
xu
xl
f(xl ) and f(xu ) having same sign
x
xl
xu
x
f(x)
Multiple roots occur when the function
tangential to the x axis - having even # of roots
x
xl
xu
Bisection Method
Requirements:
f(x) is real and continuos in the interval of xl and xu
f(xl ) and f(xu ) having opposite sign that is f(xl ) f(xu ) < 0
This method is also known as
Binary chopping
Interval halving
Bolzanos method
Characteristic
incremental search method in which the interval is divided in half
if a function changes sign over an interval, the function value at
midpoint is evaluated
Page 3 - 6
xl + xu
2
3. Make the following evaluations
z If f(xl ) f(xr ) < 0, the roots lies in the lower subinterval. Set xu = xr
Return to step 2
z If f(xl ) f(xr ) > 0, the roots lies in the upper subinterval. Set xl = xr
Return to step 2
z If f(xl ) f(xr ) = 0, the roots equals xr : Terminate the computations
xr =
Page 3 - 7
x rnew x old
r
a =
100%
new
xr
The true relative error t can be calculated as
x rtrue x estimate
r
t =
100%
true
xr
When |a | become less than prespecified stopping criterion s the
computation is terminated
Page 3 - 8
Page 3 - 9
False-Position Method
Exploits graphical insight to join the points by a straight line
The intersection of this line with the x axis represents an improved
estimate of the root.
The replacement of the curve with
f(x)
f(xu)
straight line give a false position
for the roots
xr
The intersection of the straight line
with the x axis can be estimated as
xl
f ( xl )
f ( xu )
=
x r xl x r xu
x
xu
f ( xu )(xl xu )
f(xl)
xr = xu
f (xl ) f (xu )
Page 3 - 10
Parachute Problem
Use the bisection method and the false position method to determine
the drag coefficient c needed for a parachutist of mass m = 68.1 kg to
have a velocity of 40 m/s after free falling for time t = 10 s. Note the
acceleration due to gravity is 9.8 m/s2. This problem can be solved by
using cl = 12 and cu = 16 and s = 0.5%. True value = 14.78024.
Equation needed to solve the problem
f (c) =
9.8(68.1)
(1 e (c / 68.1)10 ) 40
c
f (c) =
667.38
(1 e 0.147 c ) 40
c
Page 3 - 12
Results
Bisection Algorithm Results
Iter
cl
cu
cr
a(%)
t(%)
Iter
cl
cu
cr
1
2
3
4
5
6
12.00
14.00
14.00
14.50
14.75
14.75
16.000
16.000
15.000
15.000
15.000
14.875
14.0000
15.0000
14.5000
14.7500
14.8750
14.8125
6.667
3.448
1.695
0.840
0.422
5.279
1.487
1.896
0.205
0.641
0.218
a(%)
t(%)
0.792
0.085
0.887
0.094
0.010
Page 3 - 13
Solution
After ten iteration, the true error only reduced to about 31 %.
Note that | a | < | t | thus the approximate is misleading
Insight to this problem can be examined by plotting the function
Page 3 - 14
Results
Bisection Algorithm Results
Example 5.7 with
Iter
xl
1 0.00
2 0.65
3 0.98
4 0.98
5 0.98
6 0.98
7 1.00
xu
1.300
1.300
1.300
1.138
1.056
1.016
1.016
= 2%
xr
0.6500
0.9750
1.1375
1.0563
1.0156
0.9953
1.0055
a(%)
33.333
14.286
7.692
4.000
2.041
1.010
t(%)
35.000
2.500
13.750
5.625
1.562
0.469
0.547
Iter
1
2
3
4
5
6
7
8
9
10
xl
0.00
0.09
0.18
0.26
0.34
0.41
0.47
0.53
0.59
0.64
xu
1.300
1.300
1.300
1.300
1.300
1.300
1.300
1.300
1.300
1.300
= 2%
s
xr
0.0943
0.1818
0.2629
0.3381
0.4079
0.4726
0.5326
0.5881
0.6395
0.6869
a(%)
t(%)
48.118
30.857
22.251
17.106
13.692
11.264
9.449
8.037
6.900
90.570
81.824
73.713
66.189
59.212
52.742
46.743
41.186
36.046
31.306
Page 3 - 15
1.0
Page 3 - 16
Bracketing Method
(assignment in class)
The velocity v of falling parachutist is given by,
v(t ) =
gm
1 e ( c / m ) t
c
where
g = 9.8 m/s2
c = 14 kg/s
Page 3 - 17
Open Method
Bracketing method requires root to be located between the upper and
lower bound.
Repeated application always result in closer estimates of the true value of
the root
Such method are normally called convergent, because they move closer to
the real roots
In contrast Open Method requires one to have a formula
Requires one or two starting value but not necessarily bracket the root
Sometimes diverge or move away after several computations
However when it converges it will be faster than bracketing method
Page 3 - 18
(A)
f(x)
f(x)
xi
xi
xi+1
xi+1
Page 3 - 19
transform into
x2 + 3
x=
2
sin x = 0
transform into
x = sin x + x
e-x - x = 0
transform into
x = e-x
Given an initial guess at the root xi the above equation can be used to
estimate x i+1
The iterative formula will be
x i+1 = g (xi )
Page 3 - 20
Convergence of Simple
Point Iteration
f(x)
f(x) = ex - x
x
Since we have two equal equations as
f1(x) = g(x)
The two function can be drawn separately
and the intersection of these function
represent the roots of f(x) = 0
f(x)
f1(x) =x
g(x) = ex
x
Page 3 - 21
xi+1 = g(xi)
4) Calculate a from :
a =
xi +1 xi
100 %
xi +1
Page 3 - 23
f(x)
Slope = f( xi )
f(xi )
f(xi ) - 0
0
xi+1
xi
xi - xi+1
Page 3 - 24
f ( xi )
xi +1 = x i
f ( x i )
4) Calculate a from :
a =
xi +1 xi
100 %
xi +1
Secant Method
Potential problem with Newton Raphson is to evaluate the derivative
For this case the derivative can be estimated by using backward finite
divided difference
f (xi 1 ) f ( xi )
f(x)
f ( x i )
x i1 x i
f(xi )
xi +1 = x i
f(xi-1 )
0
xi+1 xi-1
xi
f ( xi )
f ( x i )
f ( xi )(x i1 x i )
xi +1 = x i
f (xi 1 ) f ( xi )
The method requires two initial guesses
Page 3 - 26
a =
xi +1 xi
100 %
xi +1
Open Method
(assignment in class)
The concentration rate of a toxic agent discharged into a river can be
approximated by the following mathematical model,
dc
V dt = W-Qc-kV c
where
V = 1 x 106 m3
Q = 1 x 105 m3/yr
W = 1 x 106 g/yr
k = 0.2 g0.5/m1.5yr