CompanionMatrix - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


LinearAlgebra

  

CompanionMatrix

  

construct the companion Matrix (pencil) of a monic (or non-monic) polynomial or Matrix polynomial

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

CompanionMatrix(P, x, cpt, options)

CompanionMatrix(data1, data2, cpt, options)

Parameters

P

-

polynomial or matrix polynomial

x

-

(optional) name; variable to use as the main indeterminate if P is multivariate

data1

-

list; first coordinate values (nodes) for distinct points in the Lagrange basis which specify the polynomial or matrix polynomial

data2

-

list; second coordinate values (values) for distinct points in the Lagrange basis which specify the polynomial or matrix polynomial

cpt

-

(optional) equation of the form compact=true or false; selects the compact form of the output in the scalar, monic polynomial case

options

-

(optional); constructor options for the result object

Description

• 

The CompanionMatrix(P) command returns the companion Matrix associated with the univariate (matrix) polynomial either provided as Px or specified by distinct data points in the Lagrange basis.

• 

If C := CompanionMatrix(P) and P=a0+a1x+...+xn (a monic univariate polynomial expressed in the monomial basis), and each coefficient is an m by m matrix or scalar if m=1, then C is an mn by mn Matrix where n is the degree of polynomial P, and if m=1 then Ci,n=ai1 (i=1..n), Ci,i1=1 (i=2..n), and Ci,j=0 for all other values of i and j.  If 1<m, a block-structured matrix C is the result.  In this case, monic means that the leading coefficient of P is the identity matrix.

• 

If C := CompanionMatrix(P) and P is a univariate matrix polynomial that is not monic, or a scalar polynomial that is not monic, then C is an expression sequence of two matrices such that DeterminantxC2+C1=0 if and only if Px is singular.

• 

Px need not be expressed in the monomial basis; it may be expressed in any of the major orthogonal polynomial bases known to OrthogonalSeries, or in terms of the additional bases BernsteinBasis(k, n, a, b, x) meaning nkxakbxnk, NewtonBasis(k, [x0, x1, ..., xn], x), or LagrangeBasis(k, [x0, x1, ..., xn], x).

• 

The CompanionMatrix(P, x) command is used when P is a multivariate polynomial; the main indeterminate of P can be specified by using the optional parameter x.

• 

In the case that the polynomial or matrix polynomial is supplied in terms of distinct points in the Lagrange basis, as data1 and data2, then a pair of Matrices C0 and C1 are returned. For each x=data1i, the property DeterminantxC1C0=y will hold, for the corresponding value y=data2i. Given n+1 distinct points the Matrices C0 and C1 will have size n+2 by n+2.

• 

If the compact option (cpt) is included in the calling sequence as the symbol compact or in the form compact=true, then the result is built by using a shape function designed to minimize storage.  If the option is omitted or entered as compact=false, a full rectangular Matrix is constructed.  Generally, if space is not a consideration, the full rectangular form (the default) is more efficient.  The compact option does nothing if P is a matrix polynomial.

  

Note:  If the compact form is selected, any datatype specification in the constructor options is silently ignored. The datatype of any data retrieved from the constructed Matrix is determined by the data used to build the Matrix.

• 

The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Matrix constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).

Examples

withLinearAlgebra&colon;

px4+y3+2y2+3x

px4+y3+2y2+3x

(1)

CompanionMatrixp&comma;y

00x43x10001−2

(2)

qz+2z5z+3

qz+2z5z+3

(3)

CompanionMatrixq

00301019010

(4)

r3x2+2xy+17y2

r3x2+2xy+17y2

(5)

CompanionMatrixr&comma;x

017y212y,1003

(6)

pRandomMatrix2&comma;2ChebyshevT0&comma;x+RandomMatrix2&comma;2ChebyshevT1&comma;x+RandomMatrix2&comma;2ChebyshevT2&comma;x+RandomMatrix2&comma;2ChebyshevT3&comma;x+RandomMatrix2&comma;2ChebyshevT4&comma;x

p44ChebyshevT0&comma;x+8ChebyshevT1&comma;x32ChebyshevT2&comma;x93ChebyshevT3&comma;x98ChebyshevT4&comma;x31ChebyshevT0&comma;x+99ChebyshevT1&comma;x4ChebyshevT2&comma;x72ChebyshevT3&comma;x+57ChebyshevT4&comma;x92ChebyshevT0&comma;x+69ChebyshevT1&comma;x74ChebyshevT2&comma;x76ChebyshevT3&comma;x77ChebyshevT4&comma;x67ChebyshevT0&comma;x+29ChebyshevT1&comma;x+27ChebyshevT2&comma;x2ChebyshevT3&comma;x+27ChebyshevT4&comma;x

(7)

C1,C2CompanionMatrixp&comma;x

C1,C20012000−44−92000120031−671000120−8−690100012−99−290012000−66−30001200610000012093760000012722,100000000100000000100000000100000000100000000100000000−196−15400000011454

(8)

simplifyDeterminantp24DeterminantC1xC2

0

(9)

M0,M1CompanionMatrixy0&comma;y1&comma;y2&comma;x0&comma;x1&comma;x2

M0,M1x000y00x10y100x2y21x0x1x0x21x1x0x1x21x2x0x2x10,−10000−10000−100000

(10)

pDeterminantxM1M0

px2x0y1x2x0y2x2x1y0+x2x1y2+x2x2y0x2x2y1xx02y1+xx02y2+xx12y0xx12y2xx22y0+xx22y1x02x1y2+x02x2y1+x0x12y2x0x22y1x12x2y0+x1x22y0x0x2x1x2x0x1

(11)

Show the Lagrange form of p.

iformcollectp&comma;y0&comma;y1&comma;y2&comma;factor

iformxx1y0xx2x0x1x0x2xx2xx0y1x0x1x1x2+xx1xx0y2x0x2x1x2

(12)

degreep&comma;x

2

(13)

References

  

Corless, Robert M., and Watt, Stephen M. "Bernstein bases are optimal, but, sometimes, Lagrange bases are better." Proceedings of SYNASC. Timisoara. pp. 141-153. MITRON Press, 2004.

See Also

LinearAlgebra

LinearAlgebra[CharacteristicPolynomial]

LinearAlgebra[DiagonalMatrix]

LinearAlgebra[JordanBlockMatrix]