DADiSP Worksheet Functions > Function Categories > Complex Conversions > CPLXPAIR

 

CPLXPAIR

Purpose:

Groups complex values by conjugate pairs.

Syntax:

CPLXPAIR(z, tol)

z

-

A series, the complex values.

tol

-

Optional. A real, the tolerance to determine a purely real value. Defaults to 100 * eps.

Returns:

A series, the ordered paired complex conjugate values.

Example:

W1: 1..6

W2: roots(w1)

W3: cplxpair(w2)

 

W2 == {0.551685 + 1.253349i,

       0.551685 - 1.253349i,

      -1.491798 + 0.000000i,

      -0.805786 + 1.222905i,

      -0.805786 - 1.222905i}

 

W3 == {-0.805786 - 1.222905i,

       -0.805786 + 1.222905i,

        0.551685 - 1.253349i,

        0.551685 + 1.253349i,

       -1.491798 + 0.000000i}

 

W1 represents the polynomial:

 

 

W2 contains the roots of y(x).

 

W3 sorts the roots in ascending order with the purely real root at the end of the list.

Remarks:

CPLXPAIR groups complex conjugate pairs of complex numbers in ascending order. The value with a negative imaginary part precedes the paired value with a positive imaginary part. Purely real values are placed at the end of the list.

 

The tolerance tol specifies the threshold of the absolute value of the imaginary part below which the value is considered purely real.

 

An error occurs if the values cannot be paired.

See Also:

CARTESIAN

EPS

IMAGINARY

REAL

SORT