8 - Bairstow's Method
8 - Bairstow's Method
BAIRSTOW’S METHOD
PREPARED BY:
Isuga, Denivy D.
Quezon, Rupert R.
SUBMITTED TO:
BAIRSTOW’S METHOD
Formula:
Polynomial Representation
Quadratic Factor
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
SOLVING:
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(i == maxiternumber - 1)
disp('Method failed to find root');
end
end
end
[Coeff, ~] = deconv(Coeff, [1 -x1]);
[Coeff, ~] = deconv(Coeff, [1 -x2]);
end