21
Roots of Polynomials: Müller’s Method Bairstow’s Method Packages and Libraries CHAPTER 3: ROOT FINDING-b

Es272 ch3b

Embed Size (px)

Citation preview

Page 1: Es272 ch3b

– Roots of Polynomials:– Müller’s Method– Bairstow’s Method

– Packages and Libraries

CHAPTER 3: ROOT FINDING-b

Page 2: Es272 ch3b

Roots of Polynomials:

nnn xaxaxaaxf ...)( 2

210

An order-n polynomial

The roots of the polynomial follow these rules:> For nth-order polynomial there are n real/complex roots.> The roots are not necessarily distinct.> If n is odd, there is at least one real root.> If complex roots exist they are in conjugate pairs (a±bi).

Computing with Polynomials:Consider a 3rd order polynomial:

012

23

33 )( axaxaxaxf (Open form; 6 multiplications + 3 additions)

01233 ))(()( axaxaxaxf (Nested form; 3 multiplications + 3 additions)

Nested form is preferred as it requires fewer operations: > Lower cost of computation. > Lower round-off errors.

Page 3: Es272 ch3b

Polynomial deflation:Once you computed a root of a polynomial, you need to remove

this root from the polynomial before proceeding to the next root (so as not to trap at the same root again).

This process is done by a process called polynomial deflation.Consider a third order polynomial. This polynomail can always be

written as

where r1, r2 and r3 are the roots. To remove the root x=r1, divide

the polynomail by (x-r1). The remaining polynomial will be a second order polynomial:

The remainder of this divison will be zero (R=0) since you divide by its root. If it was not a root, R=consant (a 0th order polynomial).

))()(()( 3213 rxrxrxxf (factored form)

))(()( 322 rxrxxf

Page 4: Es272 ch3b

In general, if an n-th order polyomial (dividend) is divided by an m-th order polynomail (divisor), the resulting polynomial (quotient) is an (n-m)th order polynomail. The reminder will be an (m-1)th order polynomial.

In computer the polynomial deflation is done by a process called synthetic divison.

nn ab tbab iii 1 for 01 toni

Synthetic division by a linear factor (x-t):

0.. aan : coefficients of the dividend

1.. bbn : coefficients of the quotient

0b : coefficient of the reminder

4xdividend divisor

quotientReminder (R)

2422 xx

6x0

For example above: a1=1, a2=2, a3=-24, t=4 > b2=1, b1=6, b0=0

Page 5: Es272 ch3b

Synthetic division by a quadratic factor (x2-rx-s):

nn ab

nnn rbab 11

21 iiii sbrbab for 02 toni

Synthetic division is subject to round-off errors. To minimize this effect some strategies are used:

> root polishing: use root estimates as initial guess for successive estimates.

> start from the root with smallest absolute value.

0.. aan : coefficients of the dividend

2.. bbn : coefficients of the quotient

01,bb : coefficients of the reminder

322 xxdividend divisor

quotientReminder (R)

2422 34 xxx

32 x

96 x

Page 6: Es272 ch3b

Conventional methods for finding roots of polynomials:Generally speaking, previously mentioned bracketing and open

methods can be used for finding the real roots of polynomials. However,

> Bracketing methods are difficult for finding good initial guesses. > Open methods are problematic due to divergence problems.Special methods have been developed to locate both real and

complex roots of polynomials. Two conventional methods: - Müller’s method: Fitting a parabola to the function - Bairstow’s method: Dividing the polynomial by a guess factorThere are other methods too,e.g.: - Jenkins-Traub method - Laguerre’s method - ...Plenty of software library is available for locating roots of

polynomials.

Page 7: Es272 ch3b

Müller’s MethodThis method is similar to Secant method. The difference is that

instead of drawing a straight line for two initial guesses, a parabola is drawn with three initial guesses.

rx

0x1x

Secant

1x 0x2x

Müller

rx

Parabolic fit function facilitates finding both real and complex roots.Define the parabola as

cxxbxxaxf )()()( 22

22

We need to find the coefficients (a,b,c) such that the parabola passes from three initial guesses: [x0, f(x0)] , [x1, f(x1)] , [x2, f(x2)] .

two initial guesses three initial guesses

Page 8: Es272 ch3b

cxxbxxaxf )()()( 202

200

cxxbxxaxf )()()( 212

211

cxxbxxaxf )()()( 222

222

We get these three equations with there unknowns (a,b,c):

From the third equation => cxf )( 2

Then, we get two equations with two unknowns:

)()()()( 202

2020 xxbxxaxfxf

)()()()( 212

2121 xxbxxaxfxf Define

010 xxh 121 xxh 01

010

)()(

xx

xfxf

12

121

)()(

xx

xfxf

Then1100

21010 )()( hhahhbhh

112

11 hahbh

Page 9: Es272 ch3b

The coefficients a,b,c are determined as

01

01

hha

11 ahb

)( 2xfc

010 xxh 121 xxh

01

010

)()(

xx

xfxf

12

121

)()(

xx

xfxf

To calculate the root, calculate the point where the parabola intersects the x-axis, i.e. . Then, the roots (xr) are

acbb

cxxr

4

222

acbb

cxxr

4

222

(both real and complex roots are facilitated.)

0)( xf

(alternative formula for roots of quadratic polyn.)

Page 10: Es272 ch3b

Root is estimated iteratively (i.e., xrx3) Error can be defined as the difference between the current (x3)

and the previous (x2) solution:

%1001

4

2%100

32

3

23

xacbb

c

x

xxa

A problem arises as which of the two estimated roots (xr) will be used for the next iteration.

> choose the one that makes the error smaller.Once x3 is determined the process is repeated. For the three

points of the next iteration, suggested strategy: > choose other two points that are nearest to the estimated root

(If estimated roots are real). > just follow the method sequentially, i.e., drop x0, and take x1 , x2

, x3 (if a complex root is located).Once a root is located, it is removed from the polynomial, and

the same procedure is applied to locate other roots.

Page 11: Es272 ch3b

EX: Use Muller’s method to determine a root of the equation

With initial guesses x0=4.5 , x1=5.5 , x2=5.0.

First iteration:

Then,

1213)( 3 xxxf

625.20)5.4( f 875.82)5.5( f 48)5( f

5.45.50 h 5.551 h

25.625.45.5

625.20875.820

75.695.55

875.82481

1515.0

25.6275.69

a 25.6275.69)5.0(15 b 48c

Page 12: Es272 ch3b

To determine the estimated root:

since

The estimated root is:

Error:

For the next iteration, assign new guesses (sequential replacement):

x0=5.5 x1=5 x2=3.976

54.3148)15(425.624 22 acb

54.3125.6254.3125.62

976.354.3125.62

)48(253

x

%74.25%100976.3

5976.3

a

i Xr a(%)

0 5

1 3.976 25.74

2 4.001 0.6139

3 4 0.0262

4 4 < 10-5

method rapidly converges to the root xr=4.

Page 13: Es272 ch3b

Bairstow’s MethodWe know that dividing a polynomial by its root result in a

reminder of zero. If the divisor is not a root then the reminder will not be zero.

The basic approach of Bairstow’s method is starting a guess value for root and dividing the polynomial by this value. Then the estimated root is changed until the reminder of the division get sufficiently small.

Consider the polynomial:n

nn xaxaxaaxf ...)( 2210

If you divide the polynomial by its factor (x-t), you get a new polynomial of the form

123211 ...)(

nnn xbxbxbbxf and a reminder 0bR

Page 14: Es272 ch3b

This process can be done by using synthetic division:

nn ab tbab iii 1 for 01 toni

In order to facilitate the complex root Bairstow’s method divides the polynomial by a quadratic factor: (x2-rx-s). Then the result will be in the form of

231322 ...)(

nn

nnn xbxbxbbxf

with a reminder 01 )( brxbR

The process can be done by synthetic division by a quadratic factor:nn ab

nnn rbab 11

21 iiii sbrbab for 02 toni Then, the problem is to find (r,s) values that make the reminder

term zero (i.e. b1=b0=0).

Page 15: Es272 ch3b

We need a systematic way to modify (r,s) values to reach the correct root. In order to this, we use an approach that is similar to Newton-Raphson method.

Consider ing b0 and b1 are both functions of (r,s), and expand them using Taylor series:

ss

br

r

bbssrrb

1111 ),(

ss

br

r

bbssrrb

0000 ),(

(no higher order terms)

We force b0 and b1 to be zero to reach the root; then we get

111 bss

br

r

b

000 bss

br

r

b

Need to solve these two equations for two unknowns: r and s

Page 16: Es272 ch3b

We previously applied synthetic division to derive values of “b” from values of ”a”. Bairstow showed that we can evaluate values of “c” from values of “b” in a way similar to synthetic division:

nn bc

nnn rcbc 11

21 iiii scrcbc for 12 toni

r

bc

01 s

b

r

bc

012 s

bc

13

Then, we have the following simultaneous equations:

132 bscrc

021 bscrc

Once r and s are calculated using the simultaneous equations, Then, for the next iteration (r,s) values are improved as:

rrr sss

Define

Page 17: Es272 ch3b

Error at each iteration can be calculated for r and s seperately:

%100, r

rra

%100, s

ssa

and

When both values fall below a stopping criterion, the roots can be determined as the roots of :

2

42

2,1

srrx

srxx 2

Both real and complex roots are obtained. Once the roots are located, these roots are removed, and the

same procedure is applied to locate other roots.

EX: Use Bairstow’s method to determine the roots of the equation

using initial guess of r=s=-1, and stopping criterion s=1%

25.1875.3125.275.25.3)( 23455 xxxxxxf

Page 18: Es272 ch3b

First iteration:Apply synthetic division to obtain b values:b5=1 ; b4=-4.5 ; b3=6.25 ; b2=0.375 ; b1=-10.5 ; b0=11.375Apply synthetic division to obtain c values:c5=1 ; c4=-5.5 ; c3=10.75 ; c2=-4.875 ; c1=-16.375Solve the simultaneous equations: r=0.3558 and s=1.1381.Revise (r, s) values: r+r=-0.6442 and s+s=0.1381Error: a,r=55.23% and a,s=824.1%

Second iteration:b5=1 ; b4=-4.1442 ; b3=5.5578 ; b2=-2.0276 ; b1=-1.8013 ; b0=2.1304c5=1 ; c4=-4.7884 ; c3=8.7806 ; c2=-8.3454 ; c1=4.7874Solution of the simultaneous equations: r=0.1331 and s=0.3316.Revise (r, s) values: r+r=-0.5111 and s+s=0.4697Error : a,r=26.0% and a,s=70.6%

Third iteration:……

Page 19: Es272 ch3b

Forth iteration:r=-0.5 with a,r=0.063%s=0.5 with a,s=0.040%

Errors satisfy the error criterion. Then, we obtain first two roots as:

For the other roots, we use the deflated polynomial:

Apply Bairstow’s method with starting guesses r=-0.5 and s=0.5 (solution of the previous step) . After five iterations, we get r=2 and s=-1.249. Then, the roots are

We can easily obtain the fifth root by deflating the polynomial into the first order. The fifth root will be r5=2.

0.1

5.0

2

)5.0(4)5.0(5.0 2

2,1r

5.225.54)( 23 xxxxf

ir 499.012

)249.1(422 2

4,3

Page 20: Es272 ch3b

Libraries and PackagesMatlab

function Method

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

finds the real root of a single non-linear equation

A combination of bisection method + secant (Müller’s) methods

It first search for sign change, then applies secant algorithm.

If the root falls outside the interval, bisection method is applied until an acceptable result is obtained with fatser methods.

Usually it starts with bisection, and as the root is appraoched it shifts to faster methods

rootsroots(c)

determines all real and complex roots of polynomials.

uses the method of eigenvalues.

initial guesses

sign change

vector containing coefficients

Page 21: Es272 ch3b

IMSL:routine method

ZREAL Finds real zeros of real function using Müller’s method.

ZBREN Finds a zero of a real function in a given interval with sign change

ZANLY Find zeros of a univariate complex function using Müller’s method

ZPORC Finds zeros of a polynomial with real coefficients using Jenkins-Traub algorithm

ZPLRC Finds zeros of a polynomial with real coefficients using Laguerre method

ZPOCC Finds zeros of polynomials with complex coefficients using Jenkins-Traub algorithm.roots of polynomials

roots of functions