第一,这是我的代码: module Problem1 = struct
type aexp =
| Const of int
| Var of string
| Power of string * int
| Times of aexp list
| Sum of aexp list
let diff : aexp * str
K是一个大型稀疏矩阵,y是一个向量。在一个特定的时间步长dt从t1到t1+dt: 方法一: 的expm导致: K = ...
y = ...
y = expm(-1i*dt*K)*y; %new y
方法2: 的ode45给出: K = ...
y = ...
y0 = y;
[T, Y] = ode45(@(t,y)dy(y,K),[t1 t1+dt],y0);
y = Y(e