State-space realization of transfer function — controllable canonical form

control theorylinear algebralinear-controlmatrices

Given the following transfer function $$ G(s) = \frac{100(s-2)}{(s-3)(s+4)}$$
find matrices $A, B, C, D$ that realize the system.


I know that:

enter image description here

should be the solution, but I am trying to derive it alone and I am stuck.

I started out by:

$$ G(s) = \frac{Y(s)}{X(s)} = \frac{100(s-2)}{(s-3)(s+4)} \Rightarrow y'' +1y' -12y = 100x' -200x $$

but I can't figure out how to proceed.

The solution is:

$$ A = \begin{bmatrix} -1 & 12 \\ 1 & 0 \end{bmatrix}, \qquad B = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \qquad C = \begin{bmatrix} 100 & -200 \end{bmatrix} $$

Thank you for any tips!

Best Answer

Transfer functions do not describe the ratio of the output and the state, but the ratio of the output and the input of a given linear time invariant (LTI) system.

So you have $$ G(s)=\frac{Y(s)}{U(s)}=\frac{100(s-2)}{(s-3)(s+4)} $$ and so $$ \begin{align} Y(s)(s-3)(s+4)&=U(s)100(s-2)\\ Y(s)s^2+Y(s)s-12 Y(s)&=100 U(s)s-200 U(s) \end{align} $$ and so $$ \ddot{y}+\dot{y}-12y=100\dot{u}-200u $$ Now there are two issues: You have a second derivative and an input derivative which are both not present in the state space form $$ \begin{align} \dot{x}=Ax+Bu\\ y=Cx+Du \end{align} $$ First we solve the problem of the second derivative by introducing state variables: $$ \begin{align} z_1&=y\\ z_2&=\dot{y} \end{align} $$ So you get $$ \dot{z}_1=z_2,\dot{z}_2+z_2-12z_1=100\dot{u}-200u $$ Solving for the state derivatives: $$ \begin{align} \dot{z}_1&=z_2\\ \dot{z}_2&=12z_1-z_2+100\dot{u}-200u\\ y&=z_1 \end{align} $$ Now you only need to get rid of the input derivative. This is a question that has been answered several times on this site, for example here or here. You can do this by defining $$ \begin{align} x_1&=z_1+a_1u\\ x_2&=z_2+a_2u \end{align} $$ Now differentiate ... $$ \begin{align} \dot{x}_1&=\dot{z}_1+a_1\dot{u}\\ \dot{x}_2&=\dot{z}_2+a_2\dot{u} \end{align} $$ ... insert $\dot{z}_1,\dot{z}_2$ ... $$ \begin{align} \dot{x}_1&=z_2+a_1\dot{u}\\ \dot{x}_2&=12z_1-z_2+100\dot{u}-200u+a_2\dot{u}\\ y&=z_1 \end{align} $$ ... and replace $z_1$ with $x_1-a_1u$ and $z_2$ with $x_2-a_2u$ to get $$ \begin{align} \dot{x}_1&=x_2-a_2u+a_1\dot{u}\\ \dot{x}_2&=12(x_1-a_1u)-x_2+a_2u+100\dot{u}-200u+a_2\dot{u}\\ y&=x_1-a_1u \end{align} $$ We can see that $a_1$ is not helpful so set it to zero. However $a_2$ can be used to eliminate the $\dot{u}$ term by setting it to $-100$. So we have $a_1=0,a_2=-100$ and so $$ \begin{align} \dot{x}_1&=x_2+100u\\ \dot{x}_2&=12x_1-x_2-300u\\ y&=x_1 \end{align} $$ Or, using the matrix form $\dot{x}=Ax+Bu, y=Cx+Du$ with $$ A=\begin{pmatrix} 0&1\\12&-1 \end{pmatrix},B=\begin{pmatrix}100\\-300\end{pmatrix},C=\begin{pmatrix}1&0\end{pmatrix},D=0 $$ This is different to the stated solution only up to a similarity transformation $q=Tx$ with $$ \begin{pmatrix} q_1\\q_2 \end{pmatrix}=\underbrace{\begin{pmatrix} \frac{1}{50}&\frac{1}{300}\\ \frac{1}{200}&\frac{1}{600} \end{pmatrix}}_{T}\begin{pmatrix} x_1\\x_2 \end{pmatrix} $$ because the transformation used earlier is not unique. Apply this you get $\dot{q}=\hat{A}q+\hat{B}u,y=\hat{C}q+\hat{D}u$ with $$ \hat{A}=TAT^{-1}=\begin{pmatrix} -1&12\\1&0 \end{pmatrix},\hat{B}=TB=\begin{pmatrix}1\\0\end{pmatrix},\hat{C}=CT^{-1}\begin{pmatrix}100&-200\end{pmatrix},\hat{D}=D=0, $$ i.e. the solution stated in your question.