This is the question I'm struggling on
Using the Laplace transform find the solution for the following ODE:
d^2/dt(y(t)) + 16y(t) = 16[1(t-3) -1(t)]
initial conditions:
y(0) = 0
dy(t)/dt = 0
I have to solve the ODE with laplace and with inverse laplace
Save the inverse laplace in y_sol.
This is what I wrote but it gives me the wrong answer:
ode = ddot_y + 16*y == 16*(1*(t-3)-1*(t))
ode(t) =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675126/image.png)
Y1 = laplace(ode,t,s)
Y1 =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675131/image.png)
ysol1 = subs(Y1,laplace(y,t,s),X)
ysol1 =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675136/image.png)
ysol2 = subs(ysol1,y(0),y0)
ysol2 =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675141/image.png)
ysol3 = subs(ysol2, subs(diff(y(t), t), t, 0), dot_y0)
ysol3 =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675146/image.png)
ysol = solve(ysol3, X)
ysol =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675151/image.png)
Y = simplify(expand(ysol))
Y =
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675156/image.png)
y_sol = ilaplace(Y)
y_sol = ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1675161/image.png)