I have some governing equations of the form:

$$\begin{align} \ddot \theta(t) &= \frac{MgL + mgl}{J} \theta(t) + \frac B J \dot x(t) - \frac \alpha J V + \frac {mg}{J} d - \frac{c_1}{J} \dot \theta(t) \\ \ddot x &= \frac{\alpha}{R(M+m)} V - \frac{\beta/R + c_2}{M+m} \dot x(t) \end{align} \tag 1$$

And I would like to transform them to the state space. I'd like them final equation to take the form of $\dot z(t) = Az(t)+Bu(t)+T$, where $z(t) = (\theta, \dot \theta, \dot x)$ is the state vector. And I'd like for $U$ to contain $V$ and for $T$ to be a vector containing the disturbance torque $mgd/J$.

How would I go about this? I'm having trouble conceptualizing the internal relationships between the states. How would I write the governing equations in state space form?

And for the measurements, Id like to measure all three states.

  • $\begingroup$ It's not as painful as one might imagine, but I really wish that every poster uses $\LaTeX$ math markup instead of posting pictures of equations. There is even a Stack Exchange for it. $\endgroup$ Commented Jun 20, 2023 at 2:32
  • $\begingroup$ Sometimes if you're a newbie, someone will come along and do it for you -- once. $\endgroup$
    – TimWescott
    Commented Jun 20, 2023 at 3:01
  • 1
    $\begingroup$ I believe you want $z(t) = \begin{bmatrix} \dot \theta & \theta & \dot x \end{bmatrix}^T$. If so, where you want that to appear, edit your question with $z(t) = \begin{bmatrix} \dot \theta & \theta & \dot x \end{bmatrix}^T$. $\endgroup$
    – TimWescott
    Commented Jun 20, 2023 at 3:06
  • $\begingroup$ @TimWescott I have done that for a couple of newbies. But this was a much bigger job and I didn't wanna research how to do single or double dot. $\endgroup$ Commented Jun 20, 2023 at 3:34
  • $\begingroup$ $\ddot \theta$ = $\ddot \theta$. $\endgroup$
    – TimWescott
    Commented Jun 20, 2023 at 14:34

1 Answer 1


Start with $z(t) = \begin{bmatrix} \dot \theta & \theta & \dot x \end{bmatrix}^T$. Take it's derivative: $$ \frac d {dt} z(t) = \begin{bmatrix}\dot \theta \\ \theta \\ \dot x\end{bmatrix} = \begin{bmatrix}\ddot \theta \\ \dot \theta \\ \ddot x\end{bmatrix} $$

Now add the $\frac{d}{dt} \theta$ term to your (1): $$\begin{align} \ddot \theta(t) &= \frac{MgL + mgl}{J} \theta(t) + \frac B J \dot x(t) - \frac \alpha J V + \frac {mg}{J} d - \frac{c_1}{J} \dot \theta(t) \\ \dot \theta &= \dot \theta \\ \ddot x &= \frac{\alpha}{R(M+m)} V - \frac{\beta/R + c_2}{M+m} \dot x(t) \end{align}$$

You should be able to pick out $\mathbf A$ by inspection:

$$ \frac{d}{dt} \begin{bmatrix}\dot \theta \\ \theta \\ \dot x\end{bmatrix} = \begin{bmatrix} - \frac{c_1}{J} & \frac{MgL + mgl}{J} & \frac B J \\ 1 & 0 & 0 \\ 0 & 0 & - \frac{\beta/R + c_2}{M+m} \end{bmatrix} \begin{bmatrix}\dot \theta \\ \theta \\ \dot x\end{bmatrix} + \begin{bmatrix} - \frac \alpha J V + \frac {mg}{J} d \\ 0 \\ \frac{\alpha}{R(M+m)} V \end{bmatrix}$$

I think you should see at this point how to separate out the rest.

  • $\begingroup$ Thank you so much! And sorry about the format once again $\endgroup$
    – skylinev2
    Commented Jun 21, 2023 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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