d2/dt2*i(t)+25 d/dti(t)+100 *i(t)= 300
我想用二阶导数方程绘制x:time,y:i(t)图,我也用matlab
syms i(t)
eq = diff(i(t),t,2) + 25*diff(i(t),t) + 100*i(t) == 300;
condition = i(0) == 0 ;
sol(t) = dsolve(eq, condition) ;
fplot(sol, [0,5]);
xlabel('Time (s)'); ylabel('i(t)');
然而,错误是这样出现的:使用fplot〉singleFplot的错误(第240行)输入必须是一个或多个单变量的函数。
Error in fplot>@(f)singleFplot(cax,{f},limits,extraOpts,args) (line 200)
hObj = cellfun(@(f)
singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);
Error in fplot>vectorizeFplot (line 200)
hObj = cellfun(@(f)
singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);
Error in fplot (line 166)
hObj = vectorizeFplot(cax,fn,limits,extraOpts,args);
Error in test (line 6)
fplot(sol, [0,5]);`
您知道如何解决此错误吗?
1条答案
按热度按时间ev7lccsx1#
我自己想出来的。条件必须是两个,而不是一个