Beruflich Dokumente
Kultur Dokumente
METHODS FOR
ENGINEERS
COEB 223
PART II : ROOTS OF EQUATION
Introduction to Part 2:
Roots of equations
f n ( x ) = a0 + a1 x + a2 x 2 + ...an x n
Roots of Equations.:
The value of x which makes f(x)=0 are called roots or 'zeros of
the equation.
For quadratic equation roots can be found by a standard formula.
Other equations, it is difficult. Two types of problems would be
dealt with here.
1. Real roots of algebraic and transcendental equations
2. Complex roots of polynomials.
Methods for finding the roots:
1. Graphical Methods (Ch 5)
2. Bracketing Methods (Ch 5)
a) Bisection Method
b) False Position Method
(Regula Falsi)
Numerical methods
thods for engineers (COEB223): Part II
Handout 7
Chapter 5
5.1Graphical Methods
5.2 Bisection
5.3 False Position
f (c ) =
gm
1 e ( c m )t v
c
the value of 'c' which makes f(c) = 0 is the required value i.e. we
require the root of f(c).Substitute value,
f (c ) =
if c=4,
f (c ) =
9.8(68.1)
1 e ( c 68.1)10 40
c
9.8(68.1)
4 68.1)10
1 e (
40 = 34.115 ,
4
Numerical methods
thods for engineers (COEB223): Part II
9.8(68.1)
c 68.1)10
1 e (
40 from example 1.
c
Iteration
xl
xu
xr
fl
fr
f(xl)*f(xr) ea(%)
1
12
16
14
6.0669 1.5687 9.5172834
2
14
16
15
1.5687 -0.425 -0.666438 6.6667
3
14
15
14.5 1.5687 0.5523 0.8664426 3.4483
4
14.5
15
14.75 0.5523 0.059 0.0325668 1.6949
5
14.75
15
14.875 0.059 -0.184 -0.010856 0.8403
6
14.75 14.875 14.8125 0.059 -0.063 -0.003707 0.4219
note: f (c) =
et(%)
5.2787
1.4871
1.8958
0.2043
0.6414
0.2185
Numerical methods
thods for engineers (COEB223): Part II
Numerical methods
thods for engineers (COEB223): Part II
xu
fxl
fxu
xr
fr
f(xl)*f(xr)
ea(%)
et(%)
12
16
-1.54269
12
14.9113
12
14.7942
12
14.7817
-0.00188
-0.00031
0.887
0.009
10
0.0011
Solution: (a) A plot indicates that a single real root occurs at about x =
0.58.
8
4
0
-4
0.5
1.5
-8
(b) Bisection:
First iteration: x r =
0.5 + 1
= 0.75 a = 1 0.5 100% = 33.33%
2
1 + 0 .5
xl
0.500
00
xu
1.000
00
xr
0.750
00
f(xl)
f(xr)
f(xl)
f(
xr)
3.7(0.5 1)
= 0.64273
1.47813 3.7
11
iteration xl
xu
1
0.5 1.00000
2
3
4
f(xl)
f(xu)
xr
f(xr)
f(xl)
f(xr)
12
Numerical methods
thods for engineers (COEB223): Part II
Handout 8
Chapter 6
6.1 Simple Fixed-Point
Fixed Point Iteration
6.2 Newton-Raphson
Newton
6.3 Secant Methods
13
6. 0 Open Methods
Figure 6.1: Difference between (a) bracketing and (b),(c) open
methods for root location. (b) the method diverge, (c) the method
converge, depending on the initial guess.
14
Numerical methods
thods for engineers (COEB223): Part II
15
x 2
f ( xi +1 ) = f ( xi ) + f ( xi ) x + f ( xi )
+ O x 3
2!
The root is the value of x i +1 when f(x i +1 ) = 0
Rearranging,
i )( xi +1 xi )
0 = f(xi ) + f (x
xi +1 = xi
f ( xi )
f ( xi )
16
17
x i x i 1
f ( x i ) f ( x i 1 )
xi xi 1
xi +1 = xi f ( xi )
i = 1, 2,3,K
f ( xi ) f ( xi 1 )
f ( x i )
18
19
i
0
1
2
3
xi
3
3.1808
3.334
3.4425
(%)a
5.68
4.595
3.152
f ( xi )
x
=
x
i
(c) Newton-Raphson i +1
f ( xi )
i
0
1
2
3
xi
3
5.1333
4.26975
3.7929
(d) secant
i
0
1
2
3
xi-1
3
4
3.3265
3.4813
f(xi)
-3.2
48.0882
12.96
xi +1 = xi f ( xi )
f(xi-1)
f(xi)
1.5
55.6854
27.18
xi xi 1
f ( xi ) f ( xi 1 )
xi
4
a
41.5580%
20.14
12.57
i = 1, 2,3,K
f(xi)
a
20.25
4.44
2.93
20
Numerical methods
thods for engineers (COEB223): Part II
Handout 9
Chapter 7 : Roots of Polynomial
7.4 Mullers Method
21
f n ( x) = ao + a1 x + a2 x 2 + K + an x n
Follow these rules:
1.For an nth order equation, there are n real or complex roots.
2.If n is odd, there is at least one real root.
3.If complex root exist in conjugate pairs (that is, +i and -i),
where i=sqrt(-1).
Conventional Methods
The efficacy of bracketing and open methods depends on whether the
problem being solved involves complex roots. If only real roots exist,
these methods could be used. However,
Finding good initial guesses complicates both the open
22
2.The parabola should intersect the three points [xo, f(xo)], [x1,
f(x1)], [x2, f(x2)]. The coefficients of the polynomial can be
estimated by substituting three points to give
f ( xo ) = a( xo x2 ) 2 + b( xo x2 ) + c
f ( x1 ) = a ( x1 x2 ) 2 + b( x1 x2 ) + c
f ( x2 ) = a ( x2 x2 ) 2 + b( x2 x2 ) + c
23
o =
h1 = x 2 - x1
f ( x1 ) f ( xo )
f ( x2 ) f ( x1 )
1 =
x1 xo
x2 x1
a=
1 o
h1 + ho
b = ah1 + 1 c = f ( x2 )
2c
b b 2 4ac
a =
x3 x2
100%
x3
term yields two roots, the sign is chosen to agree with b. This
will result in a largest denominator, and will give root estimate
that is closest to x2.
Once x3 is determined, the process is repeated using the
following guidelines:
1.If only real roots are being located, choose the two original
points that are nearest the new root estimate, x3.
Dr. Hanim Salleh, Mechanical Engineering, UNITEN, 2007/2008
24
If f ( x ) = x x + 3 x 2
>> a=[1 -1 3 -2];
>> roots(a)
ans =
0.1424 + 1.6661i
0.1424 - 1.6661i
0.7152
see example 7.6 and 7.7
Example : Problem 7.3 (a) Use Muller method to determine
the positive real root:
f ( x) = x3 + x 2 3 x 5
A plot indicates a root at about x = 2.
60
40
20
0
-4
-2
-20 0
-40
25
f(1) = 6
9.375
h0 = 0.5
0 = 4.25
13.25 4.25
a=
=6
1 + 0.5
f(1.5) = 3.875
f(2.5) =
h1 = 1
1 = 13.25
2(9.375)
2
= 1.901244
a =
1.901244 2.5
100% = 31.49%
1.901244
x3
a
1.901244 31.4929%
1.919270 0.9392%
1.919639 0.0192%
1.919640 0.0000%
26
Numerical methods
thods for engineers (COEB223): Part II
Handout 10
Chapter 7 : Roots of Polynomial
7.5 Bairstow's Method
27
f n ( x) = ao + a1 x + a2 x 2 + K + an x n
f n 1 ( x) = b1 + b2 x + b3 x 2 + K + bn x n
with a reminder R = b o , the coefficients are
calculated by recurrence relationship
bn = an
bi =a i +bi +1t i = n 1 to 2
f n 2 ( x) = b2 + b3 x + K + bn 1 x n 3 + bn x n 2
R = b1 ( x r ) + bo
Using a simple recurrence relationship
bn = an
bn-1 = an-1 + rbn
bi = ai + rbi +1 + sbi + 2
i = n- 2 to 0
28
b1
b
r + 1 s
s
r
b
b
bo (r + r , s + s ) = bo + o r + o s
r
s
assuming that the initial guesses are adequately
close to the values of r and s at roots. The changes
in s and r needed to improve our guesses will be
b1 (r + r , s + s ) = b1 +
estimated as
b1
b
r + 1 s = b1
r
s
bo
b
r + o s = bo
r
s
If partial derivatives of the bs can be determined, then the two
equations can be solved simultaneously for the two unknowns r and
s .
Partial derivatives can be obtained by a synthetic division of the bs in
a similar fashion the bs themselves are derived:
cn = bn
cn 1 = bn 1 + rcn
ci = bi + rci +1 + sci + 2
i = n 2 to 1
where
bo
= c1
r
bo b1
=
= c2
s
r
b1
= c3
s
Then
c2 r + c3s = b1
c1r + c2 s = bo
Solved for
and
, in turn are
29
employed to improve the initial guesses.
a ,r =
r
100%
r
a,s =
s
100%
s
r r 2 + 4s
x=
2
x=
b2
b3
30
f ( x) = 2 + 6.2 x 4 x 2 + 0.7 x3
A plot suggests 3 real roots: 0.44, 2 and 3.3.
4
2
0
-2 0
-4
f ( x) = 2 + 6.2 x 4 x 2 + 0.7 x3
ao = 2
a1 = 6.2
a2 = 4
a3 = 0.7
1st iteration:
Try r = 1 and s = 1
b3 = a 3 =
b2 = a 2 + r b3 =
n=3, b1 = a 1 + r b 2 + s b 3 =
bo =
solve simultaneous eqn using calculator casio fx-570s:
a1 x + b1 y = c1
a2 x + b2 y = c2
31
r = 1.085
r = 2.085
s = 0.887
s = 0.1129
2nd iteration:
r = 0.4019
r = 2.487
s = 0.5565
s = 0.6694
3rd iteration:
r = 0.0605 s = 0.2064
r = 2.426
s = 0.8758
4th iteration:
r = 0.00927 s = 0.00432
r = 2.436
s = 0.8714
root 1 =
root 2 =
=2
= 0.4357
32