Sunteți pe pagina 1din 20

MATH 012

Hybrid
Methods

Roots of Equations

Bracketing
Methods

Bisection method
False Position
Method
Simple fixed point
iteration

Roots of
Equations

Newton Raphson

Open Methods
System of
Nonlinear
Equations
Roots of
polynomials
Hybrid
Methods

Secant
Modified Newton
Raphson

Muller Method

Roots of Polynomials
The roots of polynomials such as

f n ( x) ao a1 x a2 x an x
2

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).
3

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


and bracketing methods, also the open methods could be
susceptible to divergence.

Special methods have been developed to find the


real and complex roots of polynomials Mller and
Bairstow methods.
4

Mller Method
Mllers method obtains a root estimate by
projecting a parabola to the x axis through three
Figure
function values.
7.3

Mller Method
The method consists of deriving the
coefficients of parabola that goes
through the three points:
1. Write the equation in a convenient
form:

f 2 ( x ) a ( x x 2 ) b ( x x2 ) c
2

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 x 2 ) 2 b ( x 2 x2 ) c

3. Three equations can be solved for three


unknowns, a, b, c. Since two of the terms in
the 3rd equation are zero,
2 it can be
f ( xo ) f ( x2 )solved
a ( xo for
x2 )c=f(x
b( x).
o x2 )
immediately
2

f ( x1 ) f ( x2 ) a ( x1 x2 ) 2 b( x1 x2 )
7

If
h o x1 - x o

h1 x 2 - x1

f ( x1 ) f ( xo )
f ( x2 ) f ( x1 )
o
1
x1 xo
x2 x1
(ho h1 )b (ho h1 ) 2 a ho o h11
h1b h a h11
2
1

1 o
a
h1 ho

Solved for
a and b

b ah1 1 c f ( x2 )

Roots can be found by applying an alternative form of quadratic


formula:

x3 x2

2c
b b 4ac
2

The error can be calculated as

x3 x2
a
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.
9

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.
2. If both real and complex roots are estimated,
employ a sequential approach just like in secant
method, x1, x2, and x3 to replace xo, x1, and x2.

10

Bairstows Method

Bairstows method is an iterative approach loosely


related to both Mller and Newton Raphson methods.
It is based on dividing a polynomial by a factor x-t:
f n ( x) ao a1 x a2 x 2 an x n
f n 1 ( x) b1 b2 x b3 x 2 bn x n
with a reminder R b o , the coefficien ts are
calculated by recurrence relationsh ip
bn an
bi a i bi 1t

i n 1 to 2
11

To permit the evaluation of complex roots, Bairstows


method divides the polynomial by a quadratic factor x2rx-s:

f n 2 ( x) b2 b3 x bn 1 x n 3 bn x n 2
R b1 ( x r ) bo
Using a simple recurrence relationsh ip
bn an
bn-1 an-1 rbn
bi ai rbi 1 sbi 2

i n-2 to 0

12

For the remainder to be zero, bo and b1 must be zero. However, it is unlikely


that our initial guesses at the values of r and s will lead to this result, a
systematic approach can be used to modify our guesses so that bo and b1
approach to zero.
Using a similar approach to Newton Raphson method, both bo and b1 can be
expanded as function of both r and s in Taylor series.

13

b1
b1
b1 (r r , s s ) b1
r
s
r
s
bo
bo
bo (r r , s s ) bo
r
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
estimated as
b1
b1
r
s b1
r
s
bo
bo
r
s bo
r
s
14

If partial derivatives of the bs can be determined,


then the two equations can be solved
simultaneously for the two unknowns r and b.
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 2
where
bo
bo b1
c1

c2
r
s r

b1
c3
s
15

Then

c2 r c3 s b1
c1r c2 s bo

Solved for r and s,


in turn are employed
to improve the initial
guesses.

At each step the error can be estimated as

a ,r

100%
r

a,s

100%
r
16

The values of the roots are determined by

r r 2 4s
x
2
At this point three possibilities exist:
1. The quotient is a third-order polynomial or greater. The
previous values of r and s serve as initial guesses and
Bairstows method is applied to the quotient to evaluate
new r and s values.
2. The quotient is quadratic. The remaining two roots are
evaluated directly, using the above eqn.
3. The quotient is a 1st order polynomial. The remaining
single root can be evaluated simply as x=-s/r.
Refer to Tables pt2.3 and pt2.4
17

MATLAB Function:
fzero
Bracketing methods reliable but slow
Open methods fast but possibly
unreliable
MATLAB fzero fast and reliable
fzero: find real root of an equation (not
suitable for double root!)

fzero(function, x0)
fzero(function, [x0 x1])

>> root=fzero('multi_func',-10)
fzero unable to find the double root of
root =
f(x) = x5 11x4 + 46x3 90x2 + 81x 27 = 0
2.99997215011186
>> root=fzero('multi_func',1000)
root =
2.99996892915965
>> root=fzero('multi_func',[-1000 1000])
root =
2.99998852581534
>> root=fzero('multi_func',[-2 2])
??? Error using ==> fzero
The function values at the interval endpoints must differ in sign.
>> root=multiple2('multi_func','multi_dfunc','multi_ddfunc');
enter initial guess: xguess = -1
allowable tolerance: es = 1.e-6
maximum number of iterations: maxit = 100
Newton method has converged
step
x
1 -1.00000000000000
2
1.54545454545455
3
1.34838709677419
4
1.12513231297383
5
1.01327476262380
6
1.00013392759869
7
1.00000001342083
8
1.00000001342083

f
-256.000000000000000
-0.915585746130091
-0.546825709009667
-0.103193137485462
-0.001381869252874
-0.000000143464007
0.000000000000000
0.000000000000000

df/dx
d2f/dx2
448.000000000000000 -608.000000000000000
-1.468752134417059
5.096919609316331
-2.145926990290406
1.190673693397343
-1.484223690473826
-8.078669685137726
-0.206108293568889 -15.056858096928863
-0.002142195919063 -15.990358504281403
-0.000000214733291 -15.999999033700192
-0.000000214733291 -15.999999033700192

fzero and optimset functions


>> options=optimset('display','iter');
>> [x fx]=fzero('manning',50,options)
Func-count
x
f(x)
1
50
-14569.8
2
48.5858
-14062
3
51.4142
-15078.3
4
48
-13851.9
5
52
-15289.1
...

...

18
19
20
21
22

27.3726
72.6274
18
82
4.74517

Procedure
initial
search
search
Search in both
search
directions x0 x
search

for sign change

...
-6587.13
-22769.2
-3457.1
-26192.5
319.67

search
search
search
search
search

Find sign change


after 22 iterations

Looking for a zero in the interval [4.7452, 82]


23
5.67666
110.575
24
6.16719
-5.33648
25
6.14461
0.0804104
26
6.14494 5.51498e-005
27
6.14494 -1.47793e-012
28
6.14494 3.41061e-013
29
6.14494 -5.68434e-013
Zero found in the interval: [4.7452, 82].
x =
6.14494463443476
fx =
3.410605131648481e-013
Switch

interpolation
interpolation
interpolation
interpolation
interpolation
interpolation
interpolation

to secant (linear) or inverse


quadratic interpolation to find root

S-ar putea să vă placă și