Polynomial Matrices Utilities

This notebook shows the usage of the package polmatrx.m.
For a complete treatment of polynomial matrices theory and for more references see
- (1) KAILATH Thomas, "Linear Systems", Prentice-Hall, 1980
- (2) KUCERA Vladimir, "Analysis and Design of Discrete Linear Control Systems",                Prentice-Hall, New York, 1991
- (3) KUCERA Vladimir, "Discrete Linear Control", Academia of Praha, Praha, 1979.

Load the package polmatrx.m

<<polmatrx.m

and get a list of the loaded functions

?PolynomialMatrices`*

Some examples on how to use all these functions follow.

Hermite, Smith and McMillan forms

These three functions have two versions: one computing only the canonical form

HermiteForm[m={{x^2,x+1,0},{x,x-1,1},{x+1,x,1}}]//MatrixForm

and an extended version that gives also the unimodular matrices that lead to that form

{h,u}=ExtendedHermiteForm[m]

h===Expand[u.m]
Det[u]

The function HermiteForm computes also the Hermite form of matrices with dependent columns:

HermiteForm[{{x,x^2,x},{x^2,x^3,x+1},
      {x^3,x^4,x+2}}]//MatrixForm

The use of the functions for the Smith and McMillan forms is the same as above

SmithForm[m={{x-1,x+1,0},{x,x-2,1},{x+1,2x,1}}]//MatrixForm
{s,u,v}=ExtendedSmithForm[m]
s===Expand[u.m.v]

McMillanForm[m={{x/((x+1)^2(x+2)^2),x/(x+2)^2},
       {-x/(x+2)^2,-x/(x+2)^2}}]
{mc,u,v}=ExtendedMcMillanForm[m]
mc===Simplify[u.m.v]

These functions also work on matrices whose elemtents are polynomials with symbolic coefficients, in this case one must specify which is the indeterminate, otherwise an error message is displayed:

SmithForm[m={{x^2+d x+k,k,0},{d x,k,1},{x,x,d}}]

The right way is

SmithForm[m,x]

Division

The result of LDivision[a,b] is a list {q,r} of the quotient and the remainder obtained by left division of matrix a by matrix b (a=b.q+r). The matrices a and b must have the same number of rows.

{q,r}=LDivision[a={{x^2+2x^4},{1+x+x^2}},
				b={{x^2+1,1},{1,x^2}}]
a===Expand[b.q+r]

The functions LQuotient and LRemainder compute only the left quotient and remainder respectively:

LQuotient[a,b]
LRemainder[a,b]

LGCD computes the greatest common left divisor of two polynomial matrices

g=LGCD[a={{x^2+x},{x^2+x}},b={{x^2,x},{x^2-x+1,x}}]
LRemainder[a,g,x]
LRemainder[b,g,x]

The least common left multiple of two polynomial matrices is given by Llcm

Llcm[{{x-1,1},{x+1,0}},{{x^2,1},{1,0}}]

The function LCoprime is a left coprimality test for polynomial matrices

LCoprime[{{x,x+1,x-2},{0,x,0}},{{x,x-1},{x^2,1}}]

The functions for the right division are: RDivision, RQuotient, RRemainder, RGCD, Rlcm, RCoprime and their usage is the same as above.

Diophantine Equations

The degree of a polynomial vector is the maximun degree of its entries.
The function DiophantineSolve finds two polynomial matrices X, Y (if any) of minimal column degree that solve the equation a.X+b.Y==c, where a, b, c, are polynomial matrices with the same number of rows

a={{1,1},{0,1}};
b={{1-x,2x},{1-x,x}};
c={{1-x},{x^2}};
DiophantineSolve[a,b,c]

It is also possible to compute ALL the minimal column degree solutions of the diophantine equation: it is sufficient to specify one more variable that will be used to describe the free variables of the result

DiophantineSolve[a,b,c,x,t]

For every real or complex value of the t[i]'s this is a minimal column degree solution of the diophantine equation.
The following is an example of a diophantine equation which has no solution:

DiophantineSolve[{{x^2,x}},{{x^3+x}},{{1}}]

Some other useful functions

A matrix is said to be column reduced if its leading coefficient matrix has full column rank. A polynomial matrix can always be put in column reduced form using only elementary operations on the columns, PolynomialColumnReduce computes the unimodular matrix that represents these elementary operations.

m={{x^2-1,x^3},{1,x-1},{2x,1}};
PolynomialColumnReduce[m]

To put the matrix m in column reduced form it is sufficient to postmultiply it by the unimodular matrix just computed

Expand[m.PolynomialColumnReduce[m]]

PolynomialRowReduce[m] computes a unimodular matrix U such that U.m is row reduced.
The function Rank[m] returns the rank of matrix m and EliminateDep[m] eliminates the dependent rows of m:

Rank[m={{x^2-1,x^2},{1,0},{x,1}}]
EliminateDep[m]

The function PolyExtendedGCD is the polynomial version of ExtendedGCD:

?PolyExtendedGCD
PolynomialGCD[x^2-1,x^2+2x+1]
PolyExtendedGCD[{x^2-1,x^2+2x+1}]

PolynomialDegree[m,x] returns the degree of matrix (or vector) m

PolynomialDegree[{{x-1,0},{x^3-x^2+1,x}}]

ExtPolQ[list,x] yields True if all the entries of "list" are polynomials in x or in x^-1

ExtPolQ[{x,x^-1},x]
ExtPolQ[{x^-3,1/x,1},x]