% ============================================================================
% GetThrust.m
% Author: Brent Dingle, Ph.D.
% Creation Date: 2020
%
% This function applies only for TAKE-OFF
%
% ============================================================================
function thrust = GetThrust(sim)
% assume fuel supply is sufficient to support entire burntime
% see UpdateRocket(), it will check fuel mass and adjust rocket mass
% as the fuel is burned. So it is possible we run out of fuel before
% burnTime expires, which will also make landing/hovering difficult
if ((sim.t >= 0) && (sim.t < sim.burnTime) )
% Fake a ramp up of thrust, rather that instantaneous thrust
% This can have significant effect on the simulation
if (sim.t >= 0.2)
thrust = sim.takeoffThrust; % N
else
thrust = (sim.t / 0.2) * sim.takeoffThrust; % N
endif
else
thrust = 0; % N
endif
endfunction