May 10, 2024

Matrix Exponential Tutorial: Definition, Calculation, and its Application in Control Engineering and Control Theory – PART 1


In this applied mathematics and control engineering tutorial, we will

1.) Define a matrix exponential
2.) Explain an important application of matrix exponential in control engineering and control theory
3.) Explain how to compute the matrix exponential by using the inverse Laplace transform
4.) Explain how to compute a state trajectory of a linear dynamical system by using the matrix exponential

The YouTube tutorials accompanying this webpage are given below.

Definition of Matrix Exponential

The matrix exponential is defined as a series expansion of a matrix function. In fact, there are many analogies between the matrix exponential and the Taylor series expansion of the exponential scalar function. Consequently, it is a good idea to first revise the basic definition of the Taylor series expansion.

Let f(x) be a differential function of the real variable x. Then, the Taylor series expansion of the function f(x) about the real number b is defined by

(1)   \begin{align*}f(x)=\sum_{i=0}^{\infty} k_{i}(x-b)^{i},\;\; k_{i}=\frac{f^{(i)}(b)}{i!}\end{align*}

where f^{(i)}(b) is the ith derivative of the function f(x) evaluated at b.

Let us expand the function e^{x} around the point b=0. It can easily be shown that

(2)   \begin{align*}e^{x}=1+x+\frac{x^{2}}{2!}+\frac{x^{3}}{3!}+\frac{x^{4}}{4!}+\ldots\end{align*}

Let us substitute x in (2) by a\cdot t, where a is the real number and t is time. As the result, we obtain

(3)   \begin{align*}e^{at}=1+at+a^{2}\frac{t^{2}}{2!}+a^{3}\frac{t^{3}}{3!}+a^{4}\frac{t^{4}}{4!}+\ldots\end{align*}

The matrix exponential is defined as follows. For any n\times n matrix A\cdot t, where A is a matrix, and t is time, we define the matrix exponential as follows

(4)   \begin{align*}e^{At}=1+At+A^{2}\frac{t^{2}}{2!}+A^{3}\frac{t^{3}}{3!}+A^{4}\frac{t^{4}}{4!}+\ldots\end{align*}

By comparing (3) and (4), we can see that the matrix exponential definition is in some sense a generalization for matrices of the Taylor series expansion of the exponential scalar function. Note over here that we defined the matrix exponential by assuming that the matrix in the exponent is equal to the product of A and time t. However, this definition can easily be modified by assuming that At is equal to some matrix B.

However, the main questions are:

  1. What is the motivation for defining the matrix exponential in this way?
  2. What is the connection between the matrix exponential and control engineering and control theory?

We answer these questions in the next section.

Matrix exponential, dynamical systems, and control theory

Let us consider a linear dynamical system

(5)   \begin{align*}\dot{\mathbf{x}}=A\mathbf{x}\end{align*}

where \mathbf{x}\in \mathbb{R}^{n} is the state vector and A is the system matrix. Let us assume that the initial condition of the system is given by \mathbf{x}(0)=\mathbf{x}_{0}.

Let us apply the Laplace transform to the system (16). As a result, we obtain

(6)   \begin{align*}sX(s)-\mathbf{x}_{0}=AX(s)\end{align*}

where X(s) is the Laplace transform of \mathbf{x}. From the last equation, we have

(7)   \begin{align*}(sI-A)X(s)=\mathbf{x}_{0} \\X(s)=(sI-A)^{-1}\mathbf{x}_{0}\end{align*}

Let us apply the inverse Laplace transform to the last equation. As a result, we obtain

(8)   \begin{align*}\mathbf{x}(t)=\mathcal{L}^{-1}\{ X(s)  \} =\mathcal{L}^{-1}\{ (sI-A)^{-1}\mathbf{x}_{0} \}=\mathcal{L}^{-1}\{ (sI-A)^{-1} \}\mathbf{x}_{0}\end{align*}

where \mathcal{L}^{-1}\{\cdot \} is the notation for the inverse Laplace transform.

The matrix (sI-A)^{-1} is called the resolvent matrix of the matrix A. On the other hand, the matrix

(9)   \begin{align*}\Phi (t) =\mathcal{L}^{-1}\{ (sI-A)^{-1} \}\end{align*}

is called the state transition matrix.

Consequently, the equation (8) can be written as follows

(10)   \begin{align*}\mathbf{x}(t)=\Phi (t) \mathbf{x}_{0}\end{align*}

That is the state of the system at the time instant t is calculated by multiplying the state transition matrix \Phi (t) by the initial state \mathbf{x}_{0}.

