title 'graph of the forcing function';
ezplot( heaviside(t-pi) + (-1)*heaviside(t-10), [0 15]);
ylabel y; xlabel t;
syms s t Y
eqn = sym(('D(D(y))(t) + 3*D(y)(t) + 2*y(t) = heaviside(t-pi) + (-1)*heaviside(t-10)'));
lteqn = laplace(eqn , t, s);
neweqn = subs(lteqn , {'laplace(y(t),t,s)' , 'y(0)', 'D(y)(0)'} , {Y,1,0});
ytrans = solve(neweqn, Y);
y = ilaplace(ytrans , s, t)
ezplot( y , [0 15]);
title 'graph of Laplace Transform Solution for y" + 2y` +2y = h(t)';
ylabel y; xlabel t;
the output is as follows:
Error using sym>convertChar (line 1557)
Character vectors and strings in the first
argument can only specify a variable or
number. To evaluate character vectors and
strings representing symbolic expressions,
use 'str2sym'.
Error in sym>tomupad (line 1273)
S = convertChar(x);
Error in sym (line 229)
S.s = tomupad(x);
Error in Problem_Set_E (line 105)
eqn = sym(('D(D(y))(t) + 3*D(y)(t) + 2*y(t)
= heaviside(t-pi) + (-1)*heaviside(t-10)'));