Dynamic Systems:

Matrix Exponential

By Prof. Seungchul Lee
http://iai.postech.ac.kr/
Industrial AI Lab at POSTECH

# 1. Matrix Exponential¶

• Starting from single variable (scalar case)
$$\dot{u}=au \quad \implies \quad u(t)=e^{at}u(0)$$
• Extending to multivariate case (matrix)
$$\dot{\vec{u}}=A\vec{u} \quad \implies \quad \vec{u}(t) = \underbrace{e^{At}}_{\text{matrix exponential}}\vec{u}(0)$$
• Matrix Exponential with Diagonal Matrix (intuitive)
\begin{align*} e^{\Lambda t} &= \exp{\left( \, \begin{bmatrix} \lambda_1 & &\\ & \ddots & \\ & & \lambda_n \end{bmatrix} t \,\right)} \\ \\ & = \begin{bmatrix} e^{\lambda_1 t} & & 0 \\ & \ddots & \\ 0 & & e^{\lambda_n t} \end{bmatrix} \end{align*}
• Revisit
\begin{align*} S &= \begin{bmatrix} \vec{x}_1 & \vec{x}_2 \end{bmatrix} \quad \text{ where } \vec{x}_i \text{ is eigenvectors}\\ \\ AS &= S\Lambda\\ \implies \Lambda &= S^{-1}AS \\ \implies A &= S\Lambda S^{-1} \end{align*}
• Think about $e^x$
\begin{align*} e^x &= 1+x+{x^2\over2!}+{x^3\over3!}+\cdots+{x^k\over k!} + \cdots \\ e^0 &= 1 \\ \\ {d \over dx}e^x &= 0+1+x+{x^2\over2!}+\cdots+{x^{k-1}\over ({k-1})!} + \cdots \\ & = e^x \\ \\ \therefore \; e^x &\text{ is a solution of } \dot{y}(x) = y(x) \end{align*}
• In a similar fashion
\begin{align*} e^A &= I+A+{A^2\over2!}+{A^3\over3!}+\cdots \\ \\ e^{At} &= I+At+{A^2t^2\over2!}+{A^3t^3\over3!}+\cdots \end{align*}

• Derivative:
$$\frac{d}{dt}e^{At} = \frac{d}{dt} \sum_{k=0}^{\infty} \frac{(At)^k}{k!} = 0 + \sum_{k=1}^{\infty} \frac{kA^kt^{k-1}}{k!} = A\sum_{k=1}^{\infty} \frac{(At)^{k-1}}{(k-1)!} = A \sum_{k=0}^{\infty} \frac{(At)^k}{k!} = A e^{At}$$

• Similarity transformation
\begin{align*} e^A = e^{S\Lambda S^{-1}} &= I + S\Lambda S^{-1} + {S\Lambda^2 S^{-1} \over 2!} + {S\Lambda^3 S^{-1} \over 3!} + \cdots \\ & = S \begin{bmatrix} I + \Lambda + {\Lambda^2 \over 2!} + {\Lambda^3 \over 3!} + \cdots \end{bmatrix} S^{-1}\\ & = Se^{\Lambda}S^{-1}\\ \\ e^{At} = e^{S \Lambda S^{-1} t} & = Se^{\Lambda t}S^{-1} \end{align*}

# 2. MATLAB Implementation¶

\begin{align*} \left[ {\begin{matrix} \dot{x}_1 \\ \dot{x}_2 \\ \end{matrix} } \right] &= \left[ {\begin{matrix} 0 & 1 \\ -\omega_n^2 & -2\zeta \omega_n \\ \end{matrix} } \right] \left[ {\begin{array}{cc} x_1 \\ x_2 \\ \end{array} } \right] \\ \\y & = \left[ {\begin{matrix} 1 & 0 \end{matrix} } \right] \left[ {\begin{array}{cc} x_1 \\ x_2 \\ \end{array} } \right] \end{align*}

• Simulation with $\omega_n = 2$, and $\zeta = 0.1$
In [1]:
% method 1: use expm (matrix exponential)

wn = 2; zeta = 0.1;
A = [0 1;-wn^2 -2*zeta*wn];

x0 = [1; 0];
t = linspace(0,20,200);
x = [];

for i = 1:length(t)
x = [x, expm(A*t(i))*x0];
end

plot(t,x(1,:),t,zeros(size(t)),'--k')


In [2]:
%%html
width="420" height="315" frameborder="0" allowfullscreen></iframe></center>

In [3]:
%%html

%%html

%%javascript