SlideShare uma empresa Scribd logo
1 de 21
CHAPTER 3: ROOT FINDING-b
– Roots of Polynomials:
– Müller’s Method
– Bairstow’s Method
– Packages and Libraries
Roots of Polynomials:
An order-n polynomial
f n ( x)

a0

a1 x a2 x 2 ... an x n

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:
f 3 ( x)

a3 x 3

a2 x 2

f 3 ( x)

(( a3 x a2 ) x a1 ) x a0 (Nested form; 3 multiplications + 3 additions)

a1 x a0

(Open form; 6 multiplications + 3 additions)

Nested form is preferred as it requires fewer operations:
> Lower cost of computation.
> Lower round-off errors.
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
f 3 ( x)

( x r1 )( x r2 )( x r3 )

(factored form)

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:
f 2 ( x)

( x r2 )( x r3 )

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).
 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.
dividend
Reminder (R)

x

2

2 x 24

x 4
x 6

0

divisor
quotient

 In computer the polynomial deflation is done by a process called
synthetic divison.
Synthetic division by a linear factor (x-t):
bn

an

bi

ai

an .. a0 : coefficients of the dividend
bi 1t

for i n 1 to 0

bn .. b1 : coefficients of the quotient
b0 : coefficient of the reminder

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

divisor
x 4 2 x3 2 x 24

x2 2x 3
x2 3

Reminder (R)

quotient

6x 9

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

bn
bi

an

an

1

ai

an .. a0 : coefficients of the dividend
1

rbn

rbi

1

sbi

2

for i n 2 to 0

bn .. b2 : coefficients of the quotient
b1 ,b0 : coefficients of the reminder

 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.
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 factor
 There are other methods too,e.g.:
- Jenkins-Traub method
- Laguerre’s method
- ...
 Plenty of software library is available for locating roots of
polynomials.
Müller’s Method
 This 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.
Secant

Müller

xr
xr x

x0

x1

two initial guesses

x1

2

x0

three initial guesses

 Parabolic fit function facilitates finding both real and complex roots.
 Define the parabola as
f 2 ( x)

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

 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)] .
We get these three equations with there unknowns (a,b,c):
f ( x0 )

a ( x0

x2 ) 2 b( x0

x2 ) c

f ( x1 )

a( x1

x2 ) 2 b( x1

x2 ) c

f ( x2 )

a ( x2

x2 ) 2 b ( x2

x2 ) c

From the third equation => f ( x2 ) c
Then, we get two equations with two unknowns:
f ( x0 )

f ( x2 )

a ( x0

x2 ) 2 b( x0

x2 )

f ( x1 )

f ( x2 )

a( x1

x2 ) 2 b( x1

x2 )

Define
h0

x1

x0

h1

Then
(h0

h1 )b (h0

x2

x1

h1 ) 2 a
2

h1b h1 a

h1

0

h0
1

0

f ( x1 ) f ( x0 )
x1 x0
h1

1

1

f ( x2 ) f ( x1 )
x2 x1
 The coefficients a,b,c are determined as
a

1

0

h0

h1 h0

b

ah1

c

x1

h1

x0

f ( x1 ) f ( x0 )
x1 x0

x2

x1

f ( x2 ) f ( x1 )
x2 x1

f ( x2 )

1

0

1

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

xr

x2

x2

2c
b2

b

4ac
2c

b

b 2 4ac

(alternative formula for
roots of quadratic polyn.)

(both real and complex
roots are facilitated.)
 Root is estimated iteratively (i.e., xr x3)
 Error can be defined as the difference between the current (x3)
and the previous (x2) solution:
x3
a

x2
x3

2c

100%
b

b2

1
100%
4ac x3

 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.
EX: Use Muller’s method to determine a root of the equation
f ( x)

x 3 13 x 12

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

First iteration:
f (5) 48

f (4.5) 20.625 f (5.5) 82.875
h0
0

5.5 4.5

h1

82.875 20.625
5.5 4.5

5 5.5

62.25

1

48 82.875
5 5.5

69.75

Then,
a

69.75 62.25
15 b 15( 0.5) 69.75 62.25
0.5 1

c 48
To determine the estimated root:
b 2 4ac

