Professional Documents
Culture Documents
CHAP 05e
CHAP 05e
Bracketing Methods
Chapter 5
• Easy
2
2 b b 4ac
ax bx c 0 x
2a
4
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bisection Method
xrnew xrold
Relative error estimate : new
100%
x r
for i=1:1:imax
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
How Many Iterations will It Take?
• Length of the first Interval Lo= xu- xl
• After 1 iteration L1=Lo/2
• After 2 iterations L2=Lo/4
….. …..
• After k iterations Lk=Lo/2k
Lk
error _ tolerance
xl
L0
k
xl * es
2
k L0 L0
2 k log 2
xl * es xl * es
7
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bisection Method
Pros Cons
• Easy • Slow
• Always finds a root • Need to find initial
• Number of iterations guesses for xl and xu
required to attain an • No account is taken
absolute error can be of the fact that if f(xl)
computed a priori. is closer to zero, it is
likely that root is
closer to xl .
8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
**here The False-Position Method (Regula-Falsi)
• We can approximate the
solution by doing a
linear interpolation
between f(xu) and f(xl)
xl f u xu f l
xr
fu fl
9
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The False-Position Method
Works well, but not always!
Here is a pitfall
Modified False-Position
One way to mitigate the “one-sided”
nature of the false position (i.e. the
pitfall case) is to have the algorithm
detect when one of the bounds is
stuck.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
**here How to find good initial guesses?
Problem:
if x is too small search is very time consuming
if x is too large could jump over two closely spaced roots
Ultimate solution:
Know the application and plot the function to see the location of the roots,
and pick xl and xu accordingly to start the iterations.
11
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.