Sie sind auf Seite 1von 25

TOPIC 1

ROOTS OF
EQUATIONS

1
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
~ Problems are concerned
with the value of variable or
a parameter that satisfies a
single nonlinear equation.

~ Valuable in engineering
design contexts where it is
often impossible to
explicitly solve design
equations for
parameters
2

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Learning Outcomes
• Students should be able to:

i) Identify types of equations & various


numerical methods to find the roots of
equations (CO1-PO2)
ii) Apply the methods and solve
engineering and mathematical problems,
apply stopping criterion to terminate
iterations (CO1-PO2, CO2-PO5, CO2-PO4)
3
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Roots of Equations
Part 2
(Chapters 5 & 6)

•Why?
b  b 2 4ac
ax 2 bx c 0 x
2a

•But
ax5 bx4 cx 3 dx2 ex f 0 x ?
sin x x 0 x ?

Chapter 5 4
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Nonlinear Equation
Solvers

Bracketing Graphical Open Methods

Bisection Newton Raphson


False Position
(Regula-Falsi) Secant

All Iterative
5
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure PT2.1

Chapter 5 6
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Bracketing Methods
(Or, two point methods for finding roots)

• Two initial guesses for the


root are required. These
guesses must “bracket” or
be on either side of the root.

== > Fig. 5.1

• If one root of a real and


continuous function, f(x)=0,
is bounded by values x=xl, x
=xu then
f(xl) . f(xu) <0.
(The function changes sign on opposite
sides of the root)
Chapter 5 7
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.2 Figure 5.3
Chapter 5 8
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.4a Figure 5.4b

Figure 5.4c 9
Copyright © 2006 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. Choose guesses ; lower xl and upper xu such
that they bound the root of interest by checking
f(xl).f(xu) <0.

2. Estimate the root by evaluating xr = (xl+xu)/2,


then find: f(xr).
3. Find the pair
• If [f(xl). f(xr)]<0, root lies in the lower interval, then
xu= xr, and go to step 2.
10
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• If [f(xl). f[(xr]>0, root lies
in the upper interval, then TERMINATION
xl = xr, go to step 2. CRITERIA

• If [f(xl). f(xr)]=0, then root


is xr and terminate.
xrnew xrold
a new
100%
x r
4. Compare s with a or t or
xrtrue xapprox
100%
5. If a< s, stop. Otherwise t
x true
r
repeat the process.

Chapter 5 11
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 5.6

Chapter 5 12
Copyright © 2006 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
computed a priori. of f(xl) and f(xu), if f(xl)
is closer to zero, it is
likely that root is
closer to xl .

Chapter 5 13
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=b-a


• After 1 iteration L1=Lo/2
• After 2 iterations L2=Lo/4

• After k iterations Lk=Lo/2k

Lk
a 100% a s
x
Chapter 5 14
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• If the absolute magnitude of the error is
xs 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 2k 2 104 k 14.3 15
2k

Chapter 5 15
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
The False-Position Method
(Regula-Falsi)
If a real root is bounded
by xl and xu of f(x)=0,
approximate the
solution by doing
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).

== > Fig. 5.12

Chapter 5 16
Copyright © 2006 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)

f ( xu ) ( xl xu )
xr xu
f ( xl ) f ( xu )
and evaluate f(xr).

Chapter 5 17
Copyright © 2006 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.
(Similar as in Bi-section method)

• If [f(xl). f(xr)] < 0, root lies in the lower sub-


interval, then set new xu = xr, go to step 2.
• If [f (xl). f (xr)] > 0, root lies in the upper sub-
interval, then set new xl = xr, go to step 2.
• If [f(xl). f (xr)] = 0, then root is xr and
terminate.
18
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
4. See if the new xl and xu are close enough for
convergence to be declared. If they are not,
go back to step 2.

• Why this method?


– Faster
– Always converges for a single root.

Chapter 5 19
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Problem 5.1
Determine the real roots of f(x) = -0.6x^2 + 2.4 x + 5.5

a) Using Graphical Plot

x f(x)
0 5.5000
f(x)
10.0000
1 7.3000
2 7.9000 0.0000
3 7.3000 0 2 4 6 8 10
-10.0000 f(x)
4 5.5000
5 2.5000 -20.0000

6 -1.7000 -30.0000
7 -7.1000
8 -13.7000
9 -21.5000 The root is between 5.0 and 6.0
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
b) Using Quadratic Equation
2
2 b  b 4ac
ax bx c 0 x
2a

x = (-2.4 + SQRT (2.4^2 -( 4*(-0.6)*5.5))) / (2*-0.6)

x= -1.63 This is not shown in the graph, unless the scale starts at < 0)
and x = 5.63

21
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
c) Using Bisection Method
Using 3 iterations of the bisection method to detemine the highest root.
Employ initial guesses of xl = 5 and xu = 10,

Compute estimated error ea and the true error et after each iteration.

Solution :
xl = 5 xu = 10
xr = (xl+xu)/2,
f(x) = -0.6x2 + 2.4 x + 5.5
1st iteration
xr = (5 + 10) / 2 = 7.5

Check:
f(xl) = -0.6*(5^2) + (2.4*5) + 5.5 = 2.50
f(xr) = -0.6*(7.5^2) + (2.4*7.5) + 5.5 = -10.25
f(xl) *f(xr) = -25.63( < 0)

Therefore : xu = xr (in the next iteration) 22


Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
xrnew xrold
a new
100%
x r

a = 100% at first iteration


xrtrue xapprox 5.63 7.5
t true
100% 100% 33.2 %
x r
5.63

t is
obtain from Quadratic equation
(or from actual maths. procedure)
2nd Iteration
Xl = 5, Xu = Xr = 7.5

Xr = (5 + 7.5)/2 = 6.25
f(5) = 2.5, f(6.25) = -2.9375 Repeat the process
f(xl) * f(xr) < 0
Therefore, Xu’ = Xr = 6.25
23
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
6.25 7.5 5.63 6.25
a 100% 20.0 % t 100% 11.01%
6.25 5.63

3rd Iteration:
New Xl = 5.0, Xu = 6.25
:
Repeat the process
:
Iteration
No. Xl Xu Xr f(xl) f(xr) (fxl).f(xr) CHECK Ea (%) Et (%)
TABULATION
1 5 10 7.5000 2.5000 -10.2500 -25.6250 Xu = Xr 33.21
2 5.000 7.5000 6.2500 2.5000 -2.9375 -7.3438 Xu = Xr 20.00 11.01
3 5.000 6.2500 5.6250 2.5000 0.0156 0.0391 Xl = Xr 11.11 0.09
24
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Exercises

• Do Problems 5.2, 5.7, 5.11, 5.20,


5.22 (Text book, 6th Edition)

25
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Das könnte Ihnen auch gefallen