since

62.252 4(15)48 31.54

62.25 31.54

62.25 31.54

The estimated root is:
2(48)
62.25 31.54

3.976

Error:
a

3.976 5
100 %
3.976

25 .74 %

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

x1=5

x2=3.976

Xr

0

5

1

5

i

3.976

25.74

2

x3

4.001

0.6139

3

4

0.0262

4

4

< 10-5

a(%)

method rapidly converges
to the root xr=4.
Bairstow’s Method
 We 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:
f n ( x)

a0

a1 x a2 x 2 ... an x n

If you divide the polynomial by its factor (x-t), you get a new
polynomial of the form
f n 1 ( x) b1 b2 x b3 x 2 ... bn x n

1

and a reminder R b0
This process can be done by using synthetic division:
bn

an

bi

ai

bi 1t

for i n 1 to 0

 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
f n 2 ( x) b2 b3 x ... bn 1 x n

with a reminder

R

3

bn x n

2

b1 ( x r ) b0

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

bn

an

an

1

1

rbn

for i n 2 to 0
Then, the problem is to find (r,s) values that make the reminder
term zero (i.e. b1=b0=0).
bi

ai

rbi

1

sbi

2
 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:
b1 (r
b0 (r

r, s
r, s

s) b1

b1
r
r

s) b0

b0
r
r

b1
s
s
b0
s
s

(no higher order terms)

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

b1
s
s

b0
r
r

b0
s
s

b1
b0

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

c1

b1
r

c2

b0
s

c3

b1
s

Then, we have the following simultaneous equations:
c2 r c3 s

b1

c1 r c2 s

b0

 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:
cn
cn

ci

bn
bn

1

bi

1

rc n

rci

1

sci

2

for

i

n 2 to 1

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

r

r

s

s

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

r
100 %
r

and

s
100 %
s

a ,s

 When both values fall below a stopping criterion, the roots can
be determined as the roots of x 2 rx s :
x1, 2

r

r2
2

4s

 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
f 5 ( x)

x 5 3.5 x 4

2.75 x 3

2.125 x 2 3.875 x 1.25

using initial guess of r=s=-1, and stopping criterion s=1%
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.375
Apply synthetic division to obtain c values:
c5=1 ; c4=-5.5 ; c3=10.75 ; c2=-4.875 ; c1=-16.375
Solve the simultaneous equations:
r=0.3558 and s=1.1381.
Revise (r, s) values: r+ r=-0.6442 and s+ s=0.1381
Error:
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.1304
c5=1 ; c4=-4.7884 ; c3=8.7806 ; c2=-8.3454 ; c1=4.7874
Solution of the simultaneous equations: r=0.1331 and s=0.3316.
Revise (r, s) values: r+ r=-0.5111 and s+ s=0.4697
Error : a,r=26.0% and a,s=70.6%
Third iteration:
……
Forth iteration:
r=-0.5 with
s=0.5 with

a,r=0.063%
a,s=0.040%

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

0.5

( 0.5) 2 4(0.5)
2

0.5
1.0

For the other roots, we use the deflated polynomial:
f ( x)

x 3 4 x 2 5.25 x 2.5

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
r3, 4

2

22 4( 1.249)
2

1 0.499i

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

Method

fzero
initial guesses
fzero(function, x0)
fzero(function [x0 x1])
sign change

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

roots
roots(c)
vector containing coefficients

 determines all real and complex roots of
polynomials.
 uses the method of eigenvalues.
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

roots of functions

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
roots of polynomials

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

Mais conteúdo relacionado

Mais procurados

Direct Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations SystemsDirect Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations Systems
Lizeth Paola Barrero
 

Mais procurados (20)

Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2
 
Numerical Differentiation and Integration
 Numerical Differentiation and Integration Numerical Differentiation and Integration
Numerical Differentiation and Integration
 
Mean Squared Error (MSE) of an Estimator
Mean Squared Error (MSE) of an EstimatorMean Squared Error (MSE) of an Estimator
Mean Squared Error (MSE) of an Estimator
 
Presentation on Solution to non linear equations
Presentation on Solution to non linear equationsPresentation on Solution to non linear equations
Presentation on Solution to non linear equations
 
