fplot error using second order derivatives / second-order differentiator circuit

37 Views Asked by At

d2/dt2i(t) + 25d/dti(t) + 100i(t) = 300

I want to plot x:time, y:i(t) graph using that second-derivative equation Also I using 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)');

However, the error comes out like this. Error using fplot>singleFplot (line 240) Input must be a function or functions of a single variable.

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

Do you know how to solve this error?

1

There are 1 best solutions below

0
On

I figured it out myself. The condition has to be two, not one