Rewriting differential equation into state space

8.7k Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

So here is my final response to complete this topic.

My state-space form is perfectly fine - also the one proposed by fgp. It's, as fgp already said, just one of multiple realizations. However, what is very handy with the particular definition of the states in my question, is that the time-dependent factor, in this case $1/t$ can be pulled out of the system equation. This means by use of time transformation, you can transform the system into a time-independent version, which can be very useful.

For this case, the time transformation looks as the following. You define $\tau = \ln(t)$, respectively $t=e^\tau$ and try to bring it into a time-invariant form for $z(\tau)=x(e^\tau)$: $$x(t)=z(\tau(t))$$ From this you can define the following: \begin{align} \dfrac{dx}{dt} &= \dfrac{dz}{dt} \cdot \dfrac{d\tau}{dt} \\ \dfrac{d\tau}{dt}&=\dfrac{d}{dt}(\ln(t))=\dfrac{1}{t} \end{align} So by multiplying the state space system by $t$ you can remove time dependency: \begin{equation} \dot{z} = Az+bu \end{equation}

4
On

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.