% R5
constants
format shorteng

ve = 2000;
f = 50;

m0 = 1000
m1 = 300

t = 14; % Burn time.
% V and Z after burn.
v1 = ve*log(m0/m1) - g*t
z1 = -ve/f*((m1*log(m0/m1)+m1) - (m0*log(m0/m0)+m0)) - g*(t^2)/2

% total time
delta_t = v1/g
t = delta_t + 14

% final alt.
z2 = z1 + v1*delta_t - g*delta_t^2/2