NUMERICAL METHODS
NUMERICAL   METHODSNUMERICAL   METHODS
NUMERICAL METHODS
 
Simpson's rule of integration
Simpson's rule of integrationSimpson's rule of integration
Simpson's rule of integration
 
Bracketing Methods
Bracketing MethodsBracketing Methods
Bracketing Methods
 
Ordinary differential equations
Ordinary differential equationsOrdinary differential equations
Ordinary differential equations
 
Bisection theorem proof and convergence analysis
Bisection theorem proof and convergence analysisBisection theorem proof and convergence analysis
Bisection theorem proof and convergence analysis
 
Interpolation
InterpolationInterpolation
Interpolation
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10
 
system linear equations and matrices
 system linear equations and matrices system linear equations and matrices
system linear equations and matrices
 
Series solution to ordinary differential equations
Series solution to ordinary differential equations Series solution to ordinary differential equations
Series solution to ordinary differential equations
 
Linear and non linear equation
Linear and non linear equationLinear and non linear equation
Linear and non linear equation
 
Direct Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations SystemsDirect Methods to Solve Linear Equations Systems
Direct Methods to Solve Linear Equations Systems
 
Multiple Choice Questions - Numerical Methods
Multiple Choice Questions - Numerical MethodsMultiple Choice Questions - Numerical Methods
Multiple Choice Questions - Numerical Methods
 
Newton’s Divided Difference Formula
Newton’s Divided Difference FormulaNewton’s Divided Difference Formula
Newton’s Divided Difference Formula
 
False Point Method / Regula falsi method
False Point Method / Regula falsi methodFalse Point Method / Regula falsi method
False Point Method / Regula falsi method
 
Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
 
Higher order differential equations
Higher order differential equationsHigher order differential equations
Higher order differential equations
 

Destaque

Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
daferro
 
Bracketing or closed methods
Bracketing or closed methodsBracketing or closed methods
Bracketing or closed methods
andrushow
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
daferro
 
Application of least square method
Application of least square methodApplication of least square method
Application of least square method
are you
 
OOP in C - Virtual Function (Chinese Version)
OOP in C - Virtual Function (Chinese Version)OOP in C - Virtual Function (Chinese Version)
OOP in C - Virtual Function (Chinese Version)
Kai-Feng Chou
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position Method
Tayyaba Abbas
 
Regula falsi method
Regula falsi methodRegula falsi method
Regula falsi method
andrushow
 
Lec 42.43 - virtual.functions
Lec 42.43 - virtual.functionsLec 42.43 - virtual.functions
Lec 42.43 - virtual.functions
Princess Sam
 

Destaque (20)

Es272 ch3a
Es272 ch3aEs272 ch3a
Es272 ch3a
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
 
NUMERICAL METHODS
NUMERICAL METHODSNUMERICAL METHODS
NUMERICAL METHODS
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Numerical methods
Numerical methodsNumerical methods
Numerical methods
 
Bracketing or closed methods
Bracketing or closed methodsBracketing or closed methods
Bracketing or closed methods
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
 
NUMERICAL METHODS
NUMERICAL METHODSNUMERICAL METHODS
NUMERICAL METHODS
 
Application of least square method
Application of least square methodApplication of least square method
Application of least square method
 
OOP in C - Virtual Function (Chinese Version)
OOP in C - Virtual Function (Chinese Version)OOP in C - Virtual Function (Chinese Version)
OOP in C - Virtual Function (Chinese Version)
 
The False-Position Method
The False-Position MethodThe False-Position Method
The False-Position Method
 
Regula falsi method
Regula falsi methodRegula falsi method
Regula falsi method
 
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
 
