syms s t Y;warning('off')t=0:0.001:10;h=4*t.*(heaviside(t)-heaviside(t-1))+4*(heaviside(t-1))figure (4)plot(t,h);axis([0,10,0,6])ode='D(D(y))(t)+4*y(t)=h';solg=laplace(ode,t,s);solp=subs(solg,{'laplace(y(t),h,t,s)','y(0)','D(y)(0)'},{Y,1,0});Y=(solve(solp,Y))yt=ilaplace(Y,s,t)figure (5)fplot(yt,[0 10])title('ODE Solution')xlabel ('Time [sec] ')ylabel( 'Amplitude [m]')
MATLAB: How to put the step function into the differential equation solution, h.. in this case
differential equationlaplace transformstep function
Best Answer