I'm very new to MatLab and need to solve a second order ODE that equals a piecewise function. I've looked up how to solve a second order ODE with ode45 and how to solve a piecewise ODE, but I'm not sure how to combine them. Further, the IVP I need to solve does not have a y' value and I do not know how to deal with that.
The IVP is:
y'' + 4y = g(t), y(0)=y'(0)=0where: g(t) = 0 in 0<=t<5; (t-5)/5 for 5<=t<10; 1 for t>=10
Thanks in advance, Logan
Best Answer