[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member[OOP - Lec 18] Static Data Member
[OOP - Lec 18] Static Data Member
 
Bisection & Regual falsi methods
Bisection & Regual falsi methodsBisection & Regual falsi methods
Bisection & Regual falsi methods
 
Numerical analysis (Bisectional method) application
Numerical analysis (Bisectional method) applicationNumerical analysis (Bisectional method) application
Numerical analysis (Bisectional method) application
 
Lec 42.43 - virtual.functions
Lec 42.43 - virtual.functionsLec 42.43 - virtual.functions
Lec 42.43 - virtual.functions
 
Bisection method
Bisection methodBisection method
Bisection method
 
Taylor series
Taylor seriesTaylor series
Taylor series
 

Semelhante a Es272 ch3b

Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial Fu...
Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial  Fu...Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial  Fu...
Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial Fu...
magnesium121
 
Appendex b
Appendex bAppendex b
Appendex b
swavicky
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
daferro
 
The fundamental thorem of algebra
The fundamental thorem of algebraThe fundamental thorem of algebra
The fundamental thorem of algebra
lucysolischar
 
Y11+gdc+maximize+your+use+of+the++ev+2
Y11+gdc+maximize+your+use+of+the++ev+2Y11+gdc+maximize+your+use+of+the++ev+2
Y11+gdc+maximize+your+use+of+the++ev+2
estelav
 
Binomial Theorem
Binomial TheoremBinomial Theorem
Binomial Theorem
itutor
 

Semelhante a Es272 ch3b (20)

Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial Fu...
Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial  Fu...Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial  Fu...
Quotient of polynomial using (Synthetic Division) and Zeros of Polynomial Fu...
 
Appendex b
Appendex bAppendex b
Appendex b
 
Roots of polynomials
Roots of polynomialsRoots of polynomials
Roots of polynomials
 
Lesson 7
Lesson 7Lesson 7
Lesson 7
 
Es272 ch4a
Es272 ch4aEs272 ch4a
Es272 ch4a
 
DISCRIMINANT.ppt
DISCRIMINANT.pptDISCRIMINANT.ppt
DISCRIMINANT.ppt
 
NUMERICAL METHODS
NUMERICAL METHODSNUMERICAL METHODS
NUMERICAL METHODS
 
Dividing polynomials
Dividing polynomialsDividing polynomials
Dividing polynomials
 
Bonus math project
Bonus math projectBonus math project
Bonus math project
 
Takue
TakueTakue
Takue
 
Unit2.polynomials.algebraicfractions
Unit2.polynomials.algebraicfractionsUnit2.polynomials.algebraicfractions
Unit2.polynomials.algebraicfractions
 
The fundamental thorem of algebra
The fundamental thorem of algebraThe fundamental thorem of algebra
The fundamental thorem of algebra
 
Multivariate Methods Assignment Help
Multivariate Methods Assignment HelpMultivariate Methods Assignment Help
Multivariate Methods Assignment Help
 
Problems 2
Problems 2Problems 2
Problems 2
 
Y11+gdc+maximize+your+use+of+the++ev+2
Y11+gdc+maximize+your+use+of+the++ev+2Y11+gdc+maximize+your+use+of+the++ev+2
Y11+gdc+maximize+your+use+of+the++ev+2
 
Introduction to Evidential Neural Networks
Introduction to Evidential Neural NetworksIntroduction to Evidential Neural Networks
Introduction to Evidential Neural Networks
 
Ch 2
Ch 2Ch 2
Ch 2
 
Module 3 polynomial functions
Module 3   polynomial functionsModule 3   polynomial functions
Module 3 polynomial functions
 
Linearprog, Reading Materials for Operational Research
Linearprog, Reading Materials for Operational Research Linearprog, Reading Materials for Operational Research
Linearprog, Reading Materials for Operational Research
 
Binomial Theorem
Binomial TheoremBinomial Theorem
Binomial Theorem
 

Mais de Batuhan Yıldırım (7)

Es272 ch7
Es272 ch7Es272 ch7
Es272 ch7
 
Es272 ch5b
Es272 ch5bEs272 ch5b
Es272 ch5b
 
Es272 ch5a
Es272 ch5aEs272 ch5a
Es272 ch5a
 
Es272 ch4b
Es272 ch4bEs272 ch4b
Es272 ch4b
 
Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Es272 ch0
Es272 ch0Es272 ch0
Es272 ch0
 
Es272 ch2
Es272 ch2Es272 ch2
Es272 ch2
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Es272 ch3b

  • 1. CHAPTER 3: ROOT FINDING-b – Roots of Polynomials: – Müller’s Method – Bairstow’s Method – Packages and Libraries
  • 2. Roots of Polynomials: An order-n polynomial f n ( x) a0 a1 x a2 x 2 ... an x n 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: f 3 ( x) a3 x 3 a2 x 2 f 3 ( x) (( a3 x a2 ) x a1 ) x a0 (Nested form; 3 multiplications + 3 additions) a1 x a0 (Open form; 6 multiplications + 3 additions) Nested form is preferred as it requires fewer operations: > Lower cost of computation. > Lower round-off errors.
  • 3. 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 f 3 ( x) ( x r1 )( x r2 )( x r3 ) (factored form) 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: f 2 ( x) ( x r2 )( x r3 ) 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).
  • 4.  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. dividend Reminder (R) x 2 2 x 24 x 4 x 6 0 divisor quotient  In computer the polynomial deflation is done by a process called synthetic divison. Synthetic division by a linear factor (x-t): bn an bi ai an .. a0 : coefficients of the dividend bi 1t for i n 1 to 0 bn .. b1 : coefficients of the quotient b0 : coefficient of the reminder For example above: a1=1, a2=2, a3=-24, t=4 > b2=1, b1=6, b0=0
  • 5. dividend divisor x 4 2 x3 2 x 24 x2 2x 3 x2 3 Reminder (R) quotient 6x 9 Synthetic division by a quadratic factor (x2-rx-s): bn bn bi an an 1 ai an .. a0 : coefficients of the dividend 1 rbn rbi 1 sbi 2 for i n 2 to 0 bn .. b2 : coefficients of the quotient b1 ,b0 : coefficients of the reminder  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.
  • 6. 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 factor  There are other methods too,e.g.: - Jenkins-Traub method - Laguerre’s method - ...  Plenty of software library is available for locating roots of polynomials.
  • 7. Müller’s Method  This 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. Secant Müller xr xr x x0 x1 two initial guesses x1 2 x0 three initial guesses  Parabolic fit function facilitates finding both real and complex roots.  Define the parabola as f 2 ( x) a( x x2 ) 2 b( x x2 ) c  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)] .
  • 8. We get these three equations with there unknowns (a,b,c): f ( x0 ) a ( x0 x2 ) 2 b( x0 x2 ) c f ( x1 ) a( x1 x2 ) 2 b( x1 x2 ) c f ( x2 ) a ( x2 x2 ) 2 b ( x2 x2 ) c From the third equation => f ( x2 ) c Then, we get two equations with two unknowns: f ( x0 ) f ( x2 ) a ( x0 x2 ) 2 b( x0 x2 ) f ( x1 ) f ( x2 ) a( x1 x2 ) 2 b( x1 x2 ) Define h0 x1 x0 h1 Then (h0 h1 )b (h0 x2 x1 h1 ) 2 a 2 h1b h1 a h1 0 h0 1 0 f ( x1 ) f ( x0 ) x1 x0 h1 1 1 f ( x2 ) f ( x1 ) x2 x1
  • 9.  The coefficients a,b,c are determined as a 1 0 h0 h1 h0 b ah1 c x1 h1 x0 f ( x1 ) f ( x0 ) x1 x0 x2 x1 f ( x2 ) f ( x1 ) x2 x1 f ( x2 ) 1 0 1  To calculate the root, calculate the point where the parabola intersects the x-axis, i.e. f (x) 0 . Then, the roots (xr) are xr xr x2 x2 2c b2 b 4ac 2c b b 2 4ac (alternative formula for roots of quadratic polyn.) (both real and complex roots are facilitated.)
  • 10.  Root is estimated iteratively (i.e., xr x3)  Error can be defined as the difference between the current (x3) and the previous (x2) solution: x3 a x2 x3 2c 100% b b2 1 100% 4ac x3  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.
  • 11. EX: Use Muller’s method to determine a root of the equation f ( x) x 3 13 x 12 With initial guesses x0=4.5 , x1=5.5 , x2=5.0. First iteration: f (5) 48 f (4.5) 20.625 f (5.5) 82.875 h0 0 5.5 4.5 h1 82.875 20.625 5.5 4.5 5 5.5 62.25 1 48 82.875 5 5.5 69.75 Then, a 69.75 62.25 15 b 15( 0.5) 69.75 62.25 0.5 1 c 48
  • 12. To determine the estimated root: b 2 4ac since 62.252 4(15)48 31.54 62.25 31.54 62.25 31.54 The estimated root is: 2(48) 62.25 31.54 3.976 Error: a 3.976 5 100 % 3.976 25 .74 % For the next iteration, assign new guesses (sequential replacement): x0=5.5 x1=5 x2=3.976 Xr 0 5 1 5 i 3.976 25.74 2 x3 4.001 0.6139 3 4 0.0262 4 4 < 10-5 a(%) method rapidly converges to the root xr=4.
  • 13. Bairstow’s Method  We 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: f n ( x) a0 a1 x a2 x 2 ... an x n If you divide the polynomial by its factor (x-t), you get a new polynomial of the form f n 1 ( x) b1 b2 x b3 x 2 ... bn x n 1 and a reminder R b0
  • 14. This process can be done by using synthetic division: bn an bi ai bi 1t for i n 1 to 0  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 f n 2 ( x) b2 b3 x ... bn 1 x n with a reminder R 3 bn x n 2 b1 ( x r ) b0 The process can be done by synthetic division by a quadratic factor: bn bn an an 1 1 rbn for i n 2 to 0 Then, the problem is to find (r,s) values that make the reminder term zero (i.e. b1=b0=0). bi ai rbi 1 sbi 2
  • 15.  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: b1 (r b0 (r r, s r, s s) b1 b1 r r s) b0 b0 r r b1 s s b0 s s (no higher order terms)  We force b0 and b1 to be zero to reach the root; then we get b1 r r b1 s s b0 r r b0 s s b1 b0 Need to solve these two equations for two unknowns: r and s
  • 16. Define b0 r c1 b1 r c2 b0 s c3 b1 s Then, we have the following simultaneous equations: c2 r c3 s b1 c1 r c2 s b0  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: cn cn ci bn bn 1 bi 1 rc n rci 1 sci 2 for i n 2 to 1 Once r and s are calculated using the simultaneous equations, Then, for the next iteration (r,s) values are improved as: r r r s s s
  • 17.  Error at each iteration can be calculated for r and s seperately: a ,r r 100 % r and s 100 % s a ,s  When both values fall below a stopping criterion, the roots can be determined as the roots of x 2 rx s : x1, 2 r r2 2 4s  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 f 5 ( x) x 5 3.5 x 4 2.75 x 3 2.125 x 2 3.875 x 1.25 using initial guess of r=s=-1, and stopping criterion s=1%
  • 18. 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.375 Apply synthetic division to obtain c values: c5=1 ; c4=-5.5 ; c3=10.75 ; c2=-4.875 ; c1=-16.375 Solve the simultaneous equations: r=0.3558 and s=1.1381. Revise (r, s) values: r+ r=-0.6442 and s+ s=0.1381 Error: 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.1304 c5=1 ; c4=-4.7884 ; c3=8.7806 ; c2=-8.3454 ; c1=4.7874 Solution of the simultaneous equations: r=0.1331 and s=0.3316. Revise (r, s) values: r+ r=-0.5111 and s+ s=0.4697 Error : a,r=26.0% and a,s=70.6% Third iteration: ……
  • 19. Forth iteration: r=-0.5 with s=0.5 with a,r=0.063% a,s=0.040% Errors satisfy the error criterion. Then, we obtain first two roots as: r1, 2 0.5 ( 0.5) 2 4(0.5) 2 0.5 1.0 For the other roots, we use the deflated polynomial: f ( x) x 3 4 x 2 5.25 x 2.5 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 r3, 4 2 22 4( 1.249) 2 1 0.499i We can easily obtain the fifth root by deflating the polynomial into the first order. The fifth root will be r5=2.
  • 20. Libraries and Packages Matlab function Method fzero initial guesses fzero(function, x0) fzero(function [x0 x1]) sign change 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 roots roots(c) vector containing coefficients  determines all real and complex roots of polynomials.  uses the method of eigenvalues.
  • 21. 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 roots of functions 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 roots of polynomials Finds zeros of polynomials with complex coefficients using Jenkins-Traub algorithm.