                                Program FLYBY

                            Interplanetary Gravity
                             Assist Trajectories

FLYBY is a program for IBM PC (tm) compatible computers which determines  
"patched-conic" gravity assist interplanetary trajectories between any three 
planets of our solar system. A patched-conic trajectory ignores the "local"
gravitational effect of the launch, flyby, and arrival planets on the helio-
centric transfer orbit. The flyby planet exchanges energy with the spacecraft
and turns the trajectory in the proper direction towards the arrival planet. 
No physical laws are violated, the total energy is conserved, and inhabitants 
of the flyby planet rarely notice the energy exchange! Patched-conic gravity
assist trajectories are useful for preliminary orbit design.

The FLYBY software performs a flyby/arrival calendar date grid search while 
attempting to find physically realizable gravity assist trajectories. FLYBY 
solves the heliocentric form of Lambert's problem between the launch and flyby
planet, and the flyby to arrival planet leg of the mission. The program is 
"data-driven" by a simple user-defined namelist of information which specifies 
such things as the departure, flyby and arrival planets, the launch calendar 
date, and grid search parameters.

The program will begin by asking you to input the name of the namelist data 
file to use with the following prompt:

    Please input the name of the FLYBY data file
    (be sure to include the filename extension)

Be sure to include the complete file name and its extension.

The software will also ask if you would like to pause and examine the display
after each solution is found. This prompt is as follows:

    Would you like to pause after each solution ?
    (y = yes, n = no)

Please enter "y" for yes or "n" for no.

The following is a typical FLYBY namelist data file. It is a mission from
Earth to Mars with a gravity assist at Venus and a desired flyby altitude of 
5000 kilometers. 

     &INPUTS
      IP         = 3, 2, 4
      LDATE      = 2, 1, 2009, 0, 0, 0
      DDAYS1     = 30.0D0
      DDAYS2     = 30.0D0
      NPT1       = 6
      NPT2       = 6
      PALTMIN    = 5000.0D0
      TOL        = 1.0D-12
     &END

For this example, the launch date is February 1, 2009 at 0 hours UT, and the
desired flyby altitude is 5000 kilometers.

Please note that the namelist data file MUST begin with &INPUTS and end with 
&END. Also, a value for all data items must be present.

The contents of the FLYBY namelist data file are as follows:

    IP(1) = launch planet
    
    IP(2) = flyby planet 

    IP(3) = arrival planet

where 0 is the Sun, 1 is Mercury, 2 is Venus, 3 is Earth and so forth.

The launch calendar date and Universal Time are contained in the following 
data item:

    LDATE = launch calendar date and Universal Time
    
The format of the launch date is 

    month, day, year, UT hours, UT minutes, UT seconds

Be sure to include all four digits of the calendar year and separate the data
items with commas.

FLYBY requires information about the size and number of time steps to use 
during the grid search. This data is contained in four namelist variables 
called DDAYS1, DDAYS2, NPT1 and NPT1, where:

    DDAYS1 = step size in days; launch-to-flyby leg
    
    DDAYS2 = step size in days; flyby-to-arrival leg

    NPT1 = number of search intervals; launch-to-flyby leg
    
    NPT2 = number 0f search intervals; flyby-to-arrival leg

For the example namelist above, the program will search six intervals of
duration 30 days each relative to the launch date. For each of these "first
leg" intervals, the software will also search six "flyby-to-arrival leg" 
intervals of 30 days each relative to each flyby date.

The desired flyby altitude, in kilometers, is defined in a namelist variable
called PALTMIN. This number should be greater than or equal to zero.

The algorithm tolerance is set in the namelist variable called TOL. This real
number determines how well FLYBY "targets" to the desired flyby altitude. A
number between 1.0D-4 and 1.0D-12 should be adequate.

