You are on page 1of 32

Bracketing Methods

ROOTS OF EQUATIONS
Bisection method

Bracketing Methods
False Position Method

Simple fixed point iteration

Roots of
Equations

Newton Raphson

Open Methods
System of Nonlinear
Equations

Secant
Modified Newton Raphson

Roots of polynomials
Muller Method

ROOTS OF EQUATIONS
Root of an equation: is the value of the equation variable which
make the equations = 0.0
2

b
4ac
2
ax bx c 0 x
2a

But

ax 5 bx 4 cx 3 dx 2 ex f 0 x ?
sin x x 0 x ?

ROOTS OF EQUATIONS
Non-computer methods:
- Closed form solution (not always available)
- Graphical solution (inaccurate)
Numerical
computers

systematic

methods

suitable

for

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
(1 e m )
The parachutist velocity is 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/s2


c

t
mg
f (c)
(1 e m ) v
c
667.38
f (c)
(1 e 0.146843c ) 40
c

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 even
number of roots

Odd number of roots

f(xl)=+ve

f(xl)=+ve

roots

roots
f(xu)=+ve

x
xl

xu

x
xl

xu

f(xu)=-ve

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)

Special
Cases

Effect of computer scale


resolution

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.

f(x)

Step 1: Choose lower xl and upper xu


guesses for the root such that:

xr = ( xl + xu )/2
f(xu)

f(xl).f(xu)<0
Step 2: The root estimate is:
xr = ( xl + xu )/2
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

xr1

xl

xu
f(xu)

f(xr1)
f(x)

(f(xl).f(xr)<0): xu = xr
xr = ( xl + xu )/2
f(xu)

f(xr2)
xl

xu

xr2

x
f(xu)

Bisection Method - Termination Criteria


Approximate relative Error :

True relaive Error :

et

X true X approximate
X true

100%

X rn X rn 1
ea
100%
n
Xr
Xu X l
ea
100% (Bisection)
Xu X l

For the Bisection Method ea > et


The computation is terminated when ea
becomes less than a certain criterion (ea < es)

Bisection method: Example


The parachutist velocity is

mg
v
(1 e
c

c
t
m

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/s2
f(c)
c
t
m

mg
f (c )
(1 e ) v
c
667.38
f (c )
(1 e 0.146843c ) 40
c
c

1.

Assume xl =12 and xu=16

f(x)

f(xl)=6.067 and f(xu)=-2.269


2.
3.

6.067

The root: xr=(xl+xu)/2= 14


1.569

Check f(12).f(14) = 6.0671.569=9.517 >0;


12

the root lies between 14 and 16.


4.

5.

Set xl = 14 and xu=16, thus the new root


xr=(14+ 16)/2= 15

f(x)

14

16

x
-2.269

(f(12).f(14)>0): xl = 14

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

and so on...

1.569

15

14
-0.425

x
16
-2.269

Bisection method: Example


In the previous example, if the stopping criterion is et =
0.5%; what is the root?
Iter.

1
2
3
4
5
6

Xl
Xu
12
16
14
16
14
15
14.5 15
14.75 15
14.74 14.875

Xr
14
15
14.5
14.75
14.875
14.813

ea%

e t%

5.279
6.667
3.448
1.695
0.84
0.422

-1.487
1.896
1.204
0.641
0.291

Bisection method

Flow Chart Bisection


Start

Input: xl , xu , es, maxi

False

f(xl). f(xu)<0

i=0
ea=1.1es

while
ea> es &
i <maxi

False
Print: xr , f(xr ) ,ea , i

xu x r
2
i i 1
xr

Stop

xu+xl =0

True

ea

xu x l
100%
xu x l

Test=f(xl). f(xr)

Test=0

True

ea=0.0

True
Test<0

xu=xr

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).
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 and
improved estimate of the root.

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 and
improved estimate of the
root.

False-position Method -Procedure


f(x)

f(xu)
xl
f(xl)

xr

xu

f(xr)

f ( xl )
f ( xu )

xr xl
xr xu
f ( xu )( xl xu )
xr xu
f ( xl ) f ( xu )

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 )
xr xu
f ( xl ) f ( xu )

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
The parachutist velocity is v
(1 e
c

c
t
m

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/s2
f(c)
c
t
m

mg
f (c)
(1 e ) v
c
667.38
f (c)
(1 e 0.146843c ) 40
c
c

False position method: Example


1.

f(x)

Assume xl = 12 and xu=16


6.067

f(xl)= 6.067 and f(xu)= -2.269

2.

The root: xr=14.9113


f(12) . f(14.9113) = -1.5426 < 0;

14.91

12

16

-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 , es, maxi

False

f(xl). f(xu)<0

i=0
ea=1.1es

while
ea> es &
i <maxi

False
Print: xr , f(xr ) ,ea , i

x r xu
i i 1

f (x u )(x l x u )
f (x l ) f (x u )

Stop

i=1
or
xr=0

True

ea

x r x r0
100%
xr

Test=f(xl). f(xr)

Test=0

True

ea=0.0

True

Test<0

xu=xr
xr0=xr

False
xl=xr
xr0=xr

False Position Method-Example 2

False Position Method - Example 2

Pitfalls of the False Position Method


Although a method such as false position is often superior to
bisection, there are some cases (when function has significant
curvature that violate this general conclusion.
In such cases, the approximate error might be misleading and
the results should always be checked by substituting the root
estimate into the original equation and determining whether
the result is close to zero.
major weakness of the false-position method: its one
sidedness That is, as iterations are proceeding, one of the
bracketing points will tend stay fixed which lead to poor
convergence.

Modified Fixed Position


One way to mitigate the "one-sided" nature of
false position is to make the algorithm detect
when one of the bounds is stuck. If this occur,
the function value at the stagnant bound is
divided in half. This is thought to fasten the
convergence.

You might also like