No need for the help but if someone could let me know if this looks right that would be great.
PROGRAM ModelRocket
m = 0.5;
Fthrust = 160;
g = 9.81;
vChute = -20;
tEngineCut = 0.15;
v = 0;
t = 0;
h = 0;
Dt = 0.01;
i = 1; v(i) = 0; h(i) = 0; t(i) = 0;
WHILE t(i) < tEngineCut
DO i = i + 1;
t(i) = t(i-1) + Dt;
v(i) = a1*t(i);
h(i) = 0.5*a1*t(i)^2;
ENDWHILE
v1 = v(i);
h1 = h(i);
t1 = t(i);
WHILE v(i) > vChute
DO i = i + 1;
t(i) = t(i-1) + Dt;
v(i) = v1 - g * (t(i)-t1);
h(i) = h1 + v1 * (t(i)-t1) - 0.5 * g * (t(i)-t1)^2;
ENDWHILE
v2 = v(i);
h2 = h(i);
t2 = t(i);
WHILE h(i) > 0
DO i = i + 1;
t(i) = t(i-1) + Dt;
v(i) = vChute;
h(i) = h2 + vChute * (t(i)-t2);
ENDWHILE
plot(t,h,t2,h2,'o');
hold on
plot(t,v,t2,v2,'o');
hold off
xlabel('Time (s)');
ylabel('Height (m) / Velocity (m/s)');
title('Time (s) plotted against the Height and Velocity of model rocket (m)/(m/s)');
legend('o = chute opens');
ENDPROGRAM