Modern control: Solutions & state transition matrices

Monday, Sep 24, 2018
Section: Home / Post / Control systems
Categories: Engineering,
Tags: Matlab, Control Systems,


The state equation for a linear time-invariant system:

$$ x’(t) = A x(t) + B u(t) $$

Can be solved for $x(t)$. We collect all terms in $x$:

$$ x’(t) - A x(t) = B u(t) $$

Multiply equation by $e^{-At}$

$$ x’(t) e^{-At} - A x(t) e^{-At} = B u(t) e^{-At} $$

Using product rule $d(f;g) = f;dg + g;df$, where:

$$ \begin{align*} df = - A e^{-At} \rightarrow & f = e^{-At} \\ dg = x'(t) \rightarrow & g = x(t) \\ \\ \therefore x'(t) e^{-At} - A x(t) e^{-At} &= d (e^{-At} x(t)) \end{align*} $$

To give:

$$ \frac{d}{dt} (e^{-At} x(t)) = B u(t) e^{-At} $$

Which can be integrated on the limits $t = t_0 \rightarrow t$:

$$ \begin{align*} e^{-At} x(t) \rvert_{t_0}^{t} &= B \int_{t_0}^{t} u(t) e^{-At} \; dt \\ e^{-At} x(t) &= e^{-At_0} x(t_0) + B \int_{t_0}^{t} u(t) e^{-At} \; dt \end{align*} $$

The solution to the state equation is:

$$ x(t) = e^{A(t-t_0)} x(t_0) + B e^{At} \int_{t_0}^{t} u(t) e^{-At} \; dt $$

This can be plugged into the output equation to compute system outputs.

State transition matrix

The term $e^{At}$ is called the state transition matrix. It is an exponental of the system matrix which relates the change in state to the current state. The exponential can be calculated in several ways through Taylor series expansion an inverse laplace transform, spectral decomposition, or the Cayley-Hamilton theorem.

In MatLab:

1
2
3
A = [1 2; 3 4]      % A is some matrix
t = sym('t')        % create symbol
eAt = expm(A * t)   % compute exponential

For the case of time-varying systems, the state transition matrix is not a simple exponential but a function $\phi(t, t_0)$ unique to the system. The general solution of the state equation for time-varying systems becomes:

$$ x(t) = \phi(t, t_0) x(t_0) + \int_{t_0}^{t} \phi(t, t_0) B(t) u(t) \; dt $$

More details on the general solution can be found in the WikiBook.

Example - spring mass system

Using the matrices found in the last post, we have the state space matrices:

$$ A = \begin{bmatrix} 0 & 1 \\ \frac{-k}{m} & \frac{-a}{m} \end{bmatrix}, B = \begin{bmatrix} 0 \\ \frac{1}{m} \end{bmatrix}, C = \begin{bmatrix} 1 & 0 \end{bmatrix}, D = \begin{bmatrix} 0 \end{bmatrix} $$

Making some assumptions for the constants, we can define the matrices in MatLab:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
m = 10;                 % setting constants
k = 2;
a = 3;

A = [0 1; -k/m -a/m];   % defining state-space matrices
B = [0; 1/m];
C = [1 0];
D = [0];

sys = ss(A, B, C, D);   % defining the system

Impulse response

Using the matlab command, we get:

1
impulseplot(sys, 10)

Impulse response

Using the matlab command, we get:

1
stepplot(sys, 10)


comments powered by Disqus