Compute the total delta-V for the JIMO mission

This mission assumes a low thrust
The time is in seconds and is 4 months
The vehicle low thrust spirals out of earth orbit then low thrust
spirals to Callisto. It goes into orbit about Callisto and repeats
with the other planets.
Since version 10.
%--------------------------------------------------------------------------

timeToJupiter   = 18*30*86400;
sigmaPower      = 1e-3;
sigmaFuel       = 0.02;
mPayload        = 1060;


au          = Constant('au');
rEarth      = au;
rJupiter    = 5.3*au;
hP          = 400;
mu(1)       = 3.98600436e5;
r(1)        = hP + 6378.165;

mu(2)       = Constant('mu callisto');
rO(2)       = 1882700;
r(2)        = hP + Constant('equatorial radius callisto');

mu(3)       = Constant('mu ganymede');
rO(3)       = 1070400;
r(3)        = hP + Constant('equatorial radius ganymede');

mu(4)       = Constant('mu europa');
rO(4)       = 671100;
r(4)        = hP + Constant('equatorial radius europa');

mu(5)       = Constant('mu io');
rO(5)       = 421800;
r(5)        = hP + 1821.3;
muJupiter   = Constant('mu jupiter');

f           = [1 2 2 2 2];

vAve        = (rJupiter + 2*rEarth)/timeToJupiter;

dV = zeros(1,11);

% Leaving and arriving in orbits
%-------------------------------
for j = 1:5
	dV(j) = f(j)*LowThrustEscape( mu(j),  r(j) );
end

j = 6;

% Entering Jupiter
%-----------------
dV(j) =  LowThrustEscape( muJupiter,  rO(2) ); j = j + 1;

% Callisto to Ganymede
%---------------------
dV(j) =  LTSpiral( rO(3), rO(2), [], muJupiter ); j = j + 1;
dV(j) =  LTSpiral( rO(4), rO(3), [], muJupiter ); j = j + 1;
dV(j) =  LTSpiral( rO(5), rO(4), [], muJupiter ); j = j + 1;

dV(j) = 4*vAve; j = j + 1;

dV(j) = sum(dV);

s     = {'Earth departure'  'Callisto Orbit' ...
         'Ganymede Orbit' 'Europa Orbit' 'Io Orbit' 'Jupiter Entry' ...
         'Spiral Callisto to Ganymede' 'Spiral Ganymede to Europa'...
         'Spiral Europa to Io' 'Earth to Jupiter' ...
         'Total'};

z = cell(length(dV),2);
for k = 1:length(dV)
    fprintf(1,'%28s %8.2f (km/s) \n',s{k},dV(k));
    z{k,1} = s{k};
    z{k,2} = dV(k);
end

CreateLatexTable(z,'JIMOMission')

% Engine parameters
%------------------
thrust = 30;
uEMax  = 2.465e4;
power  = 5e6;
eff    = 0.6;

% Exhaust velocity in km/s
%-------------------------
uE     = 2*power*eff/thrust/1000;

% Required mass ratio
%--------------------
mR    = exp(dV(end)/uE);

mDry  = mPayload + power*sigmaPower;

% Total fuel
%-----------
mFuel = mDry*(mR-1)/(1+sigmaFuel*(1-mR));

mDry  = mDry + sigmaFuel*mFuel;

% Average mass
%-------------
mAve = mDry + mFuel/2;

% Time to do delta-v
%-------------------
t = mAve*dV(end)*1000/thrust;

clear p;

k = 1;
p{k,1} = 'Specific power';      p{k,2} = sprintf('%8.2f kg/kW',sigmaPower*1000);    k = k + 1;
p{k,1} = 'Specific mass';       p{k,2} = sprintf('%8.2f kg/kg',sigmaFuel);          k = k + 1;
p{k,1} = 'Thrust';              p{k,2} = sprintf('%8.2f N',thrust);                 k = k + 1;
p{k,1} = 'Power';               p{k,2} = sprintf('%8.2f MW',power/1e6);             k = k + 1;
p{k,1} = 'Dry mass';            p{k,2} = sprintf('%8.2f kg',mDry);                  k = k + 1;
p{k,1} = 'Payload mass';        p{k,2} = sprintf('%8.2f kg',mPayload);              k = k + 1;
p{k,1} = 'Fuel mass';           p{k,2} = sprintf('%8.2f kg',mFuel);                 k = k + 1;
p{k,1} = 'Exhaust Velocity';    p{k,2} = sprintf('%8.2f km/s',uE);                  k = k + 1;
p{k,1} = 'Time to Jupiter';     p{k,2} = sprintf('%8.2f days',timeToJupiter/86400);	k = k + 1;
p{k,1} = 'Time for delta V';    p{k,2} = sprintf('%8.2f days',t/86400);             k = k + 1;

CreateLatexTable(p,'JIMOMissionDesign')



%--------------------------------------
% PSS internal file version information
%--------------------------------------
             Earth departure     7.67 (km/s) 
              Callisto Orbit     3.18 (km/s) 
              Ganymede Orbit     3.62 (km/s) 
                Europa Orbit     2.57 (km/s) 
                    Io Orbit     3.27 (km/s) 
               Jupiter Entry     8.20 (km/s) 
 Spiral Callisto to Ganymede     2.68 (km/s) 
   Spiral Ganymede to Europa     2.86 (km/s) 
         Spiral Europa to Io     3.59 (km/s) 
            Earth to Jupiter    93.63 (km/s) 
                       Total   131.27 (km/s)