Documente Academic
Documente Profesional
Documente Cultură
Methods
hg@2012 1
ROOTS OF EQUATIONS
Bisection method
Bracketing Methods
False Position Method
hg@2012
Muller Method 2
ROOTS OF EQUATIONS
b b 2
4ac
ax bx c 0 x
2
2a
• But
ax 5 bx 4 cx3 dx 2 ex f 0 x ?
sin x x 0 x ?
hg@2012 3
ROOTS OF EQUATIONS
• Non-computer methods:
- Closed form solution (not always available)
- Graphical solution (inaccurate)
hg@2012 4
Graphical Solution
f(x)
roots
x
f(x)=0 f(x)=0
c
mg t
f (c) (1 e ) v
m
c
667.38
f (c) (1 e 0.146843c ) 40
c
Check: f (14.75) = 0.059 ~ 0.0
v hg@2012
(c=14.75) = 40.06 ~ 40 m/s 6
Numerical Systematic Methods
I. Bracketing Methods
hg@2012 7
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.
hg@2012 8
Special
Cases
hg@2012 9
Effect of computer scale
resolution
hg@2012 10
Bracketing Methods
1. Bisection Method
• Generally, if f(x) is real and continuous in the interval xl to xu
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.
hg@2012 11
f(x)
Step 1: Choose lower xl and upper xu xr = ( xl + xu )/2
guesses for the root such that:
f(xu)
f(xl).f(xu)<0
Step 2: The root estimate is:
xr = ( xl + xu )/2 xl xr1 xu
x
f(xr1) f(xu)
Step 3: Subdivide the interval according to:
– If (f(xl).f(xr)<0) the root lies in the f(x)
(f(xl).f(xr)<0): xu = xr
lower subinterval; xu = xr and go to xr = ( xl + xu )/2
step 2. f(xu)
– If (f(xl).f(xr)>0) the root lies in the
f(xr2)
upper subinterval; xl = xr and go to
xl xu
step 2. x
xr2
f(xu)
– If (f(xl).f(xr)=0) the root is xr and stop
hg@2012 12
Bisection Method - Termination Criteria
• c reach a velocity of 40
What is the drag coefficient c needed to
f(c)
c
mg t
f (c ) (1 e ) v
m
c
667.38
f (c ) (1 e 0.146843c ) 40
c
c
hg@2012 14
f(x)
1. Assume xl =12 and xu=16
f(xl)=6.067 and f(xu)=-2.269
mg t
c 6.067
f (c) (1 e m ) v
c
2. The root: xr=(xl+xu)/2= 14 f (c)
667.38
(1 e 0.146843c ) 40
c
1.569
3. Check f(12).f(14) = 6.067•1.569=9.517 >0;
x
the root lies between 14 and 16. 12 14 16
-2.269
1.569
6. Set xl = 14 and xu=15, thus the new root 15
x
xr=(14+ 15)/2= 14.5 14 16
-0.425 -2.269
hg@2012 15
and so on…...
Bisection method: Example
• In the previous example, if the stopping criterion is et =
0.5%; what is the root?
Iter. Xl Xu Xr e a% e t%
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
Approximate relative Error :
n 1
True relaive Error :
X n
X
ea r r
�100% X true X approximat e
X rn et 16
100%
hg@2012
X true
Bisection method
hg@2012 17
Flow Chart –Bisection
Start
i=0
ea=1.1es
while False
ea> es &
i <maxi
Print: xr , f(xr ) ,ea , i
xu x r
xr
2
i i 1 hg@2012 Stop 18
xu+xl =0
True xu x l
ea 100%
xu x l
Test=f(xl). f(xr)
True
Test=0 ea=0.0
True
Test<0 xu=xr
False
xl=xr
hg@2012 19
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.
hg@2012 20
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.
hg@2012 21
False-position Method -Procedure
f(x)
f(xu)
xl xr xu
x
f(xl) f(xr)
f ( xl ) f ( xu )
x r xl x r xu
f ( xu )( xl xu )
x r xu
f ( xl ) f ( xu )
hg@2012 22
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 ( x u )( x l x u )
xr xu
f ( xl ) f ( xu )
hg@2012 24
False position method: Example
f(x)
1. Assume xl = 12 and xu=16
f(xl)= 6.067 and f(xu)= -2.269 6.067
f ( x u )( x l x u )
xr xu
2. The root: xr=14.9113 f ( xl ) f ( xu )
14.91
x
f(12) . f(14.9113) = -1.5426 < 0; 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%
hg@2012 25
False position method: Example
hg@2012 26
Flow Chart –False Position
Start
i=0
ea=1.1es
while False
ea> es &
i <maxi
Print: xr , f(xr ) ,ea , i
f (x u )(x l x u )
x r xu
f (x l ) f (x u )
i i 1 hg@2012
Stop 27
i=1
or
xr=0
True x r x r0
ea 100%
xr
Test=f(xl). f(xr)
True
Test=0 ea=0.0
True
Test<0 xu=xr
xr0=xr
False
xl=xr
xr0=xr
hg@2012 28
False Position Method-Example 2
hg@2012 29
False Position Method - Example 2
hg@2012 30
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.