matlab 使用二阶导数/二阶微分器电路的fplot误差

pkln4tw6  于 2022-12-13  发布在  Matlab
关注(0)|答案(1)|浏览(226)

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]);`

您知道如何解决此错误吗?

ev7lccsx

ev7lccsx1#

我自己想出来的。条件必须是两个,而不是一个

相关问题