Lesson 14 of 15

Matrix Exponential

Matrix Exponential

The matrix exponential eAe^A extends the scalar exponential to matrices via the Taylor series:

eA=I+A+A22!+A33!+A44!+e^A = I + A + \frac{A^2}{2!} + \frac{A^3}{3!} + \frac{A^4}{4!} + \cdots

Applications

  • Differential equations: the solution to x˙=Ax\dot{x} = Ax with x(0)=x0x(0) = x_0 is x(t)=etAx0x(t) = e^{tA} x_0
  • Control theory: state transition matrices
  • Quantum mechanics: time evolution operator

Algorithm

Accumulate terms until convergence:

result=I,term=I,for k=1,2,3,:term=term×A/k,result+=term\text{result} = I, \quad \text{term} = I, \quad \text{for } k = 1, 2, 3, \ldots: \quad \text{term} = \text{term} \times A / k, \quad \text{result} += \text{term}

Example: Rotation Generator

The matrix A=(0110)A = \begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix} is the generator of 2D rotation. Its exponential is exactly the rotation matrix:

eA=(cos(1)sin(1)sin(1)cos(1))(0.54030.84150.84150.5403)e^A = \begin{pmatrix}\cos(1) & \sin(1) \\ -\sin(1) & \cos(1)\end{pmatrix} \approx \begin{pmatrix}0.5403 & 0.8415 \\ -0.8415 & 0.5403\end{pmatrix}

Your Task

Implement mat_exp(A, terms=20) using the Taylor series. Use matrix multiplication to compute successive powers of A.

Python runtime loading...
Loading...
Click "Run" to execute your code.