The Islamic University of Gaza
Faculty of Engineering
Civil Engineering Department
Numerical Analysis
ECIV 3306
Chapter 5
Bracketing Methods
PART II ROOTS OF EQUATIONS
Bisection method
Bracketing Methods
False Position
Method
Simple fixed point
Roots
iteration Newton
of
Open Methods
Equations
Raphson
System of Nonlinear
Equations
Secant
Roots of polynomials
Modified Newton Raphson
Muller Method
STUDY OBJECTIVES FOR PART TWO
• Understand the graphical interpretation of a root
• Know the graphical interpretation of the false-position
method and why it is usually superior to the bisection
method.
• Understand the difference between bracketing and
open methods for root location.
• Understand the concepts of convergence and divergence.
• Know why bracketing methods always converge,
whereas open
methods may sometimes diverge.
• Know the fundamental difference between the false-
position and secant methods and how it relates to
convergence
ROOTS OF EQUATIONS
• Root of an equation: is the value of the equation variable
which make the equations = 0.0
b ± b2 4ac
ax2
bx c 0 x 2
a
• But
ax5 bx4 cx3 dx2 ex f x?
0
sin x x 0 x ?
ROOTS OF EQUATIONS
• Non-computer methods:
- Closed form solution (not always available)
- Graphical solution (inaccurate)
• Numerical systematic methods suitable for
computers
Graphical Solution
• Plot the function f(x)
f(x)
roots
x
f(x)=0 f(x)=0
• The roots exist where f(x) crosses the x-axis.
Graphical Solution:
Example
c
t
mg
• The parachutist velocity v (1 e m )
is c
• What is the drag coefficient c needed to reach a velocity
of
40 m/s if m=68.1 kg, t =10 s, g= 9.8 m/s 2
f(c)
f (c) mg (1 mc t
e )v
c
f (c) c 66 7.38 c
(1 3c
) 40
0.14684
e
c=14.75 Check: F (14.75) = 0.059 ~ 0.0
v (c=14.75) = 40.06 ~ 40 m/s
Numerical Systematic Methods
I. Bracketing Methods
f(x f(x
No roots or Odd number of roots
) )
even number of
roots
f(xl)=+ve
f(xl)=+ve
roots
roots
f(xu)=+v
ex x
xl f(xu)=-ve
u
xl x
xu
Bracketing Methods (cont.)
• Two initial guesses (xl and xu) are required for
the root which bracket the root (s).
• If one root of a real and continuous function,
f(x)=0, is bounded by values xl , xu then f(xl).f(xu)
<0.
(The function changes sign on opposite sides of the root)
f -•-)
Bracketing Methods
1. Bisection Method
• Generally, if f(x) is real and continuous in the interval xl
to xu and f (xl).f(xu)<0, then there is at least one real root
between xl and xu to this function.
• The interval at which the function changes sign is
located. Then the interval is divided in half with the root
lies in the midpoint of the subinterval. This process is
repeated to obtained refined estimates.
gu ses for the root
Step 1: Choose lower xl and upper xu es such that:
f(xl).f(xu)<0 f(x)
Step 2: The root estimate is: xr = ( xl + xu )/2
xr = ( xl + xu )/2 f(xl )
Step 3: Subdivide the interval according
to: xl xr1 xu
x
– If (f(xl).f(xr)<0) the root lies in the
f(xr1) f(xu)
f(x) (f(x ).f(x )<0): x = x
l r u r
lower subinterval; xu = xr and xr = ( xl + xu )/2
go to step 2.
f(xu)
– If (f(xl).f(xr)>0) the root lies in
the upper subinterval; xl = xr f(xr2)
and go to step 2. xl xu
x
– If (f(xl).f(xr)=0) the root is xr and xr2
f(xu)
stop
Bisection Method - Termination Criteria
Approximate relative Error :
Tru relaiv Error :
e e
X nr X nr 1
t X true X approximate a nr
100%
X
Xtrue 100%
Xu Xl
100% (Bisection)
Xu Xl
a
• For the Bisection Method a > t
• The computation is terminated when a
becomes less than a certain criterion ( a < s)
Bisection method: Example
• The parachutist velocity c
is mg (1 e mt
)
v c
• What is the drag coefficient c needed to reach a velocity of 40
m/s if m = 68.1 kg, t = 10 s, g= 9.8 m/s 2
f(c)
mg
c
f (c) (1 t )v
ec m
f (c) 667.38
(1 e0.146843c ) 40
c c
1. Assume f(x)
xl =12 and =16
xu 6.067
f(xl)=6.067 and f(xu)=-2.269
2. The root: xr=(xl+xu)/2= 1.569
14 f(14)=1.569
12 14 16 -2.269
3. Check f(12).f(14) = 6.067× 1.569=9.517 >0;
x
the root lies between 14 and 16.
4. Set xl = 14 and xu=16, thus the new root
xr=(14+ 16)/2=
f(x) (f(12).f(14)>0): xl = 14
15 f(14)=-
0.425
5. Check f(14).f(15) = 1.569× -0.425= -0.666 <0;
the root lies bet. 14 and 15.
6. Set xl = 14 and xu=15, thus the new root
xr=(14+ 15)/2= 14.5 1.569
15
and so on…... 14 16
-0.425 -2.269 x
Bisection method: Example
• In the previous example, if the stopping criterion is t
= 0.5%; what is the root?
Iter. Xl X X a% t%
u r
1 12 16 14 ----- 5.279
2 14 16 15 6.667 1.487
3 14 15 14.5 3.448 1.896
4 14.5 15 14.75 1.695 1.204
5 14.75 15 14.875 0.84 0.641
6 14.74 14.875 14.813 0.422 0.291
Bisection method
Bracketing Methods
Example; Bisection
Use bisection method to find the root of
f (x) x 4x2 10
3
Continue the iterations until the approximate error falls
below a stopping criteria (s ) = 0.5%
Flow Chart –Bisection
Start
Input: xl , xu , s, maxi
False
f(xl). f(xu)<0
i=0
a=1.1s
while
a> s False
&i
<maxi
Print: xr , f(xr ) ,a , i
xl xu
x
r
2
ii1 Stop
xu+xl =0
True x u x l 100%
a
x ulx
Test=f(xl). f(xr)
Test= True a=0.0
0
Test< True xu=xr
0
False
xl=xr
Bracketing Methods
2. False-position Method
• The bisection method divides the interval xl to
xu in half not accounting for the magnitudes
of f(xl) and f(xu). For example if f(xl) is closer to
zero than f(xu), then it is more likely that the
root will be closer to f(xl).
2. False-position Method
• False position method is
an alternative approach
where f(xl) and f(xu) are
joined by a straight line;
the intersection of which
with the x-axis
represents an improved
estimate of the root.
False-position Method -Procedure
f(x)
f(xu)
xl xr xu
f(xl)
x
f(xr)
f ( xl ) f (xu )
xr xl xr xu
f (xu )( xl xu )
xx
r u
f (l x) f (x) u
False-position Method -Procedure
Step 1: Choose lower xl and upper xu guesses for
the root such that: f(xl).f(xu)<0
Step 2: The root estimate is:
f ( xu )( xl xu )
x
r x u
f (l x ) f ( x) u
Step 3: Subdivide the interval according to:
– If (f(xl).f(xr)<0) the root lies in the
lower subinterval; xu = xr and go to
step 2.
– If (f(xl).f(xr)>0) the root lies in the
upper subinterval; xl = xr and go to
step 2.
– If (f(xl).f(xr)=0) the root is xr and stop
False position method: Example
mg c
mt
• The parachutist velocity v (1 e )
is c
• What is the drag coefficient c needed to reach a
velocity of 40 m/s if m =68.1 kg, t =10 s, g= 9.8
m/s 2
f(c)
f (c) mg (1 mc t
e )v
c
f (c) c 66 7.38 c
(1 3c
) 40
0.14684
e
False position method: Example f(x)
1. Assume xl = 12 and xu=16
6.067
f(xl)= 6.067 and f(xu)=
-2.269
14.91
16 x
2. The root: xr=14.9113 12
f(12) . f(14.9113) = -1.5426 < 0; -2.269
3. The root lies bet. 12 and 14.9113.
4. Assume xl = 12 and xu=14.9113, f(xl)=6.067
and f(xu)=-0.2543
5. The new root xr= 14.7942
6. This has an approximate error of 0.79%
False position method: Example
Flow Chart –False Position
Start
Input: xl , x0 , s, maxi
False
f(xl). f(xu)<0
i=0
a=1.1s
while
a> s False
&i
<maxi
Print: xr , f(xr ) ,a , i
f (x u )(x l x u )
x x
f (xl ) f (x)
r u
u
ii1 Stop
i=1 or xr=0
True x r x r 0 100%
a
xr
Test=f(xl). f(xr)
True
Test=0 a=0.0
True
xu=xr xr0=xr
Test<0
False
xl=xr xr0=xr
False Position Method-Example
2
False Position Method - Example 2
Roots of Polynomials: Using
Software
Packages
MS Excel:Goal
seek
f(x)=x-cos x