% ============================================================================
% MakeSimpleRocket.m
% Author: Brent Dingle, Ph.D.
% Creation Date: 2020
%
% This really should be a parameterized function where
% the parameter specifies which type of rocket to setup
%
% For the moment there is only 1 type
%
% Fuel rate and mass are fake
% For estimation of what they might be look at UpdateMass()
% For take-off 
%    fuelMassUsed = rate * avg thrust * burn time
% So if we had a rocket with an average thrust of 75 N, burn time of 1.5 s
% (like a class G motor) we would have:
%    fuelMassUsed = rate * 75 * 1.5
% We can estimate our fuelMass to be 100 g = 0.1 kg, and calculate or rate
%    rate = 0.1 / (75 *1.5) ~= 0.00088
% Knowing this we might set the following values (doubling fuel mass for landing)
%  rock.baseMass     = 1.0;      % kg
%  rock.fuelRatePerN = 0.00088;  % (kg/s)/N
%  rock.fuelMass     = 0.2;      % kg
%  sim.burnTime      = 1.5;      % seconds
%  sim.takeoffThrust = 75;       % N 
%
% Recall N = Newtons = (kg * m / s^2)
% also momentum is measured in (kg*m)/s
%
% ============================================================================
function rock = MakeSimpleRocket()
%  rock.baseMass     = 500.0;    % kg
%  rock.fuelRatePerN = 0.001;    % (kg/s)/N
%  rock.fuelMass     = 1500.0;   % kg

  rock.baseMass     = 1.5;      % kg
  rock.fuelRatePerN = 0.00088;  % (kg/s)/N
  rock.fuelMass     = 0.3;      % kg  0.3 orig
  
  rock.isSlowing    = false;    % true is 1, false is zero
  rock.slowStart    = -1.0;     % s -> set when isSlowing becomes true

  rock.isSlow2      = false;    % true is 1, false is zero
  rock.slow2Start   = -1.0;     % s -> set when isSlow2 becomes true
  
  rock.accel        = 0.0;      % m/s^2
  rock.vel          = 0.0;      % m/s
  rock.height       = 0.0;      % m
  rock.thrust       = 0.0;      % N
  
endfunction