# 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?

-
I'm downvoting this question because after having been made aware at this question of the need for context, you are again posting a question without context. What are $s$, $x$, $u$ and $y$? –  joriki Oct 5 '11 at 11:13
@madmax If you have added the homework tag, we would understand that you are trying to get things going. People are willing to help here but they have certain ways of havings things under slight discipline. I guess that's why Joriki commented on it as such. I have added an answer. Good luck. –  user13838 Oct 5 '11 at 12:59
To emphasize the ubiquity of these concepts: I agree with @joriki. This almost makes sense to me even though I know no control theory, and hardly anything about DEs, my Laplace transforms are rusty as hell and all :-) Yet I have seen and done similar manipulations with state vectors, state transition matrices and transfer functions in the context of convolutional codes. There time is discrete (measure in integer valued clock ticks), and the inputs/outputs are vectors with elements in the binary field $GF(2)$, i.e. bits. A happy thought: most if not all of mathematics is ubiquitous. –  Jyrki Lahtonen Oct 5 '11 at 13:44
I've cancelled my downvote since the question now provides context. I'm not sure how to interpret your comment "joriki thinks that it is a question without context [...] I can't add more information than that", which you apparently made after adding the additional information, i.e. when the question was no longer in the form I'd originally criticized. –  joriki Oct 5 '11 at 14:01
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