hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_zeros_quartic_complex (c02an)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_zeros_quartic_complex (c02an) determines the roots of a quartic equation with complex coefficients.

Syntax

[zeror, zeroi, errest, ifail] = c02an(e, a, b, c, d)
[zeror, zeroi, errest, ifail] = nag_zeros_quartic_complex(e, a, b, c, d)

Description

nag_zeros_quartic_complex (c02an) attempts to find the roots of the quartic equation
ez4+az3+bz2+cz+d=0,  
where e, a, b, c and d are complex coefficients with e0. The roots are located by finding the eigenvalues of the associated 4 by 4 (upper Hessenberg) companion matrix H given by
H= 0 0 0 -d/e 1 0 0 -c/e 0 1 0 -b/e 0 0 1 -a/e .  
The eigenvalues are obtained by a call to nag_lapack_zhseqr (f08ps). Further details can be found in Further Comments.
To obtain the roots of a cubic equation, nag_zeros_cubic_complex (c02am) can be used.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     e – complex scalar
e, the coefficient of z4.
Constraint: e0.0,0.0.
2:     a – complex scalar
a, the coefficient of z3.
3:     b – complex scalar
b, the coefficient of z2.
4:     c – complex scalar
c, the coefficient of z.
5:     d – complex scalar
d, the constant coefficient.

Optional Input Parameters

None.

Output Parameters

1:     zeror4 – double array
2:     zeroi4 – double array
zerori and zeroii contain the real and imaginary parts, respectively, of the ith root.
3:     errest4 – double array
erresti contains an approximate error estimate for the ith root.
4:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=1
On entry,e=0.0,0.0.
   ifail=2
The companion matrix H cannot be formed without overflow.
   ifail=3
The iterative procedure used to determine the eigenvalues has failed to converge.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

If ifail=0 on exit, then the ith computed root should have approximately log10erresti  correct significant digits.

Further Comments

The method used by the function consists of the following steps, which are performed by functions from LAPACK in Chapter F08.
(a) Form matrix H.
(b) Apply a diagonal similarity transformation to H (to give H).
(c) Calculate the eigenvalues and Schur factorization of H.
(d) Calculate the left and right eigenvectors of H.
(e) Estimate reciprocal condition numbers for all the eigenvalues of H.
(f) Calculate approximate error estimates for all the eigenvalues of H (using the 1-norm).

Example

This example finds the roots of the quartic equation
z4+16iz2-8-8iz-65=0.  
function c02an_example


fprintf('c02an example results\n\n');

e =  complex(1);
a =   -10 + 2i;
b =    48 - 10i;
c =  -100 + 28i;
d =  complex(96);
[zr, zi, errest, ifail] = c02an(e, a, b, c, d);

fprintf('  Roots of quartic    error estimates\n');
for j = 1:4
   if (zi(j)<0)
     fprintf('%8.4f - %7.4fi     %8.2e\n',zr(j),abs(zi(j)),errest(j));
   else
     fprintf('%8.4f - %7.4fi     %8.2e\n',zr(j),abs(zi(j)),errest(j));
   end
end


c02an example results

  Roots of quartic    error estimates
  3.0000 -  3.0000i     1.55e-14
  1.0000 -  1.0000i     1.18e-14
  2.0000 -  2.0000i     2.14e-14
  4.0000 -  4.0000i     2.02e-14

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015