
% Codes Adapted and Reuse from Eric Peasley

% Initial conditions
v = 0;
h = 0;
burnTime = 150;
%burnTime = 150;
% Times and seasons
tstart = 0;
dt = 0.01;
%tstop = 300;
tstop = 2.0 * burnTime;
k = 0;                                                      % Clock tick
% loop through all times
for t = tstart :dt: tstop
a = GetAcceleration (t,h,v);                    % get acceleration
% capture telemetry for plotting
k=k+1; A(k)=a; V(k)=v; H(k)=h; T(k)=t;
% update velocity and height
h = h + dt * v;
v = v + dt * a;
end
% Added by me

% height Graph
subplot(2,2,1) %Top Graph
plot(T,H,'b')
title ('Height')
xlabel('t')
ylabel('h')
grid
% Velocity Graph
subplot(2,2,2) % Bottom Graph
plot(T,V,'r')
title ('Velocity')
xlabel('t')
ylabel('v')
grid

% Acceleration Graph
subplot(2,2,3) % Bottom Graph
plot(T,A,'r')
title ('Acceleration')
xlabel('t')
ylabel('a')
grid

