I have this dynamic system

$$ J \ddot{\theta} + F\dot{\theta} = u $$

I would like to acquire the state space of the system. This is what I've done $$ x_{1} = \theta, \\ x_{2} = \dot{\theta}, \\ x_{3} = \ddot{\theta} \\ \dot{x_{1}} = x_{2} \\ \dot{x_{2}} = \ddot{\theta} = \frac{1}{J}u - \frac{F}{J} x_{2} \\ \begin{bmatrix} \dot{x_{1}} \\ \dot{x_{2}} \end{bmatrix} = \underbrace{ \begin{bmatrix} 0 & 1 \\ 0 & -\frac{F}{J} \end{bmatrix}}_{A} \begin{bmatrix} x_{1} \\ x_{2} \end{bmatrix} + \underbrace{ \begin{bmatrix} 0 \\ \frac{1}{J} \end{bmatrix}}_{B} u $$

Is it correct? I've tried to double check my work using Laplace transform. $$ G = \frac{Y(s)}{U(s)} = \frac{1}{J s^{2} + Fs} $$

This is the code

>> syms J F
>> b = 1;
>> a = [J, F, 0];
>> [A, B, C, D] = tf2ss(b,a)

A =
[ -F/J, 0]
[    1, 0]

B =
C =
[ 0, 1/J]
D =

Are the results same? Why B in Matlab has no 1/J?

  • $\begingroup$ There is no real point in keeping $x_1$ around. Just use $\dot{\theta}$ as the state variable. $\endgroup$ – copper.hat Aug 17 '14 at 3:21
  • $\begingroup$ I am ignorant in tf/ss terminology, but I can say that your system for $\dot x_1,\dot x_2$ is correct. I wonder why $Y(s)=1$ is the correct choice. Maybe $Y(s)=J$ should be used? (I don't see any explicit output variable here to begin with...) $\endgroup$ – user147263 Aug 17 '14 at 6:23
  • $\begingroup$ @900sit-upsaday, why $Y(s) = 1$? who said so? This is ratio. take the Laplace transform of the differential equation (i.e. $J s^{2} Y(s) + F s Y(s) = U(s) $ and get the ratio of the output to the input (i.e. $Y(s)/U(s)$). $\endgroup$ – CroCo Aug 18 '14 at 15:01
  • $\begingroup$ @copper.hat, actually there is no need for $x_{3}$ not $x_{1}$. the latter represents the angular position which is kind of suitable to name it so that once we get the solution, we can plot it with respect to time. $\endgroup$ – CroCo Aug 18 '14 at 15:18
  • $\begingroup$ Well, you can solve the single dimensional system in $\dot{\theta}$ and then integrate to get a solution. $\endgroup$ – copper.hat Aug 18 '14 at 15:20

You have done your calculations correctly and the results are the same. It looks like different because there are infinitely many state space representation of a system, depending on the choice of state variables.

However, your state space representation is incomplete. Because your system does not have an "output" where you can select a linear combination of the states, using a $C$ matrix, i.e. $y=Cx$.

You can put $1/J$ to either $B$ or $C$ matrix. It is the difference between your transfer function and


  • $\begingroup$ I can get the solution of the system with no need of $C$. So, $\dot{x} = Ax + Bu$ is enough to acquire the solution. $x(t) = e^{At}x_{o} + e^{At} \int_{t_{o}}^t e^{A \tau} B u (\tau) d \tau $. This is because $A$ is time-invariant. With the results that I got, the angular velocity approaches zero when the time goes to infinity. It seems my solution is correct. $\endgroup$ – CroCo Aug 18 '14 at 15:11
  • 1
    $\begingroup$ You get the solution of "states" not "outputs". In the transfer function you implicitly select the state $x_2$ as output, i.e. $C=\begin{bmatrix}0 & 1\end{bmatrix}$. You could select a different output, like the angle itself. Then your transfer function would be different while state solution is the same. $\endgroup$ – obareey Aug 18 '14 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.