%% ENGN0040 2019 Homework #3 Problem 2

syms M t mu T0 g real
syms x(t)
IC = x(0)==0;
IC2 = subs(diff(x(t),t),t,0)==0;
diffeq = (M-mu*t)*diff(x(t),t,2)==T0-(M-mu*t)*g;
x_sol = simplify(dsolve(diffeq,IC,IC2,symvar('x(t)')))
fplot(diff(x_plot,t),[0,163])
axes1 = gca;
grid on
xlabel('Time (s)')
ylabel('Speed (m/s)')
title('Falcon 9 velocity')
set(axes1,'FontSize',12);