Mathematica by default puts state space model realizations in controllable companion form, as seen here:
tfsys = TransferFunctionModel[(b1 s^2 + b2 s + b3)/(s^3 + a1 s^2 +
a2 s + a3 ), s];
StateSpaceModel[tfsys]
Which outputs a block matrix like:
$$
\begin{bmatrix}0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ -a_3 & -a_2 & -a_1 & 1 \\ b_3 & b_2 & b_1 & 0\end{bmatrix}
$$
However, I want it in controllable canonical form, which should look like:
$$
\begin{bmatrix}-a_1 & -a_2 & -a_3 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ b_1 & b_2 & b_3 & 0\end{bmatrix}
$$
StateSpaceModel
offers the StateSpaceRealization
option but it only has ControllableCompanion
and ObservableCompanion
, neither of which is what I want. Is there a simple way of getting the right state space form?