LinearAlgebra
CompanionMatrix
construct the companion Matrix (pencil) of a monic (or non-monic) polynomial or Matrix polynomial
Calling Sequence
Parameters
Description
Examples
References
CompanionMatrix(P, x, cpt, options)
CompanionMatrix(data1, data2, cpt, options)
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
The CompanionMatrix(P) command returns the companion Matrix associated with the univariate (matrix) polynomial either provided as P⁡x or specified by distinct data points in the Lagrange basis.
If C := CompanionMatrix(P) and P=a0+a1⁢x+...+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 m⁢n by m⁢n Matrix where n is the degree of polynomial P, and if m=1 then Ci,n=−ai−1 (i=1..n), Ci,i−1=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 Determinant⁡−x⁢C2+C1=0 if and only if P⁡x is singular.
P⁡x 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 nk⁢x−ak⁢b−xn−k, 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 Determinant⁡x⁢C1−C0=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).
with⁡LinearAlgebra:
p≔x4+y3+2⁢y2+3⁢x
CompanionMatrix⁡p,y
00−x4−3⁢x10001−2
q≔z+2⁢z−5⁢z+3
CompanionMatrix⁡q
00301019010
r≔3⁢x2+2⁢x⁢y+17⁢y2
CompanionMatrix⁡r,x
0−17⁢y21−2⁢y,1003
p≔RandomMatrix⁡2,2⁢ChebyshevT⁡0,x+RandomMatrix⁡2,2⁢ChebyshevT⁡1,x+RandomMatrix⁡2,2⁢ChebyshevT⁡2,x+RandomMatrix⁡2,2⁢ChebyshevT⁡3,x+RandomMatrix⁡2,2⁢ChebyshevT⁡4,x
p≔44⁢ChebyshevT⁡0,x+8⁢ChebyshevT⁡1,x−32⁢ChebyshevT⁡2,x−93⁢ChebyshevT⁡3,x−98⁢ChebyshevT⁡4,x−31⁢ChebyshevT⁡0,x+99⁢ChebyshevT⁡1,x−4⁢ChebyshevT⁡2,x−72⁢ChebyshevT⁡3,x+57⁢ChebyshevT⁡4,x92⁢ChebyshevT⁡0,x+69⁢ChebyshevT⁡1,x−74⁢ChebyshevT⁡2,x−76⁢ChebyshevT⁡3,x−77⁢ChebyshevT⁡4,x67⁢ChebyshevT⁡0,x+29⁢ChebyshevT⁡1,x+27⁢ChebyshevT⁡2,x−2⁢ChebyshevT⁡3,x+27⁢ChebyshevT⁡4,x
C1,C2≔CompanionMatrix⁡p,x
C1,C2≔0012000−44−92000120031−671000120−8−690100012−99−290012000−66−30001200610000012093760000012722,100000000100000000100000000100000000100000000100000000−196−15400000011454
simplify⁡Determinant⁡p−24⁢Determinant⁡C1−x⁢C2
0
M0,M1≔CompanionMatrix⁡y0,y1,y2,x0,x1,x2
M0,M1≔−x000−y00−x10−y100−x2−y21x0−x1⁢x0−x21x1−x0⁢x1−x21x2−x0⁢x2−x10,−10000−10000−100000
p≔Determinant⁡x⁢M1−M0
p≔−x2⁢x0⁢y1−x2⁢x0⁢y2−x2⁢x1⁢y0+x2⁢x1⁢y2+x2⁢x2⁢y0−x2⁢x2⁢y1−x⁢x02⁢y1+x⁢x02⁢y2+x⁢x12⁢y0−x⁢x12⁢y2−x⁢x22⁢y0+x⁢x22⁢y1−x02⁢x1⁢y2+x02⁢x2⁢y1+x0⁢x12⁢y2−x0⁢x22⁢y1−x12⁢x2⁢y0+x1⁢x22⁢y0x0−x2⁢x1−x2⁢x0−x1
Show the Lagrange form of p.
iform≔collect⁡p,y0,y1,y2,factor
iform≔x−x1⁢y0⁢x−x2x0−x1⁢x0−x2−x−x2⁢x−x0⁢y1x0−x1⁢x1−x2+x−x1⁢x−x0⁢y2x0−x2⁢x1−x2
degree⁡p,x
2
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[CharacteristicPolynomial]
LinearAlgebra[DiagonalMatrix]
LinearAlgebra[JordanBlockMatrix]
Download Help Document