[Math] Rewriting differential equation into state space

control theoryordinary differential equations

I have some problems rewriting the following differential equation into state space form. I know the general principle of how it is done, but I'm getting confused of how the states are being defined, and also the additional $t$'s confuse me. So this is the equation:

$$t^3 y^{(3)} + at^2\ddot{y} + 6t\dot{y}+by=cu,\quad t>t_0>0 \quad a,b,c=const$$

The states are specified with $x_1 = y, \, x_2 =t\dot{y}, \, x_3 = t^2\ddot{y}$.

What I did was first calculating the derivatives:

$$\dot{x}_1 = \dfrac{x_2}{t}$$

$$\dot{x}_2 = \dfrac{x_2}{t}+\dfrac{x_3}{t}$$

Then rewriting the differential equation into:

$$t^3y^{(3)} = -a x_3-6 x_2-b x_1+c u$$

Usually the left hand side of the equation would be simply $\dot{x}_3$, but here it isn't. So what I did was calculating $\dot{x}_3$ from $x_3 = t^2\ddot{y}$, which yields $\dot{x}_3 = 2t\ddot{y}+t^2y^{(3)}$. Now I want that to be equal to $t^3y^{(3)}$. So that I can later substitute it in the equation above (is this idea correct?).
$$t^3y^{(3)}= t\dot{x}_3-2x_3$$

I then set that into the equation above and end up with:

$$\dot{x}_3 = \left(\dfrac{2-a}{t}\right)x_3 – \dfrac{6}{t}x_2 -\dfrac{b}{t}x_1 + \dfrac{c}{t}u$$

In state space I then get this:
$$\dot{x} =
\begin{bmatrix}
0 & \dfrac{1}{t} & 0 \\
0 & \dfrac{1}{t} & \dfrac{1}{t} \\
-\dfrac{b}{t} & -\dfrac{6}{t} & \dfrac{2-a}{t} \\
\end{bmatrix}
x +
\begin{bmatrix}
0 \\ 0 \\ \dfrac{c}{t}
\end{bmatrix}
u$$

$$y=\begin{bmatrix}
1 & 0 & 0
\end{bmatrix}
\quad x$$

Is this correct? If not, what am I doing wrong?

Best Answer

In general, the state space representation is not unique - you have a choice as to what coordinatization to pick for the state space. For your ODE $$ t^3 y^{(3)} + at^2\ddot{y} + 6t\dot{y}+by=cu $$ I wonder why you don't simply pick $$ x_1 = y,\, x_2 = \dot{y}, x_3 = \ddot{y} \text{.} $$ In those state-space coordinates, you can write your original ODE as the implicitly system of ODEs $$\begin{eqnarray} \dot{x}_1 &=& x_2 \\ \dot{x}_2 &=& x_3 \\ t^3\dot{x}_3 &=& -at^2x_3 - 6tx_2 - bx_1 + cu\\ \end{eqnarray}$$ which in matrix representation becomes $$ \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & t^3 \end{pmatrix}\cdot \dot{x} = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ -b & -6t & -at^3 \\ \end{pmatrix}\cdot x + \begin{pmatrix} 0 \\ 0 \\ cu \end{pmatrix} \text{.} $$ By using that $t > 0$, you can alternatively write your original ODE as the explicit system $$\begin{eqnarray} \dot{x}_1 &=& x_2 \\ \dot{x}_2 &=& x_3 \\ \dot{x}_3 &=& -\tfrac{a}{t}x_3 - \tfrac{6}{t^2}x_2 - \tfrac{b}{t^3}x_1 + \tfrac{c}{t^3}u\\ \end{eqnarray}$$ which in matrix representation becomes $$ \dot{x} = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ \tfrac{-b}{t^3} & \tfrac{-6}{t^2} & \tfrac{-a}{t} \\ \end{pmatrix}\cdot x + \begin{pmatrix} 0 \\ 0 \\ \frac{c}{t^3}u \end{pmatrix} \text{.} $$ Note that the implicit system can be transformed to the explicit system by multiplying with the inverse of the matrix attached to $\dot{x}$, if that matrix is invertible.

Related Question