How does state transition matrix works

293 Views Asked by At

Suppose I have a simple vehicle moving in 2D. The state vector for the vehicle is X=[x y vx vy ax ay], that is, it contains the position (x,y), the velocity (vx, vy) and the acceleration (ax, ay) of the vehicle. assume the accelerations on x and y are constant and the linear model for a control system looks like this.

X(t) = AX(t-1) + Bu

What is the matrix A for the state vector x? I have look online by don't understand the examples. Any help is appreciated. Thanks

1

There are 1 best solutions below

0
On

First, let's start with some clean definitions and more standard notation. Usually, the dynamics will be described in continuous time as:

$ \dot{\mathbf{x}}(t) = A\mathbf{x}(t) + B \mathbf{u}(t)$

Or in discrete time as

$\mathbf{x}[k+1] = A\mathbf{x}[k] + b \mathbf{u}[k]$

Note that I used bold $\mathbf{x}$ for your state-vector, because usually we reserve capital letters for matrices. I'll be using continuous-time notation from now.
Now that we have that out of the way, what should we actually put in the state vector $x$? Anything that is dynamic and changes with time. Almost always this goes up to, but not including accelerations! So for your case, that would mean:

$\mathbf{x} = \left ( \begin{array}{c} x_1 \\ x_2 \\ x_3 \\ x_4 \end{array} \right ) = \left ( \begin{array}{c} x \\ y \\ \dot{x} \\ \dot{y} \end{array} \right ) $

This way, when we write the dynamics of our state vector, we get all the dynamics we want:

$ \dot{\mathbf{x}} = \left ( \begin{array}{c} \dot{x} \\ \dot{y} \\ \ddot{x} \\ \ddot{y} \end{array} \right ) = \left ( \begin{array}{c} x_3 \\ x_4 \\ f_1 \\ f_2 \end{array} \right ) $

Where I used $f_1,\,f_2$ as placeholders for those constants you said the acceleration should be. Note that in general, you would find some function $f(x)$ that describes your acceleration, and plug it in there.

So now, you want to write $\dot{\mathbf{x}}$ in terms of $\mathbf{x}$. So how do you do this?

$ \dot{\mathbf{x}} = \left ( \begin{array}{c} x_3 \\ x_4 \\ f_1 \\ f_2 \end{array} \right ) = \left ( \begin{array}{cccc} ? & ? & ? & ? \\ ? & ? & ? & ? \\ ? & ? & ? & ? \\ ? & ? & ? & ? \\ \end{array} \right )\left ( \begin{array}{c} x_1 \\ x_2 \\ x_3 \\ x_4 \end{array} \right ) = \left ( \begin{array}{cccc} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{array} \right )\left ( \begin{array}{c} x_1 \\ x_2 \\ x_3 \\ x_4 \end{array} \right ) + \left ( \begin{array}{c} 0 \\ 0 \\ f_1 \\ f_2 \end{array} \right ) $

So, notice that here I added a feed-through term containing $f_1, \, f_2$, because they are not dependent on your states! This is because you said the accelerations are constant, meaning that the dynamics of your velocities do not change with time, they stay constant! Well, then you don't need to put them in you state-vector huh? I'm guessing that you've just made a simplified version of the problem to post here, and you can actually choose what $f_1,\,f_2$ are. These would then actually be your control input $\mathbf{u}$, and instead of being a simple feed-through, they would go into the term $B\mathbf{u}$. The way of finding and writing $B$ is much the same, and I'll leave it to you.