Linear Algebra · Differential Equations · Numerical Methods

Matrix Exponential Simulator

Calculate the matrix exponential \(e^{tA}\) and solve systems of linear differential equations. Experiment with different matrices, initial conditions, and time values, then visualize how the system evolves.

Interactive matrix calculator

Calculate the Matrix Exponential

Enter a square coefficient matrix \(A\), an initial state vector \(\mathbf{x}(0)\), and a time value \(t\). The simulator calculates \(e^{tA}\) and uses it to obtain the solution \(\mathbf{x}(t)=e^{tA}\mathbf{x}(0)\).

Enter a square matrix with 2 to 4 rows. Separate columns using spaces or commas.
Enter one number for each row of A. Example: 1, 0.
Negative, zero, and positive time values are supported.
The graph starts at time 0 and ends at this value.
Differential equations

What Is the Matrix Exponential?

The matrix exponential is a matrix-valued function that generalizes the ordinary scalar exponential function. It is particularly important in the study of systems of linear differential equations with constant coefficients.

For a square matrix \(A\), its exponential is defined by the infinite power series:

\[ e^A=I+A+\frac{A^2}{2!}+\frac{A^3}{3!} +\cdots =\sum_{k=0}^{\infty}\frac{A^k}{k!} \]

The identity matrix \(I\) plays the role of the scalar 1. Every power of \(A\) is a matrix of the same dimension, so the terms can be added together.

Unlike the determinant or inverse, the matrix exponential exists for every finite square matrix. Its defining series converges for every such matrix.

Why Is It Useful for Differential Equations?

Consider a system of first-order linear differential equations:

