Hi,
For
linear systems of ODEs you can get an
exact solution with
MatrixExp[].
(* NDSolve *)
In[27]:= sol = DSolve[{system, initc}, U[t], t]; // AbsoluteTiming
Out[27]= {20.089043, Null}
(* MatrixExp *)
In[25]:= sol2 = MatrixExp[t A].Table[1, {n + 1}]; // AbsoluteTiming
Out[25]= {0.046551, Null}
(* Compare *)
i = 3;
line1 = First[Subscript[u, i - 1][t] /. sol];
line2 = sol2[[i]];
Plot[{line1, line2}, {t, 0, 4}]
Plot[{line1 - line2}, {t, 0, 4}]
I.M.