Linear Systems. Polynomial Matrices.

Needs["PolynomialMatrices`"]

Coprimeness and the Hermite form

Define a transfer function.

G={{1/(s+1),1/((s+1)(s+2))},{s/((s+1)(s+2)),(2 s+1)/((s+1)(s+2))}}

MatrixForm[%]

A simple right numerator.

rN={{s+2,1},{s,2 s+1}}

MatrixForm[%]

A corresponding right denominator.

rD={{s^2+3 s + 2,0},{0,s^2+3 s +2}}

Check that they give the right transfer function

Simplify[rN.Inverse[rD]]

Stack the denominator and numerator matrices in the same matrix in order to check for common right factors.

stack=ArrayFlatten[{{rD},{rN}}]

MatrixForm[%]

Compute the Hermite form. rU is the transforming unimodular matrix.

{rH,rU}=ExtendedHermiteForm[stack,s]

MatrixForm[rH]

The common right factor is the top 2 x 2 matrix. Coprime left and right fractions can be determined from U and V =(U^(-1))

rV=Simplify[Inverse[rU]]

MatrixForm[%]

A right coprime description is given by (Subscript[V, 21]) (Subscript[V, 11])-1.

rNcp=rV[[3;;4,1;;2]]

rDcp=rV[[1;;2,1;;2]]

MatrixForm[rNcp].Inverse[MatrixForm[rDcp]]

Check the resulting transfer function matrix

rG=Simplify[rNcp.Inverse[rDcp]]

A left coprime description is given by -(Subscript[U, 22])-1 (Subscript[U, 21]).

lDcp=-rU[[3;;4,3;;4]]

lNcp=rU[[3;;4,1;;2]]

Inverse[MatrixForm[lDcp]].MatrixForm[lNcp]

lG=Simplify[Inverse[lDcp].lNcp]

The determinants of the denominators should be equal up to a constant.

Simplify[Det[lDcp]/Det[rDcp]]

The determinants of the numerators should be equal up to a constant.

Simplify[Det[lNcp]/Det[rNcp]]

Is the description column reduced?

MatrixForm[rDcp]

The column degrees are k1=2 and k2=1.

Det[rDcp]

The determinant has degree 3 = k1 + k2, so this description is column reduced.