\[ \begin{aligned} x_1'(t)&=a_{11}x_1(t)+a_{12}x_2(t)+\cdots+a_{1n}x_n(t)\\ x_2'(t)&=a_{21}x_1(t)+a_{22}x_2(t)+\cdots+a_{2n}x_n(t)\\ &\vdots\\ x_n'(t)&=a_{n1}x_1(t)+a_{n2}x_2(t)+\cdots+a_{nn}x_n(t) \end{aligned} \]

These equations can be written more compactly in matrix form:

\[ \mathbf{x}'(t)=A\mathbf{x}(t) \]

If the initial state is \(\mathbf{x}(0)=\mathbf{x}_0\), the unique solution is:

\[ \boxed{\mathbf{x}(t)=e^{tA}\mathbf{x}_0} \]

The matrix exponential therefore acts as a transition operator: it transforms the initial state into the state at time \(t\).

How Does the Formula Work?

Differentiating the matrix exponential power series term by term gives:

\[ \frac{d}{dt}e^{tA}=Ae^{tA}=e^{tA}A \]

Therefore, if \(\mathbf{x}(t)=e^{tA}\mathbf{x}_0\), then:

\[ \begin{aligned} \mathbf{x}'(t) &=Ae^{tA}\mathbf{x}_0\\ &=A\mathbf{x}(t) \end{aligned} \]

At \(t=0\), the exponential is the identity matrix:

\[ e^{0A}=I \] \[ \mathbf{x}(0)=I\mathbf{x}_0=\mathbf{x}_0 \]

Thus, the formula satisfies both the differential equation and its initial condition.

Worked example

A Two-Variable Differential Equation

Consider the system:

\[ \begin{cases} x'(t)=y(t)\\ y'(t)=-2x(t)-3y(t) \end{cases} \]

Its matrix representation is:

\[ \mathbf{x}'(t)= \begin{pmatrix} 0&1\\ -2&-3 \end{pmatrix} \mathbf{x}(t) \]

Therefore:

\[ A= \begin{pmatrix} 0&1\\ -2&-3 \end{pmatrix} \]

Choose the initial condition:

\[ \mathbf{x}(0)= \begin{pmatrix} 1\\0 \end{pmatrix} \]

The characteristic polynomial is:

\[ \det(\lambda I-A) =\lambda^2+3\lambda+2 =(\lambda+1)(\lambda+2) \]

The eigenvalues are \(-1\) and \(-2\). The matrix exponential for this example is:

\[ e^{tA}= \begin{pmatrix} 2e^{-t}-e^{-2t}&e^{-t}-e^{-2t}\\ -2e^{-t}+2e^{-2t}&-e^{-t}+2e^{-2t} \end{pmatrix} \]

Multiplying by the initial vector gives:

\[ \mathbf{x}(t)= \begin{pmatrix} 2e^{-t}-e^{-2t}\\ -2e^{-t}+2e^{-2t} \end{pmatrix} \]

Both components decay toward zero as time increases. Load the decay-system preset in the simulator to reproduce this example numerically.

Important properties

Properties of the Matrix Exponential

1. Identity at Zero

\[ e^{0A}=I \]

At time zero, the system has not evolved, so the transition matrix is the identity.

2. Inverse Property

\[ (e^{tA})^{-1}=e^{-tA} \]

The exponential matrix is always invertible. Moving forward in time by \(t\) can be reversed by applying the exponential with time \(-t\).

3. Composition Property

\[ e^{(t+s)A}=e^{tA}e^{sA} \]

For the same constant matrix \(A\), evolution over two consecutive time intervals is equivalent to evolution over their combined interval.

4. Determinant

\[ \det(e^{tA})=e^{t\,\mathrm{tr}(A)} \]

The determinant of the exponential matrix is positive for real \(A\) and real \(t\). The trace of \(A\) therefore determines the volume scaling of the linear transformation.

5. Commuting Matrices

\[ AB=BA \quad\Longrightarrow\quad e^{A+B}=e^Ae^B \]

This property requires the matrices to commute. It is not generally valid for arbitrary matrices.

Eigenvalues and system behavior

How Eigenvalues Affect Differential Equation Solutions

The eigenvalues of the coefficient matrix help explain the behavior of a linear differential equation system. If \(A\mathbf{v}=\lambda\mathbf{v}\), then:

\[ e^{tA}\mathbf{v}=e^{\lambda t}\mathbf{v} \]

This means that an eigenvector direction evolves according to an exponential function determined by its eigenvalue.

Negative Real Eigenvalues

Negative real eigenvalues correspond to exponential decay along their associated eigenvector directions. If all eigenvalues have negative real parts, the constant coefficient system is asymptotically stable.

Positive Real Eigenvalues

Positive real eigenvalues produce exponential growth along corresponding directions. Such a system is unstable.

Complex Eigenvalues

Complex-conjugate eigenvalues can produce oscillations. Their real parts determine whether the oscillations decay, remain bounded, or grow.

\[ \lambda=\alpha\pm i\beta \] \[ e^{\lambda t} =e^{\alpha t} \left(\cos(\beta t)+i\sin(\beta t)\right) \]

The factor \(e^{\alpha t}\) controls growth or decay, while \(\beta\) determines the oscillation frequency.

Applications

Applications of the Matrix Exponential

1. Engineering and Control Systems

State-space models use matrix exponentials to describe the evolution of electrical, mechanical, and control systems with constant system matrices.

2. Mechanical Vibrations

Coupled differential equations describe oscillating mechanical systems. Matrix methods help analyze vibration modes and their time evolution.

3. Electrical Circuits

Capacitors, inductors, and resistors can be modeled through systems of differential equations. Matrix exponentials provide solutions for constant-coefficient state-space representations.

4. Population Models

Linear compartment and population models can describe transfers between groups or states over time. The matrix exponential provides their continuous-time solution when the transition coefficients are constant.

5. Physics and Dynamical Systems

Linearized physical systems, coupled processes, and certain quantum-mechanical evolution equations use matrix exponential operators.

6. Numerical Analysis

The matrix exponential is a central matrix function in numerical linear algebra. Its computation connects power series, eigenvalues, matrix decompositions, and scaling-and-squaring algorithms.

Frequently asked questions

Matrix Exponential Simulator FAQ

1. What does this matrix exponential calculator do?

It calculates an approximation of \(e^{tA}\) for an entered square matrix and time value. It also calculates the solution vector for the initial value problem \(\mathbf{x}'=A\mathbf{x}\).

2. What is the difference between e^A and e^(tA)?

\(e^A\) is the exponential of a matrix \(A\). \(e^{tA}\) is the exponential of the matrix scaled by a scalar time parameter \(t\). The latter is commonly used to solve constant-coefficient differential equation systems.

3. Does the matrix exponential exist for every square matrix?

Yes. The defining power series converges for every finite square matrix, including singular and non-diagonalizable matrices.

4. Does the matrix have to be diagonalizable?

No. Diagonalization is one way to calculate the matrix exponential when a suitable diagonalization exists, but the matrix exponential is defined even for non-diagonalizable matrices.

5. Why is the initial vector required?

The matrix exponential describes the system's evolution, but a specific solution trajectory requires an initial state. The initial vector determines which trajectory is followed.

6. Can the matrix exponential represent a rotation?

Yes. For example, a skew-symmetric matrix can generate a rotation through its exponential. Such matrices are useful in geometry, mechanics, and physics.

7. What is scaling and squaring?

It is a numerical technique that computes an exponential of a smaller scaled matrix and then squares the result repeatedly. It is a practical way to evaluate matrix exponentials while controlling the size of the intermediate Taylor-series calculation.

8. What does a stable system mean?

For a constant-coefficient continuous-time linear system, asymptotic stability occurs when all eigenvalues of the coefficient matrix have strictly negative real parts. Solutions then approach zero as time tends to positive infinity.

9. Can I enter a negative time value?

Yes. The matrix exponential is defined for negative as well as positive real values of time. A negative time value evaluates the inverse evolution operator \(e^{-tA}\) when \(t\) is positive.

10. Is this calculator suitable for large matrices?

It is designed for educational experiments with small matrices of dimensions 2 to 4. Large-scale scientific calculations should use specialized numerical libraries designed for matrix exponentials.

Continue learning

Related Matrix Calculators and Simulators

Explore the linear algebra concepts and numerical methods connected to matrix exponentials and differential equations.