# How to obtain a possible state space representation of this 2nd order transfer function?

I have this 2nd order transfer function: $$G(s) = \frac{2}{s} + \frac{1}{s+2}$$

And I need to find a possible state space representation in the form of:

$$\frac{dx}{dt} = Ax + bu$$ $$y = c^Tx$$

Matrix A
Matrix A is the system matrix, and relates how the current state affects the state change x' . If the state change is not dependent on the current state, A will be the zero matrix. The exponential of the state matrix, eAt is called the state transition matrix.

Matrix B
Matrix B is the control matrix, and determines how the system input affects the state change. If the state change is not dependent on the system input, then B will be the zero matrix.

Matrix C
Matrix C is the output matrix, and determines the relationship between the system state and the system output.

I can see the eigenvalues, they are $s_1 = 0$ and $s_2 = -2$.
So I can write down a diagonal matrix like that I think: $$A = \begin{pmatrix} 0 & 0 \\0 & -2 \end{pmatrix}$$ But know I am stuck.
Is there some sort of trick I can use?

-
Do you know how to obtain minimal realization $G(s) = C(sI-A)^{-1}B+D$ ? – user13838 Oct 5 '11 at 11:55
As one with control background, I know it is indeed a very basic problem in control theory. In fact, you can google it to get good answers. See here lpsa.swarthmore.edu/Representations/SysRepTransformations/… for example. – Shiyu Oct 5 '11 at 15:22

The main tool to use in such exercises is to consider a dummy variable (which turns out to be the state of the system) and describe the input and output in terms of that variable. Let us call it $x(t)$ and its Laplace transformed version $X(s)$.
Then we use the following: $$G(s) := \frac{Y(s)}{U(s)} = \frac{N(s)}{D(s)}\frac{X(s)}{X(s)}$$ where $N,D$ are the numerator and the denominator polynomials of the Laplace indeterminate $s$. such that $G = N/D$. Then apply this simple idea to your transfer function. $$\frac{Y(s)}{U(s)} = \frac{(3s+4)X(s)}{(s^2+2s)X(s)}$$ From this (and from the assumed zero initial conditions) we have, $$Y(s) = (3s+4) X(s) \implies y(t) = 3\dot x(t) + 4x(t)$$ and also $$U(s) = (s^2+2s) X(s) \implies u(t) = \ddot x(t) + 2\dot x(t)$$ Then, rename the variables as $x_1=x,x_2=\dot x$ and fill in the matrices of $A,B,C$ \begin{align} \pmatrix{\dot x\\\ddot x} &= \pmatrix{0 &1\\0 &-2}\pmatrix{x\\ \dot x}+\pmatrix{0\\ 1}u\\ y &= \pmatrix{4&3}\pmatrix{x\\ \dot x} + 0 u \end{align} Note that State-Space realizations are non-unique, you can obtain the $A$ matrix you have proposed by some state transformation. Hence it is not necessarily a mistake. For example, by noticing directly that $$y(t) = \int^t_0 u(\tau)d\tau + e^{-2t}u(t)$$ You can identify the state space matrix entries by inspection e.g. ($\dot x_1 = u$) etc. but then you would probably obtain an $A$ matrix which is $3\times 3$. Therefore, I recommend you to read about minimal realizations of state space systems, which involves controllability and observability for a very good reason.
Can you tell me where you get the "1" in your A matrix and the $\pmatrix{0\\ 1}u$ from? I only get the A matrix I wrote in my question. – madmax Oct 10 '11 at 12:46
@madmax If you write $\ddot x = -2\dot x + u$. Then you only have the input on the bottom row. – user13838 Oct 10 '11 at 13:56
Ok, I understand that. But from where is the top row then? $Y(s) = 3\dot x(t) + 4x(t)$ does not get me to the top row. – madmax Oct 10 '11 at 15:13
@madmax the top row is $\dot x_1 = \dot x_1$ – user13838 Oct 10 '11 at 15:18