# How to create the Smith Mcmillan form of a polynomial matrix?

Here is the matrix:

$$G(s) = \begin{bmatrix} \frac{4}{(s+1)(s+2)} & \frac{-0.5}{s+1} \\ \frac{1}{s+2} & \frac{2}{(s+1)(s+2)}\\ \end{bmatrix}$$

And this should be the final answer: $$M(s) = \bar L(s)G(s) \bar R(s) = \begin{bmatrix} \frac{1}{(s+1)(s+2)} & 0\\ 0 & \frac{s^2+3s+18}{(s+1)(s+2)}\\ \end{bmatrix}$$

Where: $$\bar L(s) = \begin{bmatrix} \frac{1}{4} & 0\\ -2(s+1) & 8\\ \end{bmatrix} \bar R(s) = \begin{bmatrix} 1 & \frac {s+2}{8}\\ 0 & 1\\ \end{bmatrix}$$

I also can't grasp the idea how the uni-modular matrices $\bar L(s)$ and $\bar R(s)$ where derived to setup the smith form M(s).

Would appreciated any answer to this question :)

Smith McMillan is a variation of the Smith Normal Form (SNF) for rational matrices. Basically all we have to do is factor out the least common multiple of the denominators to get a polynomial matrix and apply the SNF

$$P = \begin{bmatrix} \frac{4}{(s+1)(s+2)} & \frac{-0.5}{s+1} \\ \frac{1}{s+2} & \frac{2}{(s+1)(s+2)}\\ \end{bmatrix} = \frac{1}{(s+1)(s+2)} \begin{bmatrix} 4 & -\frac{1}{2}(s+2) \\ s+1 & 2\\ \end{bmatrix} = \frac{1}{(s+1)(s+2)}L^{-1}(s) \begin{bmatrix} 1 & 0 \\ 0 & s^2 + 3s +18\\ \end{bmatrix} R^{-1}(s)$$

And to get the SNF of a matrix what you do is you multiply elementary matrices from the left and right. I.e. row/col swaps or adding a multiple of a row/col onto another. Obviously any constant entry will do.

You start by swapping an non-zero element to the 1-1 position that divides all other elements of the matrix.$^1$ $$\begin{bmatrix} 4 & -\frac{1}{2}(s+2) \\ s+1 & 2\\ \end{bmatrix}$$

So now you we can eliminate the other entries of the first row and column by multiplying the matrix $L_1$ that adds $-\frac 14 (s+1)$ times the first row to the second and the matrix $R_1$ that adds $\frac 18(s+2)$ times the first column to the second from the left/right:

$$\underbrace{\begin{bmatrix} 1 & 0 \\-\frac 14 (s+1) & 1 \end{bmatrix}}_{L_1} \cdot \begin{bmatrix} 4 & -\frac{1}{2}(s+2) \\ s+1 & 2\\ \end{bmatrix} \cdot \underbrace{\begin{bmatrix} 1 & \frac 18(s+2) \\0 & 1 \end{bmatrix}}_{R_1} = \begin{bmatrix} 4 & 0 \\ 0 & \frac 18 (s+1)(s+2) + 2 \end{bmatrix}$$

And now we only need to normalize by multplying the first row/col by $\frac 14$ and $8$ respectively, which we do by setting

$$L = \begin{bmatrix} \frac{1}{4} & 0 \\ 0 & 8 \end{bmatrix} \cdot L_1 = \begin{bmatrix} \frac{1}{4} & 0\\ -2(s+1) & 8 \end{bmatrix}$$

$^1$If such an element does not exist, we take a non-zero element of minimal degree and perform Euclids algorithm and use it to reduce all other elements, then try again.

• I'm still quite confused how did you determine L1 and R1. Can you explain further to me how did you come up to such form? How would I know that such matrices in that form would be give me the SNF? And why would I need to normalize my L1? Let's say, I didn't provide you my uni-modular matrices above, would you still have the same approach to tackle the problem and would you yield the same results? Do you also have references that could let me grasp the concept of elementary matrix operations for me to understand what you did on L1 and R1? Would appreciate any feedback you have. Thanks – Guilan Lim Feb 3 '18 at 8:38
• @GuilanLim I already linked you the wikipedia page for elementary matrices, you should read it. Write down some simple examples for yourself, that will help you more than anything I can say. – Hyperplane Feb 3 '18 at 9:52
• Thanks @Hyperplane. Will try to understand it through the link you send. – Guilan Lim Feb 3 '18 at 11:06

Multiplying $P$ by $(s+1)(s+2)$ gives the matrix $$Q=\begin{pmatrix} 4 & -\frac{s+2}{2} \cr s+1 & 2 \end{pmatrix}$$ The Smith normal form then obviously is $$Q_S=\begin{pmatrix} 1 & 0 \cr 0 & s^2+3s+18 \end{pmatrix}$$ where the transforming matrix $S$ with $SQ_SS^{-1}=Q$ is given by $$S=\begin{pmatrix} 4 & 0 \cr s+1 & \frac{1}{4} \end{pmatrix}$$ Now dividing again by $(s+1)(s+2)$ we obtain your result.