Professional Documents
Culture Documents
6ech05 Part2
6ech05 Part2
Chapter 5
1
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Part 2
Roots of Equations
•Why?
b b 2
4ac
ax bx c 0 x
2
2a
•But
ax 5 bx 4 cx 3 dx 2 ex f 0 x ?
sin x x 0 x ?
2
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Nonlinear Equation
Solvers
All Iterative
3
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure PT2.1
4
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bracketing Methods
(Or, two point methods for finding roots)
Chapter 5
• Two initial guesses for the
root are required. These
guesses must “bracket” or
be on either side of the root.
5
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.2
6
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.3
7
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.4b
Figure 5.4a
Figure 5.4c
8
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The Bisection Method
For the arbitrary equation of one variable, f(x)=0
1. Pick xl and xu such that they bound the root of
interest, check if f(xl).f(xu) <0.
xl xu
• If f(xl). f[(xl+xu)/2]=0, then xl
2
root is (xl+xu)/2 and 100%
xl xu
terminate. 2
or
4. Compare es with ea xl xu
xu
2
100%
xl xu
5. If ea< es, stop. Otherwise
2
repeat the process.
10
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.6
11
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Evaluation of Method
Pros Cons
• Easy • Slow
• Always find root • Know a and b that
• Number of iterations bound root
required to attain an • Multiple roots
absolute error can be • No account is taken of
computed a priori. f(xl) and f(xu), if f(xl) is
closer to zero, it is likely
that root is closer to xl .
12
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
How Many Iterations will It Take?
• Length of the first Interval Lo=b-a
• After 1 iteration L1=Lo/2
• After 2 iterations L2=Lo/4
Lk
e a 100% ea es
x
13
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• If the absolute magnitude of the error is
es x 4
10
100%
and Lo=2, how many iterations will you
have to do to get the required accuracy in
the solution?
4 2
10 k 2 k 2 10 4 k 14.3 15
2
14
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The False-Position Method
• If a real root is
(Regula-Falsi)
bounded by xl and xu of
f(x)=0, then we can
approximate the
solution by doing a
linear interpolation
between the points [xl,
f(xl)] and [xu, f(xu)] to
find the xr value such
that l(xr)=0, l(x) is the
linear approximation
of f(x).
15
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Procedure
1. Find a pair of values of x, xl and xu such that
fl=f(xl) <0 and fu=f(xu) >0.
2. Estimate the value of the root from the
following formula (Refer to Box 5.1)
xl f u xu f l
xr
fu fl
and evaluate f(xr).
16
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
3. Use the new point to replace one of the
original points, keeping the two points on
opposite sides of the x axis.
18
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.