mathematics//linear algebra//matrix exponential

The matrix exponential is the extension of \(e^{x}\) to square matrices, defined by the same power series, and it is the exact solution operator of a linear system \(\dot x=Ax\): it carries a state forward by any time step without approximation, which is how a controller or a Kalman filter running at a fixed rate gets its discrete model. The scalar equation \(\dot x=ax\) has the solution \(x(t)=e^{at}x_0\); the matrix version keeps the same shape.


The matrix exponential is the extension of exe^{x}ex to square matrices, defined by the same power series, and it is the exact solution operator of a linear system x˙=Ax\dot x=Axx˙=Ax: it carries a state forward by any time step without approximation, which is how a controller or a Kalman filter running at a fixed rate gets its discrete model. The scalar equation x˙=ax\dot x=axx˙=ax has the solution x(t)=eatx0x(t)=e^{at}x_0x(t)=eatx0​; the matrix version keeps the same shape.

eAt=I+At+(At)22!+(At)33!+⋯ ,x(t)=eAtx0e^{At}=I+At+\frac{(At)^2}{2!}+\frac{(At)^3}{3!}+\cdots,\qquad x(t)=e^{At}x_0eAt=I+At+2!(At)2​+3!(At)3​+⋯,x(t)=eAtx0​

The series is the definition, never the algorithm. Libraries compute it by scaling and squaring with a Padé approximation (scipy.linalg.expm), and scipy.signal.cont2discrete builds a whole discrete model with it.

Its main use is discretization. A computer applies a command and holds it constant until the next sample, which is what a digital-to-analog converter or a PWM stage does. Under that zero-order hold, the continuous system is exactly equivalent, at the sampling instants, to a discrete one with xk+1=Adxk+Bdukx_{k+1}=A_dx_k+B_du_kxk+1​=Ad​xk​+Bd​uk​ and

Ad=eAΔt.A_d=e^{A\Delta t}.Ad​=eAΔt.

Nothing is approximated at the sampling instants: the only assumption is that the input really stays constant between them. A mass on a spring with damping, AAA with eigenvalues −0.2±1.99j-0.2\pm1.99j−0.2±1.99j, sampled at 10 ms gives AdA_dAd​ with eigenvalues of modulus e−0.2⋅0.01≈0.998e^{-0.2\cdot0.01}\approx0.998e−0.2⋅0.01≈0.998: every continuous eigenvalue λ\lambdaλ maps to eλΔte^{\lambda\Delta t}eλΔt, so a stable continuous system always becomes a stable discrete one, with its eigenvalues inside the unit circle (discrete-time stability).

The cheap alternative, Ad≈I+AΔtA_d\approx I+A\Delta tAd​≈I+AΔt, is the Euler method written as a matrix. It is fine when Δt\Delta tΔt is small against the fastest time constant and wrong when it is not: a fast stable mode can land outside the unit circle and the simulated system explodes while the real one is calm (stiffness).

The input and noise matrices come from the same tool. BdB_dBd​ is an integral of eAτBe^{A\tau}BeAτB over one step, and the process noise of a filter is discretized the same way; both are obtained at once from the exponential of a larger block matrix (Van Loan's method), which cont2discrete and most filter libraries do internally.

On a microcontroller the exponential is usually computed once, offline, for the fixed sample time, and stored as numbers. Recomputing it online only pays when AAA changes with the operating point, as in an extended Kalman filter, where a truncated series of two or three terms is the common compromise.

When AAA has a full set of eigenvectors, eAt=VeΛtV−1e^{At}=Ve^{\Lambda t}V^{-1}eAt=VeΛtV−1 (eigendecomposition): each mode evolves as its own scalar exponential.