Straight-line, constant-thrust flyby demo

%--------------------------------------------------------------------------
% See also: FlybyConstantThrust, StraightLineConstantThrust
%--------------------------------------------------------------------------

%--------------------------------------------------------------------------
%   Copyright 2018 Princeton Satellite Systems, Inc.
%   All rights reserved.
%--------------------------------------------------------------------------

lY            = 9.4607e12;
g             = StraightLineConstantThrust;
mP            = 200;
f             = 0.02;
thrust        = [1 2 4 6 8 10];
m             = length(thrust);
secInYear     = 365.25*86400;
years         = 200;
sigma         = linspace(1,100);
eff           = 0.3;
power         = 60e6;
n             = length(sigma);
s             = zeros(m,n);
tF            = years*secInYear;
tL            = cell(m,1);
mE            = power./sigma/1000;
for j = 1:length(thrust)
  uE   	= 2*eff*power/thrust(j); % m/s
  mF    = thrust(j)*tF/uE;
  tL{j}	= sprintf('%2.0f N u_e %5.1f km/s',thrust(j), uE/1000);
  for k = 1:n
    m0      = mE(k) + mP + (1 + f)*mF;
    s(j,k)	= FlybyConstantThrust( thrust(j), uE/1000, m0, tF );
  end
end

yL = {'Distance (ly)' 'Engine Mass (kg)'};
f  = sprintf('Distance in %d years %4.0f MW',years,power/1e6);

Plot2D(sigma,s/lY,  'Specific Power (kW/kg)',yL{1},f);
legend(tL,'location','best');
Plot2D(sigma,mE,    'Specific Power (kW/kg)',yL{2},f);

if 0
PrintFig(1,4,1,'FlybyDistance');
PrintFig(1,4,2,'EngineMass');
end


%--------------------------------------

% $Id: 516d567a4364142fc0f4d5fc9f67909278b1eabe $