TSTO Ferry and Orbiter costs.

See also: AircraftCostCalculation

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

%--------------------------------------------------------------------------
%   Copyright (c) 2019 Princeton Satellite Systems, Inc.
%   All rights reserved
%--------------------------------------------------------------------------
%   Since version 2019.1
%--------------------------------------------------------------------------

CPI_1982      = 96.5;
CPI_2007      = 207.3;
CPI_2013      = 233;
CEF_1982      = 1 + (CPI_2013 - CPI_1982)/CPI_1982;
CEF_2007      = 1 + (CPI_2013 - CPI_2007)/CPI_1982;
weightPayload = 1500*2.205;
kgM3ToLbsGal  = 0.0083454063545262;

costO2      = 0.43*CEF_1982; % 1982
costH2      = 4.50*CEF_1982; % 1982
costJP      = 3.15*CEF_2007; % 2007
mPSToKnots  = 1.94384;
kgToLbm     = 2.205;
rhoH2       = 70.85; % kg/m^3
rhoO2       = 1141; % kg/m^3
rhoJP       = 810; % kg/m^3
mach        = 3;
alt         = 15000;
p           = StdAtm(alt);
v           = mach*p.speedOfSound*mPSToKnots;
year        = 2013;
cPI         = 233;
r_bl        = 200; % nm
tol         = 1e-3;


% First stage
d             = load('SRTFerryData');
%d.fuel        = d.massFuel;
%d.massPayload = 450;
%[d, h]        = HSVMassEstimation( d.s.d, tol, 'Ferry' );
wFuel         = d.s.g.fuel*kgToLbm;
W_ampr        = (d.s.g.gM - d.s.g.fuel)*kgToLbm;
costFuel      = (costH2*d.s.massH2)/d.s.g.fuel;
rhoFuel       = rhoH2;

%cF = AircraftCostCalculation('weight', W_ampr,...  % This function doesn't have an output as committed
AircraftCostCalculation('weight',                      W_ampr,...
                'filename',                                 'Ferry',...
                'cpi_now',                                  cPI,...
                'speed',                                    v,...
                'cost per engine',                          20e6,...
                'number of static test airplanes',          1,...
                'number of rdte airplanes',                 2,...
                'number of engines',                        2,...
                'block distance',                           r_bl,...
                'fuel weight',                              wFuel,...
                'fuel price',                               costFuel,...
                'fuel density',                             rhoFuel,...
                'number of years',                          10,...
                'number of airplanes',                      450,...
                'number of crew',                           2,...
                'number of passengers',                     0,...
                'cost passenger insurance',                 0,...
                'cost cabin attendants',                    0,...
                'cost of maintaining ground equipment',     20000,...
                'cost passenger handling',                  0,...
                'cost of depreciation of ground equipment', 10000,...
                'cost of airplane servicing',               50000,...
                'year',                                     year);

% Orbiter
%--------
d2                  = load('SRTOrbiterData');
weightPayload       = d2.s.d.massPayload*kgToLbm;
W_ampr              = (d2.s.g.gM - d2.s.g.fuel)*kgToLbm;
wFuel               = d2.s.g.fuel*kgToLbm;
costFuel            = (costO2*d2.s.massO2 + costH2*d2.s.massH2)/d2.s.g.fuel;
rhoFuel             = ( rhoO2*d2.s.massO2 +  rhoH2*d2.s.massH2)*kgM3ToLbsGal/d2.s.g.fuel;

% cO = AircraftCostCalculation('weight', W_ampr,... % This function doesn't have an output as committed
AircraftCostCalculation('weight',                          	W_ampr,...
                'filename',                                 'Orbiter',...
                'cpi_now',                                  cPI,...
                'speed',                                    v,...
                'cost per engine',                          4e6,...
                'number of engines',                        3,...
                'number of static test airplanes',          1,...
                'number of rdte airplanes',                 2,...
                'block distance',                           r_bl,...
                'fuel weight',                              wFuel,...
                'fuel price',                               costFuel,...
                'fuel density',                             rhoFuel,...
                'number of years',                          10,...
                'number of airplanes',                      450,...
                'number of crew',                           2,...
                'number of passengers',                     0,...
                'cost passenger insurance',                 0,...
                'cost cabin attendants',                    0,...
                'cost of maintaining ground equipment',     20000,...
                'cost passenger handling',                  0,...
                'cost of depreciation of ground equipment', 10000,...
                'cost of airplane servicing',               200000,...
                'year',                                     year);


% costPerLb = (cF.costPerFlight + cO.costPerFlight)/weightPayload;


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