d2/dt2i(t)+25d/dti(t)+100i
我想用二阶导数方程绘制x:时间,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时出错>单Fplot(第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]);`
你知道如何解决这个错误吗?
我自己想好了。条件必须是两个,而不是一个