Next, we will show that the state transition matrix is actually equal to the matrix exponential of At. To show that, we will use this formula

(11)   \begin{align*}(I-Q)^{-1}=I+Q+Q^{2}+Q^{3}+Q^{4}+\ldots \end{align*}

where Q is a matrix. We assume that the series on the right-hand side of this equation converges.

Let us use this formula to represent the resolvent matrix as a series. We have

(12)   \begin{align*}(sI-A)^{-1}& =s^{-1}(I-\frac{A}{s})^{-1}\\&=\frac{1}{s}(I+\frac{A}{s}+\frac{A^{2}}{s^{2}}+\frac{A^{3}}{s^{3}}+\frac{A^{4}}{s^{4}}+\ldots) \\& =\frac{I}{s}+\frac{A}{s^{2}}+\frac{A^{2}}{s^{3}}+\frac{A^{3}}{s^{4}}+\frac{A^{4}}{s^{5}}+\ldots\end{align*}

By taking the inverse Laplace transform, we obtain

(13)   \begin{align*}\Phi(t)& =\mathcal{L}^{-1}\{ (sI-A)^{-1} \}\\& =I+At+A^{2}\frac{t^{2}}{2!}+A^{3}\frac{t^{3}}{3!}+A^{4}\frac{t^{4}}{4!}+\ldots \\& = e^{At}\end{align*}

That is, the state transition matrix is equal to the matrix exponential of At. Also, this simple proof explains the main motivation for defining the matrix exponential as a series. By using this simple result, we can express the state of the system at the time instant t as follows

(14)   \begin{align*}\mathbf{x}(t)=e^{At}\mathbf{x}_{0}\end{align*}

where

(15)   \begin{align*}e^{At}=\Phi (t)  = \mathcal{L}^{-1}\{ (sI-A)^{-1} \}\end{align*}

This formula is important since it tells us that we can compute the matrix exponential by computing the inverse Laplace transform of the resolvent matrix (sI-A)^{-1}. That is, we do not need to directly compute the series expansion given by (4). Direct computation of this expansion might be a tedious task. Instead, we can use the inverse Laplace transform to compute the matrix exponential. Of course, there are also other approaches for computing the matrix exponential. These approaches will be explained in Part 2 of this tutorial.

Computation of Matrix Exponential – Application to State Trajectory Computation

We consider the following problem: Compute the state trajectory of a linear dynamical system

(16)   \begin{align*}\dot{\mathbf{x}}=\begin{bmatrix} 0 & 1\\ -1 & 0 \end{bmatrix}\mathbf{x}\end{align*}

for a general initial condition

(17)   \begin{align*}\mathbf{x}_{0}=\begin{bmatrix} x_{01} \\ x_{02}  \end{bmatrix}\end{align*}

The state trajectory is given by

(18)   \begin{align*}\mathbf{x}(t)=e^{At}\mathbf{x}_{0}\end{align*}

To compute the matrix exponential, we will use the formula (15). First, we need to compute the resolvent matrix. We have

(19)   \begin{align*}sI-A=\begin{bmatrix} s & 0 \\ 0 & s \end{bmatrix} - \begin{bmatrix}   0 & 1\\ -1 & 0  \end{bmatrix} =\begin{bmatrix}s & -1 \\ -1 & s  \end{bmatrix}\end{align*}

The inverse of this matrix is the resolvent matrix, and this inverse is given by

(20)   \begin{align*}(sI-A)^{-1}=\begin{bmatrix} \frac{s}{s^{2}+1}  & \frac{1}{s^{2}+1} \\ - \frac{1}{s^{2}+1}  & \frac{s}{s^{2}+1} \end{bmatrix}\end{align*}

Next, we need to compute the inverse Laplace transform of this matrix. The inverse Laplace transform of a matrix, is obtained by taking inverse Laplace transforms of every entry of the matrix. By applying the inverse Laplace transform to every entry of the matrix (20), we obtain the desired matrix exponential.

(21)   \begin{align*}e^{At}=\begin{bmatrix} \cos(t) & \sin(t) \\ -\sin (t) & \cos(t)  \end{bmatrix}\end{align*}

and consequently, our state trajectory is determined by

(22)   \begin{align*}\mathbf{x}(t)=\begin{bmatrix} \cos(t) & \sin(t) \\ -\sin (t) & \cos(t)  \end{bmatrix} \begin{bmatrix} x_{01} \\ x_{02}  \end{bmatrix}\end{align*}