CH 05
CH 05
~Roots of Equations ~
Bracketing Methods
2a
•Algebraic functions : f n y n f n 1 y n 1 f1 y1 f 0 0
3
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The standard methods for locating roots typically fall
into two problems:
4
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Nonlinear Equation
Solvers for real roots
All Iterative
5
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bracketing Methods
xl xu xl xu
8
8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
xl xu
xl xu
9
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Cases where the general rule does not hold
10
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bisection Method
Step 1: Choose lower xl and upper xu guesses for the root such that the function
changes sign over the interval. This can be checked by ensuring that
f ( xl ) f ( xu ) 0
Step 2: An estimate of the root xr is determined by
x xu
xr l
2
Step 3: Make the following evaluations to determine in which subinterval
the root lies.
a) If f ( xl ) f ( xr ) 0 , the root lies in the lower subinterval. Therefore,
set xu=xr and return to step 2.
b) If f ( xl ) f ( xr ) 0 , the root lies in the upper subinterval. Therefore,
set xl=xr and return to step 2.
Terminate the computation when εa ≤ εs OR Max.Iteration is reached
xrnew xrold
Approximate relative error : a
xrnew
log( xu xl ) log s
n
log 2
12
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Approximate relative error for the ith iteration
( i 1)
xr xr xu xl
(i ) (i ) (i )
a (i )
a (i )
(i )
xu xl
(i ) (i )
xr
13
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 5.1: Determine the real root of f ( x) x 3 4 x 2 10
using bisection method in the interval [1,2]. Iterate until the
estimated error εa falls below a level of εs=0.01
Iter. no xl xu xr f(xr) εa
1 1 2 1.5 2.375 0.333333
2 1 1.5 1.25 -1.796875 0.2
3 1.25 1.5 1.375 0.162109 0.090909
4 1.25 1.375 1.3125 -0.848389 0.047619
5 1.3125 1.375 1.34375 -0.350983 0.023256
6 1.34375 1.375 1.359375 -0.096409 0.011494
7 1.359375 1.375 1.367188 0.032356 0.005714
14
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 5.2: Determine the real root of f ( x ) e x x
using bisection method in the interval [0,1]. Iterate until the
estimated error εa falls below a level of εs=0.01
Iter. no xl xu xr f(xr) εa
1 0 1 0.5 0.106531 1
2 0.5 1 0.75 -0.277633 0.333333
3 0.5 0.75 0.625 -0.089739 0.2
4 0.5 0.625 0.5625 0.007283 0.111111
5 0.5625 0.625 0.59375 -0.041498 0.052632
6 0.5625 0.59375 0.578125 -0.017176 0.027027
7 0.5625 0.578125 0.570313 -0.004964 0.013699
8 0.5625 0.570313 0.566406 0.001155 0.006897
15
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Evaluation of the Method
Advantages Disadvantages
• Easy • Slow
• Always finds root • Doesn’t work for multiple
• Number of iterations roots
required to attain an • No account is taken of f(xl)
absolute error can be and f(xu). If f(xl) is closer to
computed a priori. zero, it is likely that root is
closer to xl .
16
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The False-Position Method
Iter. no xl xu xr f(xr) εa
1 1 2 1.263158 -1.602274
2 1.263158 2 1.338828 -0.430365 0.05652
3 1.338828 2 1.358546 -0.110009 0.014514
4 1.358546 2 1.363547 -0.027762 0.003668
19
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 5.4: Determine the real root of f ( x) e x x
using false-position method in the interval [0,1]. Iterate until the
estimated error εa falls below a level of εs=0.01
Iter. no xl xu xr f(xr) εa
1 0 1 0.6127 -0.070814
2 0 0.6127 0.572181 -0.007888 0.070814
3 0 0.572181 0.567703 -0.000877 0.007888
20
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 5.5: Determine the real root of f ( x) x x1 / 3 2
Iter. no xl xu xr f(xr) εa
1 3.00000 4.00000 3.51734 -0.00346
2 3.51734 4.00000 3.52135 -0.00002 0.00114
21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Why this method?
•Faster
•Always converges for a
single root.
22
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bisection method vs. False Position Method
23
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bisection method vs. False Position Method
24
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Example 5.6: Use bisection and false position method to locate
the root of f ( x) x10 1 between 0 and 1.3
Results obtained by using bisection method
Iter. no xl xu xr εa
1 0 1.3 0.65
2 0.65 1.3 0.975 0.333
3 0.975 1.3 1.1375 0.143
4 0.975 1.1375 1.05625 0.077
5 0.975 1.05625 1.01563 0.004
Iter. no xl xu xr εa
1 0 1.3 0.0943
2 0.0943 1.3 0.18176 0.481
3 0.18176 1.3 0.26287 0.309
4 0.26287 1.3 0.33811 0.223
5 0.33811 1.3 0.40788 0.171
25
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.