0% found this document useful (0 votes)
32 views7 pages

8 - Bairstow's Method

Numwricals

Uploaded by

Usman Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views7 pages

8 - Bairstow's Method

Numwricals

Uploaded by

Usman Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Bataan Peninsula State University

College of Engineering and


Architecture
Bachelor of Science in Electrical Engineering

BAIRSTOW’S METHOD

PREPARED BY:

Isuga, Denivy D.

Quezon, Rupert R.

Ruma, Faith Aebrille S.

Sauza, Kirch Ford E.

Suderio, Joshua Rheyell D.

SUBMITTED TO:

ENGR. SHIELLA MAY ATON

SEPTEMBER 24, 2024


BAIRSTOW’S METHOD

BAIRSTOW’S METHOD

The Bairstow method is a numerical technique used to find


the roots of a polynomial equation by factoring it into quadratic
factors. This iterative method solves high-degree polynomials by
approximating the roots through successive refinements, making it
especially useful for polynomials with both real and complex
roots. It operates by assuming the polynomial can be expressed as
a product of quadratic factors, iteratively updating the
coefficients of these factors to minimize the polynomial's
remainder and identify its roots.

Formula:

Polynomial Representation

Quadratic Factor

Note: Where Q(x) is the quotient polynomial.

Error Equations

Note: Where RRR and SSS are matrices derived from the polynomial
coefficients, and E1E_1E1 and E2E_2E2 are the errors in the polynomial.

Example:
Apply Bairstow’s Method to this quadratic polynomial
P(x)= x2+3x+2

NUMERICAL METHODS AND ANALYSIS |ELEP0113


BAIRSTOW’S METHOD

SOLVING:

NUMERICAL METHODS AND ANALYSIS |ELEP0113


BAIRSTOW’S METHOD

NUMERICAL METHODS AND ANALYSIS |ELEP0113


BAIRSTOW’S METHOD

NUMERICAL METHODS AND ANALYSIS |ELEP0113


BAIRSTOW’S METHOD

CODE FOR BAIRSTOW’S METHOD IN MATLAB PROGRAMMING LANGUAGE:


function [Root, iterationCount] = Bairstow(Coeff, initialGuess, MaxApproxError)
maxiternumber = 200;
r = initialGuess;
s = initialGuess;
maxerr = MaxApproxError; % max error
flag = 1; % Flag will be used for terminating process
Root_index = 0;
iterationCount = 0; % Initialize iteration count for tracking

while(flag == 1)
[~, col] = size(Coeff);
if (col == 1)
flag = 0;
elseif (col == 2)
flag = 0;
Root_index = Root_index + 1;
Root(Root_index) = -Coeff(2)/Coeff(1);
elseif (col >= 3)
A = flip(Coeff);
[~, n] = size(A);
B = zeros(1, n);
C = zeros(1, n);
r = initialGuess;
s = initialGuess;

for i = 1:maxiternumber
B(n) = A(n);
B(n-1) = A(n-1) + (r * B(n));
for j = n-2:-1:1
B(j) = A(j) + (r * B(j+1)) + (s * B(j+2));
end
C(4) = 0; % a safety measure for quadratic equations
C(n) = B(n);
C(n-1) = B(n-1) + (r * C(n));
for j = n-2:-1:1
C(j) = B(j) + (r * C(j+1)) + (s * C(j+2));
end
cofmat = [C(3) C(4);
C(2) C(3)];
b = [-1 * B(2);
-1 * B(1)];
del = inv(cofmat) * b;

if (abs(del(2)/s) < maxerr && abs(del(1)/r) < maxerr)


r = r + del(1);
s = s + del(2);
x1 = (r + sqrt((r^2) + (4 * s))) / 2;
Root_index = Root_index + 1;
Root(Root_index) = x1;
x2 = (r - sqrt((r^2) + (4 * s))) / 2;
Root_index = Root_index + 1;
Root(Root_index) = x2;

% Update iteration count here for this successful root-finding step


iterationCount = iterationCount + i;
break;
else
r = r + del(1);
s = s + del(2);
end

if(i == maxiternumber - 1)
disp('Method failed to find root');
end
end
end
[Coeff, ~] = deconv(Coeff, [1 -x1]);
[Coeff, ~] = deconv(Coeff, [1 -x2]);
end

% Display the iteration count at the end


disp(['Total iterations: ', num2str(iterationCount)]);
end

NUMERICAL METHODS AND ANALYSIS |ELEP0113


BAIRSTOW’S METHOD

INPUT FOR BAIRSTOW’S METHOD

OUTPUT FOR BAIRSTOW’S METHOD

NUMERICAL METHODS AND ANALYSIS |ELEP0113

You might also like