f(t,y)=3y
初始条件什么y(t)=0
时候t=0
解决t=1
我不想在数字上解决它,而更像是符号函数。我无法提供一种查找y(t)
时间的方法t=1
syms y(t);
ode= diff(y,t) == 3*y;
cond= y(0) == 0;
ySol(t) = dsolve(ode,cond);
fplot(ySol)
我已经用数值解决了这个函数,需要将它与真正的解决方案进行比较,我试图在 Matlab 上找到一种方法
这样做
syms y(t);
ode= diff(y,t) == 3*y;
cond= y(0) == 0;
ySol = dsolve(ode,cond)
你应该得到类似的东西:ySol=0
评估你的符号表达式使用subs
subs(ySol, t, 1)
应该返回 0
和double(subs(ySol, t, 1))
应该返回0.0