# differential equation using matrix exponential not consistent solution

For the differential equation (physical friction)

$$\ddot x=-a\cdot \dot x$$

The solution can be easily found using exponential ansatz and is

$$x(t)=c_1+c_2 \exp(-a\cdot t)$$

Or expressing this using initial conditions $$x_0:= x(0)=c_1+c_2$$, $$v_0:=\dot x(0)=-a c_2$$ it can be written as $$x(t)=1\cdot x_0+\left(\frac 1 a - \frac {\exp(-at)} a \right) {v_0 }$$, $$v(t)={\exp(-at)}\cdot {v_0 }$$ .

Putting into matrix form it is:

$$\begin{pmatrix} x(t) \\ \dot x(t) \end{pmatrix} = \begin{pmatrix} 1 & \frac {1-\exp(-at)} a \\ 0 & \exp(-at) \end{pmatrix} \begin{pmatrix} x(0) \\ \dot x(0) \end{pmatrix}$$

Now however when we use matrix exponential the solution differs! The upper solution seems more reasonable since for vanishing speed we get the position back.

$$\mathbf{\dot x} = \begin{pmatrix} \dot x \\ \ddot x \end{pmatrix} = \begin{pmatrix} 0& 1\\ 0 & -a \end{pmatrix} \begin{pmatrix} x \\ \dot x \end{pmatrix} =A \mathbf{x}$$

It should be $$\mathbf{x}=\exp(At) \mathbf{x_0}$$, so that both solutions could be compared using $$\exp(At) = \begin{bmatrix} 1 & \exp(t)\\ 1 & \exp(-at) \end{bmatrix}$$ but they do not coincide.

Matrix exponential calculation

What/where is the issue/error/misunderstanding?

The exponential matrix is incorrect. Observe that

$$(s I - A)^{-1} = \begin{bmatrix} s & -1 \\ 0 & s + a\end{bmatrix}^{-1} = \frac{1}{s(s+a)} \begin{bmatrix} s + a & 1\\ 0 & s\end{bmatrix}.$$

Simplifying,

$$(s I - A)^{-1} = \begin{bmatrix} \frac{1}{s} & \frac{1/a}{s} + \frac{-1/a}{s+a} \\ 0 & \frac{1}{s + a}\end{bmatrix}.$$

Computing the inverse Laplace we find,

$$\exp(A t) = \mathcal{L}^{-1}\{ (s I - A)^{-1} \} = \begin{bmatrix} 1 & \frac{1}{a} - \frac{1}{a}\exp(-a t) \\ 0 & \exp(-a t) \end{bmatrix}$$

which is consistent with your ansatz solution. Check how you computed your exponential matrix. It looks like you did a term-by-term exponential, which is almost never correct (only works for diagonal matrices).

• Did you use Neuman inversion of geometric series or how does that work with Laplacian, could you elaborate? L(exp(At))=[sI-A]^(-1) Commented Mar 5, 2022 at 16:56
• That's the Laplace transform (and its associated inverse operation). The term by term Laplace transform of $\exp(A t)$ is $(s I - A)^{-1}.$ Commented Mar 5, 2022 at 17:33
• Is it a more robust or easier method to calculate matrix exponential? Btw I used WolframAlpha as linked in the question, is my input wrong? Commented Mar 5, 2022 at 22:28
• You'll want to use this command instead; it is (expm) not (exp). Commented Mar 5, 2022 at 22:31
• Good to know, it was only the wrong input. One has to watch out with the commands, also for MatrixLog. Commented Mar 6, 2022 at 10:17