Professional Documents
Culture Documents
Roots: Bracketing Methods: Berlin Chen
Roots: Bracketing Methods: Berlin Chen
Berlin Chen
Department of Computer Science & Information Engineering
National Taiwan Normal University
Reference:
1. Applied Numerical Methods with MATLAB for Engineers, Chapter 5 & Teaching material
Chapter Objectives (1/2)
b b 2 4ac
ax bx c 0
2
x
2a
ax 5 bx 4 cx 3 dx 2 ex f 0 x ?
sin x x 0 x ?
NM – Berlin Chen 2
Chapter Objectives (2/2)
NM – Berlin Chen 3
Roots
gm gcd
v t tanh t
cd m
gm gcd
f m tanh t v t
cd m
NM – Berlin Chen 4
Taxonomy of Root-finding Methods
Nonlinear Equation
Solvers
Chapter 5
Chapter 5 Chapter 6
– We can also employ a hybrid approach (Bracketing + Open Methods)
NM – Berlin Chen 5
Graphical Methods (1/2)
• A simple method for obtaining the estimate of the root
of the equation f(x)=0 is to make a plot of the function
and observe where it crosses the x-axis
gm gcd
f m tanh 4 36
cd m
NM – Berlin Chen 6
Graphical Methods (1/2)
NM – Berlin Chen 9
Bisection
• The bisection method is a f m
gm
tanh
gcd
t v t
m
variation of the incremental cd
where t 4, v t 36
search method in which the
interval is always divided in
half
• If a function changes sign over 142.7376
an interval, the function value
at the midpoint is evaluated
• The location of the root is then
determined as lying within the
subinterval where the sign
change occurs
• The absolute error is reduced
by a factor of 2 for each
iteration NM – Berlin Chen 10
Bisection: An Example
[First iteration]
50 200
xr 125
2
142.7376 125
εt 100% 12.43%
142.7376
f 50 f 125 -4.579 (-0.409) 1.871
the new low bound will be 125
[Second iteration]
125 200
xr 162.5
2
142.7376 162.5
εt 100% 13.85%
142.7376
f 125 f 162.5 -0.409 (0.359) -0.147
the new upper bound will be 162.5
[Third iteration]
125 162.5
xr 143.75
2
142.7376 143.75
εt 100% 0.709%
142.7376
NM – Berlin Chen 11
Programming Bisection
NM – Berlin Chen 12
Error Estimate
x rnew x rold
εa 100%
x rnew
NM – Berlin Chen 13
Errors of Bisection (1/2)
gm gcd
f m tanh t v t
cd m
where t 4, v t 36
true root
– The true ( εt ) and approximate ( εa ) errors are far apart when the
interval happen to be centered on the true root. They are close
when the true root falls at either end of the interval
NM – Berlin Chen 14
Bisection Errors (2/2)
• The absolute error of the bisection method is solely
dependent on the absolute error at the start of the
process (the space between the two guesses) and the
number of iterations:
n x 0
Ea n where x 0 x u0 x 0l
2
• The required number of iterations to obtain a particular
absolute error can be calculated based on the initial
guesses:
x 0
n log 2 where Ea ,d is the desired error
E a ,d
• The neatness of the error analysis of the bisection
method is a positive feature that makes it attractive for
many applications NM – Berlin Chen 15
False Position
f (x u )(x l x u )
xr xu
f (x l ) f (x u )
NM – Berlin Chen 16
False Position: An Illustration
f (x u )(x l x u )
xr xu
f (x l ) f (x u )
f x l f x u 0 f x u
xl xu x r xu
f xl f xu
x r xu f xu
xl xu
f xu xl xu
x r xu
f xl f xu
Implication from the plot
If f(xl) is much closer to zero than f(xu),
then the root should be much closer
to xl than xu? (not always the truth)
NM – Berlin Chen 17
Bisection vs. False Position
NM – Berlin Chen 18
Discussions
NM – Berlin Chen 19