The following is the output generated by the FLYBY software when using the 
namelist given above:
                                                                                
 Global Optimum Solution                                                         
                                                                                
 Launch date      2454863.50000000     Feb  1 2009      0 h  0 m  0 s  UT        
 Flyby date       2455006.33273904     Jun 23 2009     19 h 59 m  9 s  UT        
 Arrival date     2455241.13008791     Feb 13 2010     15 h  7 m 20 s  UT        
                                                                                
 Flyby incoming C3  (km/sec)**2      59.8234768030066                            
 Flyby outgoing C3  (km/sec)**2      59.8234768002233                            
 Delta-C3           (km/sec)**2     0.278330958281003D-008                       
                                                                                
 Launch C3          (km/sec)**2      48.3526560223975                            
 Arrival C3         (km/sec)**2      23.8959211257773                            
 Total C3           (km/sec)**2      72.2485771481748                            
                                                                                
 Maximum turn angle (degrees)        56.4489769409186                            
 Actual turn angle  (degrees)        38.4722570046600                            
                                                                                
 Flyby altitude     (kilometers)     4999.99999983678                            
 Altitude error     (kilometers)   -0.163217009685468D-006                       
                                                                                
                                                                                
 Planetary Flyby Conditions                                                     
                                                                                
    Hyperbolic Elements     incoming                                            
    Venus       centered, Earth ecliptic and equinox of B1950                   
 B Plane Radius     15562.0632620818     km                                     
 B Plane Angle      37.0677870036050     deg                                    
 Flight Path Angle 0.000000000000000     deg                                    
 V-infinity         7.73456377569048     km/s                                   
 Decl V-infinity   -65.3103112771269     deg                                    
 Rt Asc V-infinity  358.057160581658     deg                                    
                                                                                
                                                                                
    Hyperbolic Elements     outgoing                                            
    Venus       centered, Earth ecliptic and equinox of B1950                   
 B Plane Radius     15562.0632620818     km                                     
 B Plane Angle      66.3861120427039     deg                                    
 Flight Path Angle 0.000000000000000     deg                                    
 V-infinity         7.73456377569048     km/s                                   
 Decl V-infinity   -33.6900870387495     deg                                    
 Rt Asc V-infinity  34.6852406525903     deg                                    
                                                                                
                                                                                
 S/C Initial state     JD =     2454863.50000000                                 
                                                                                
    Position & Velocity Elements                                                
    Sun         centered, Earth equator and equinox of B1950                    
 X Distance        -97547386.6232074     km                                     
 Y Distance         101393554.705067     km                                     
 Z Distance         43958423.2855489     km                                     
 X Velocity        -19.0095340142079     km/s                                   
 Y Velocity        -19.8457332583435     km/s                                   
 Z Velocity        -2.30831225245900     km/s                                   
                                                                                
    Classical Orbital Elements                                                  
    Sun         centered, Earth equator and equinox of B1950                    
 Semi-major Axis    127596324.981027     km                                     
 Eccentricity      0.167558262163094                                            
 Inclination        17.7686344750411     deg                                    
 Node Angle         31.0375597461126     deg                                    
 Arg of Periapsis  -96.4632954350268     deg                                    
 True Anomaly      -161.276068317429     deg                                    
                                                                                
                                                                                
 S/C Final state     JD =     2455241.13008791                                   
                                                                                
    Position & Velocity Elements                                                
    Sun         centered, Earth equator and equinox of B1950                    
 X Distance        -178794169.605884     km                                     
 Y Distance         171264077.659099     km                                     
 Z Distance         7978902.35849109     km                                     
 X Velocity        -12.0880487465595     km/s                                   
 Y Velocity        -13.2113584118522     km/s                                   
 Z Velocity         2.26546113922442     km/s                                   
                                                                                
    Classical Orbital Elements                                                  
    Sun         centered, Earth equator and equinox of B1950                    
 Semi-major Axis    177969679.741747     km                                     
 Eccentricity      0.392265275987446                                            
 Inclination        7.48008925124351     deg                                    
 Node Angle         122.024103211899     deg                                    
 Arg of Periapsis  -167.329260283216     deg                                    
 True Anomaly      -178.345596908302     deg                                    
                                                                                
                                                                                
 S/C SOI Entrance Conditions     JD =     2455240.23521575                       
                                                                                
    Hyperbolic Elements     incoming                                            
    Venus       centered, Earth ecliptic and equinox of B1950                   
 Periapsis Altitude 4999.99999983678     km                                     
 B Plane Angle      37.0677870036050     deg                                    
 Flight Path Angle -88.5656151311093     deg                                    
 V-infinity         7.73456377569048     km/s                                   
 Decl V-infinity   -65.3103112771269     deg                                    
 Rt Asc V-infinity  358.057160581658     deg                                    
                                                                                
    Classical Orbital Elements                                                  
    Venus       centered, Earth equator and equinox of B1950                    
 Semi-major Axis   -5430.28904173080     km                                     
 Eccentricity       3.03525077853207                                            
 Inclination        86.7720114111298     deg                                    
 Node Angle         44.8494774215087     deg                                    
 Arg of Periapsis  -127.960637391948     deg                                    
 True Anomaly      -107.795478886010     deg                                    
                                                                                
                                                                                
 S/C SOI Entrance Conditions     JD =     2455240.23521575                       
                                                                                
    Position & Velocity Elements                                                
    Venus       centered, Earth equator and equinox of B1950                    
 X Distance        -266091.561218642     km                                     
 Y Distance        -224234.471171239     km                                     
 Z Distance         508637.078488811     km                                     
 X Velocity         3.25771465680046     km/s                                   
 Y Velocity         2.71979395419023     km/s                                   
 Z Velocity        -6.54734716052438     km/s                                   
                                                                                
                                                                                
 S/C SOI Exit Conditions     JD =     2455242.02496006                           
                                                                                
    Hyperbolic Elements     outgoing                                            
    Venus       centered, Earth ecliptic and equinox of B1950                   
 Periapsis Altitude 4999.99999983678     km                                     
 B Plane Angle      66.3861120427039     deg                                    
 Flight Path Angle  88.5656151311093     deg                                    
 V-infinity         7.73456377569048     km/s                                   
 Decl V-infinity   -33.6900870387495     deg                                    
 Rt Asc V-infinity  34.6852406525903     deg                                    
                                                                                
    Classical Orbital Elements                                                  
    Venus       centered, Earth equator and equinox of B1950                    
 Semi-major Axis   -5430.28904173080     km                                     
 Eccentricity       3.03525077853207                                            
 Inclination        86.7720114111298     deg                                    
 Node Angle         44.8494774215087     deg                                    
 Arg of Periapsis  -127.960637391948     deg                                    
 True Anomaly       107.795478886010     deg                                    
                                                                                
                                                                                
 S/C SOI Exit Conditions     JD =     2455242.02496006                           
                                                                                
    Position & Velocity Elements                                                
    Venus       centered, Earth equator and equinox of B1950                    
 X Distance         418571.973874740     km                                     
 Y Distance         399504.827847606     km                                     
 Z Distance        -212110.560415830     km                                     
 X Velocity         5.33815162362434     km/s                                   
 Y Velocity         5.11117605282295     km/s                                   
 Z Velocity        -2.50155059494205     km/s                                   
                                                                                
*****************************************************************************

Program Notes

(1) B1950 is the Besselian calendar date.

(2) JD is the Julian Date.

(3) SOI is the sphere-of-influence at the flyby planet. This is the distance
    at which the orbital motion becomes "planet-centered".

(4) C3 is the specific (per unit mass) orbital energy.

(5) S/C = spacecraft

(6) All position and velocity vectors are inertial.

(7) The maximum turn angle corresponds to a flyby altitude of 0 kilometers.

(8) A converged solution satisfies the following mission constraints:
    
   - energy match at flyby (incoming C3 = outgoing C3)
   - small flyby altitude error
   - actual turn angle <= maximum turn angle

    FLYBY solves a system of two nonlinear equations defined by the first
    two mission constraints.

(9) Node Angle = right ascension of the ascending node.

(10) FLYBY is freeware from Science Software.

(11) Please address all questions, comments, etc. to CompuServe 74561,606 or
     the Internet 74561.606@compuserve.com.

(12) Program FLYBY was created with Lahey FORTRAN and the Multimission (MASL) 
     library from JPL. Thanks to Dave Skinner, Don Yeomans, and others.

(13) Last updated December 6, 1995.

