Differential equation using matrix exponential not consistent solution

discrete timedynamical systemsmatrix exponentialordinary differential equationssolution-verification

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?

Best Answer

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).