Matrix exponential

Let A(t) be an m×m matrix whose entries depend on t. Then

dudt=A(t)u

is a linear system of differential equations. If the matrix A is independent of time, it is a linear, constant-coefficient system.

The solution to a linear, constant-coefficient IVP, given also u(0)=u0, is formally

u(t)=etAu0,

where etA is a matrix exponential, which can be defined using Taylor series or by other means. This result is a seamless generalization of the scalar case, m=1.

A = [ -2 5; -1 0 ]
Copy to clipboard
2×2 Array{Int64,2}:
 -2  5
 -1  0
Copy to clipboard
u0 = [1,0]
t = LinRange(0,6,600)     # times for plotting
u = zeros(length(t),length(u0))
for j=1:length(t)
    ut = exp(t[j]*A)*u0 
    u[j,:] = ut'
end
Copy to clipboard
using Plots
plot(t,u,label=["\$u_1\$" "\$u_2\$"],xlabel="t",ylabel="u(t)")
Copy to clipboard

However, while the matrix exponential is a vital theoretical tool, computing it is too slow to be a practical numerical method.