Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72/3 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

057236,000002:                                                                                                  ## Copyright:   Public domain.
057237,000003:                                                                                                  ## Filename:    TIME_OF_FREE_FALL.agc
057238,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
057239,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
057240,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
057241,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
057242,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
057243,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
057244,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
057245,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
057246,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
057247,000013:                                                                                                  ##              is correct.
057248,000014:                                                                                                  ## Assembler:   yaYUL
057249,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
057250,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
057251,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
057252,000018: 
057253,000019:                                                                                                  #  THE TFF SUBROUTINES MAY BE USED IN EITHER EARTH OR MOON CENTERED COORDINATES.  THE TFF ROUTINES NEVER
057254,000020:                                                                                                  #  KNOW WHICH ORIGIN APPLIES.  IT IS THE USER WHO KNOWS, AND WHO SUPPLIES RONE, VONE AND 1/SQRT(MU) AT THE
057255,000021:                                                                                                  #  APPROPRIATE SCALE LEVEL FOR THE PROPER PRIMARY BODY.
057256,000022: 
057257,000023:                                                                                                  #        EARTH ORIGIN    POSITION        -29     METERS
057258,000024:                                                                                                  #                        VELOCITY        -7      METERS/CENTISECOND
057259,000025:                                                                                                  #                        1/SQRT(MU)      +17     SQRT(CS SQ/METERS CUBED)
057260,000026: 
057261,000027:                                                                                                  #        MOON ORIGIN     POSITION        -27     METERS
057262,000028:                                                                                                  #                        VELOCITY        -5      METERS/CENTISECONDS
057263,000029:                                                                                                  #                        1/SQRT(MU)      +14     SQRT(CS SQ/METERS CUBED)
057264,000030: 
057265,000031:                                                                                                  #  ALL DATA PROVIDED TO AND RECEIVED FROM ANY TFF SUBROUTINE WILL BE AT ONE OF THE LEVELS ABOVE.  IN ALL CASES,
057266,000032:                                                                                                  #  THE FREE FALL TIME IS RETURNED IN CENTISECONDS AT (-28).  PROGRAM TFF/CONIC WILL GENERATE VONE/RTMU AND
057267,000033:                                                                                                  #  LEAVE IT IN VONE' AT (+10) IF EARTH ORIGIN AND (+9) IF MOON ORIGIN.
057268,000034: 
057269,000035:                                                                                                  #  THE USER MUST STORE THE STATE VECTOR IN RONE, VONE  AND MU IN THE FORM 1/SQRT(MU) IN TFF/RTMU
057270,000036:                                                                                                  #  AT THE PROPER SCALE BEFORE CALLING TFF/CONIC.  SINCE RONE, VONE ARE IN THE EXTENDED VERB STORAGE AREA,
057271,000037:                                                                                                  #  THE USER MUST ALSO LOCK OUT THE EXTENDED VERBS, AND RELEASE THEM WHEN FINISHED.
057272,000038: 
057273,000039:                                                                                                  #  PROGRAMS CALC/TFF AND CALC/TPER ASSUME THAT THE TERMINAL RADIUS IS LESS THAN THE PRESENT
057274,000040:                                                                                                  #  RADIUS.  THIS RESTRICTION CAN BE REMOVED BY A 15 W CODING CHANGE, BUT AT PRESENT IT IS NOT DEEMED NECESSARY.
057275,000041: 
057276,000042:                                                                                                  #  THE FOLLOWING ERASABLE QUANTITIES ARE USED BY THE TFF ROUTINES, AND ARE LOCATED IN THE PUSH LIST.
057277,000043: 
057278,000044:                                                                                                  #                                        BELOW   E:  IS USED FOR EARTH ORIGIN SCALE
057279,000045:                                                                                                  #                                                M:  IS USED FOR MOON  ORIGIN SCALE
057280,000046: 
057281,000047:                                                                                                  # TFFSW          =       119D            BIT1    0 = CALCTFF             1 = CALCTPER
057282,000048: 23,3774                        TFFDELQ            =        10D                                   #        Q2-Q1                   E: (-16)  M: (-15)
057283,000049: 23,3774                        RMAG1              =        12D                                   #        ABVAL(RN)  M            E: (-29)  M: (-27)
057284,000050:                                                                                                  # RPER           =       14D             PERIGEE RADIUS  M       E: (-29)  M: (-27)
057285,000051: 23,3774                        TFFQ1              =        14D                                   #        R.V / SQRT(MUE)         E: (-16)  M: (-15)
057286,000052:                                                                                                  # SDELF/2                                SIN(THETA) /2
057287,000053: 23,3774                        CDELF/2            =        14D                                   #        COS(THETA) /2
057288,000054:                                                                                                  # RAPO           =       16D             APOGEE RADIUS  M        E: (-29)  M: (-27)
057289,000055: 23,3774                        NRTERM             =        16D                                   #        TERMINAL RADIUS  M      E: (-29+NR)
057290,000056:                                                                                                  #                                          M: (-27+NR)
057291,000057: 23,3774                        RTERM              =        18D                                   #        TERMINAL RADIUS  M      E: (-29)  M: (-27)
057292,000058: 23,3774                        TFFVSQ             =        20D                                   #        -(V SQUARED/MU)  1/M    E: (20)   M: (18)
057293,000059: 23,3774                        TFF1/ALF           =        22D                                   #        SEMI MAJ AXIS  M        E: (-22-2 NA)
057294,000060:                                                                                                  #                                          M: (-20-2 NA)
057295,000061: 23,3774                        TFFRTALF           =        24D                                   #        SQRT(ALFA)              E:(10+NA) M: (9+NA)
057296,000062: 23,3774                        TFFALFA            =        26D                                   #        ALFA  1/M               E:(26-NR) M: (24-NR)
057297,000063: 23,3774                        TFFNP              =        28D                                   #        SEMI LATUS RECTUM  M    E: (-38+2 NR)
057298,000064:                                                                                                  #                                          M: (-36+2 NR)
057299,000065: 23,3774                        TFF/RTMU           =        30D                                   #        1/SQRT(MU)              E: (17)   M: (14)
057300,000066: 23,3774                        NRMAG              =        32D                                   #        PRESENT RADIUS  M       E: (-29+NR)
057301,000067:                                                                                                  #                                          M: (-27+NR)
057302,000068: 23,3774                        TFFX               =        34D                                   
057303,000069: 23,3774                        TFFTEM             =        36D                                   #        TEMPORARY
057304,000070:                                                                                                  #                REGISTERS S1, S2 ARE UNTOUCHED BY ANY TFF SUBROUTINE
057305,000071:                                                                                                  #                INDEX REGISTERS X1, X2 ARE USED BY ALL TFF SUBROUTINES.  THEY ARE ESTAB-
057306,000072:                                                                                                  #                LISHED IN TFF/CONIC AND MUST BE PRESERVED BETWEEN CALLS TO SUBSEQUENT
057307,000073:                                                                                                  #                SUBROUTINES.
057308,000074:                                                                                                  #                -NR                             C(X1) = NORM COUNT OF RMAG
057309,000075:                                                                                                  #                -NA                             C(X2) = NORM COUNT OF SQRT(ABS(ALFA))
057310,000076: 
057311,000077:                                                                                                  #  SUBROUTINE NAME:  TFFCONIC                    DATE:  01.29.67
057312,000078:                                                                                                  #  MOD NO:  0                                    LOG SECTION:  TIME OF FREE FALL
057313,000079:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
057314,000080:                                                                                                  #  MOD NO:  1    MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67
057315,000081:                                                                                                  #  MOD NO:  2    MOD BY:  RR BAIRNSFATHER        DATE: 21 NOV 67         ADD MOON MU.
057316,000082:                                                                                                  #  MOD NO:  3    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 68         ACCEPT DIFFERENT EARTH/MOON SCALES
057317,000083: 
057318,000084:                                                                                                  #  FUNCTIONAL DESCRIPTION:  THIS SUBROUTINE IS CALLED TO COMPUTE THOSE CONIC PARAMETERS REQUIRED BY THE TFF
057319,000085:                                                                                                  #        SUBROUTINES AND TO ESTABLISH THEM IN THE PUSH LIST AREA.  THE PARAMETERS ARE LISTED UNDER OUTPUT.
057320,000086:                                                                                                  #        THE EQUATIONS ARE
057321,000087:                                                                                                  #                -   -  -
057322,000088:                                                                                                  #                H = RN*VN                       ANGULAR MOMENTUM
057323,000089:                                                                                                  #                      - -
057324,000090:                                                                                                  #                LCP = H.H / MU                  SEMI LATUS RECTUM
057325,000091:                                                                                                  #                              -  -
057326,000092:                                                                                                  #                ALFA = 2/RN - VN.VN / MU        RECIPROCAL SEMI MAJ AXIS, SIGNED
057327,000093: 
057328,000094:                                                                                                  #        AND ALFA IS POS FOR ELLIPTIC ORBITS
057329,000095:                                                                                                  #                      0 FOR PARABOLIC ORBITS
057330,000096:                                                                                                  #                    NEG FOR HYPERBOLIC ORBITS.
057331,000097:                                                                                                  #        SUBROUTINE ALSO COMPUTES AND SAVES RMAG.
057332,000098: 
057333,000099:                                                                                                  #  CALLING SEQUENCE:
057334,000100:                                                                                                  #        TFFCONIC EXPECTS CALLER TO ENTER WITH CORRECT GRAVITATIONAL CONSTANT IN MPAC, IN THE FORM
057335,000101:                                                                                                  #        1/SQRT(MU).  PROGRAM WILL SAVE IN TFF/RTMU.  THE SCALE IS DETERMINED BY WHETHER EARTH OR MOON
057336,000102:                                                                                                  #        ORIGIN IS USED.  THE CALLER MUST LOCK OUT THE EXTENDED VERBS BEFORE PROVIDING STATE VECTOR IN RONE,
057337,000103:                                                                                                  #        VONE AT PROPER SCALE.  THE EXTENDED VERBS MUST BE RESTORED WHEN THE CALLER IS FINISHED USING THE
057338,000104:                                                                                                  #        TFF ROUTINES.
057339,000105: 
057340,000106:                                                                                                  #        ENTRY POINT TFFCONMU EXPECTS THAT TFF/RTMU IS ALREADY LOADED.
057341,000107: 
057342,000108:                                                                                                  #        TO SPECIFY MU:  DLOAD   CALL            IF MU ALREADY STORED:           CALL
057343,000109:                                                                                                  #                                YOURMU          1/RTMU E:(17) M:(14)                    TFFCONMU
057344,000110:                                                                                                  #                                TFFCONIC
057345,000111:                                                                                                  #        PUSHLOC = PDL+0, ARBITRARY IF LEQ 18D
057346,000112: 
057347,000113:                                                                                                  #  SUBROUTINES CALLED:  NONE
057348,000114: 
057349,000115:                                                                                                  #  NORMAL EXIT MODES:  RVQ
057350,000116: 
057351,000117:                                                                                                  #  ALARMS:  NONE
057352,000118: 
057353,000119:                                                                                                  #  OUTPUT:       THE FOLLOWING ARE STORED IN THE PUSH LIST AREA.
057354,000120:                                                                                                  #                RMAG1           E:(-29) M:(-27)         M  RN, PRESENT RADIUS LENGTH.
057355,000121:                                                                                                  #                NRMAG           E:(-29+NR)              M  RMAG, NORMALIZED
057356,000122:                                                                                                  #                                M:(-27+NR)
057357,000123:                                                                                                  #                X1                                      -NR, NORM COUNT
057358,000124:                                                                                                  #                TFFNP           E:(-38+2NR)             M  LCP, SEMI LATUS RECTUM, WEIGHTED BY NR.  FOR VGAMCALC
057359,000125:                                                                                                  #                                M:(-36+2NR)
057360,000126:                                                                                                  #                TFF/RTMU        E:(17) M:(14)           1/SQRT(MU)
057361,000127:                                                                                                  #                TFFVSQ          E:(20) M:(18)           1/M  -(V SQ/MU):  PRESENT VELOCITY, NORMLIZED.  FOR VGAMCALC
057362,000128:                                                                                                  #                TFFALFA         E:(26-NR)               1/M  ALFA, WEIGHTED BY NR
057363,000129:                                                                                                  #                                M:(24-NR)
057364,000130:                                                                                                  #                TFFRTALF        E:(10+NA)               SQRT(ALFA), NORMALIZED
057365,000131:                                                                                                  #                                M:(9+NA)
057366,000132:                                                                                                  #                X2                                      -NA, NORM COUNT
057367,000133:                                                                                                  #                TFF1/ALF        E:(-22-2NA)             SIGNED SEMI MAJ AXIS, WEIGHTED BY NA
057368,000134:                                                                                                  #                                M:(-20-2NA)
057369,000135:                                                                                                  #                PUSHLOC AT PDL+0
057370,000136: 
057371,000137:                                                                                                  #        THE FOLLOWING IS STORED IN GENERAL ERASABLE
057372,000138:                                                                                                  #                VONE'           E:(10) M:(9)            V/RT(MU), NORMALIZED VELOCITY
057373,000139: 
057374,000140:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
057375,000141:                                                                                                  #                RONE            E:(-29) M:(-27)         M  STATE VECTOR         LEFT BY CALLER
057376,000142:                                                                                                  #                VONE            E:(-7) M:(-5)           M/CS  STATE VECTOR      LEFT BY CALLER
057377,000143:                                                                                                  #                TFF/RTMU        E:(17) M:(14)           1/RT(CS SQ/M CUBE)      IF ENTER VIA TFFCONMU.
057378,000144: 
057379,000145:                                                                                                  #  DEBRIS:       QPRET,  PDL+0 ... PDL+3
057380,000146: 
057381,000147: 33,3776                                           BANK     33                                    
057382,000148: 27,2000                                           SETLOC   TOF-FF                                
057383,000149: 27,2000                                           BANK                                           
057384,000150: 
057385,000151: 27,2760                                           COUNT*   $$/TFF                                
057386,000152: 
057387,000153: 27,2760           00037        TFFCONIC           STORE    TFF/RTMU                              #  1/SQRT(MU)    E:(17) M:(14)
057388,000154: 
057389,000155: 27,2761           53575        TFFCONMU           VLOAD    UNIT                                  #  COME HERE WITH TFFRTMU LOADED.
057390,000156: 27,2762           02327                                    RONE                                  #  SAVED RN.  M  E:(-29) M:(-27)
057391,000157: 27,2763           77725                           PDDL                                           #  UR/2 TO PDL+0, +5
057392,000158: 27,2764           00045                                    36D                                   #  MAGNITUDE
057393,000159: 27,2765           00015                           STORE    RMAG1                                 #  M  E:(-29) M:(-27)
057394,000160: 
057395,000161: 27,2766           77701                           NORM                                           
057396,000162: 27,2767           00047                                    X1                                    #  -NR
057397,000163: 27,2770           24041                           STOVL    NRMAG                                 #  RMAG  M  E:(-29+NR) M:(-27+NR)
057398,000164: 27,2771           02335                                    VONE                                  #  SAVED VN.  M/CS  E:(-7) M:(-5)
057399,000165: 27,2772           77761                           VXSC                                           
057400,000166: 27,2773           00037                                    TFF/RTMU                              #  E:(17) M:(14)
057401,000167: 27,2774           02372                           STORE    VONE'                                 #  VN/SQRT(MU)  E:(10) M:(9)
057402,000168: 
057403,000169: 27,2775           47361                           VXSC     VXV                                   
057404,000170: 27,2776           00041                                    NRMAG                                 #  E:(-29+NR) M:(-27+NR)
057405,000171:                                                                                                  #  UR/2 FROM PDL
057406,000172: 27,2777           47572                           VSL1     VSQ                                   #  BEFORE:  E:(-19+NR) M:(-18+NR)
057407,000173: 27,3000           14035                           STODL    TFFNP                                 #  LC P  M  E:(-38+2NR) M:(-36+2NR)
057408,000174:                                                                                                  #  SAVE ALSO FOR VGAMCALC
057409,000175: 27,3001           15324                                    TFF1/4                                
057410,000176: 27,3002           63271                           DDV      PDVL                                  #  (2/RMAG)  1/M  E:(26-NR) M:(24-NR)
057411,000177: 27,3003           00041                                    NRMAG                                 #  RMAG  M  E:(-29+NR) M:(-27+NR)
057412,000178: 27,3004           02372                                    VONE'                                 #  SAVED VN.  E:(10) M:(9)
057413,000179: 27,3005           57436                           VSQ      DCOMP                                 #  KEEP MPAC+2 HONEST FOR SQRT.
057414,000180: 27,3006           00025                           STORE    TFFVSQ                                #  -(V SQ/MU)  E:(20) M:(18)
057415,000181:                                                                                                  #  SAVE FOR VGAMCALC
057416,000182: 27,3007           43257                           SR*      DAD                                   
057417,000183: 27,3010           20573                                    0          -6,1                       #  GET -VSQ/MU  E:(26-NR) M:(24-NR)
057418,000184: 27,3011           77626                           STADR                                          
057419,000185:                                                                                                  #  2/RMAG  FROM PDL+2
057420,000186: 27,3012           77744                           STORE    TFFALFA                               #  ALFA  1/M  E:(26-NR) M:(24-NR)
057421,000187: 27,3013           41457                           SL*      PUSH                                  #  TEMP SAVE ALFA  E:(20) M:(18)
057422,000188: 27,3014           20173                                    0          -6,1                       
057423,000189: 27,3015           75446                           ABS      SQRT                                  #  E:(10) M:(9)
057424,000190: 27,3016           77701                           NORM                                           
057425,000191: 27,3017           00050                                    X2                                    #  X2 = -NA
057426,000192: 27,3020           00031                           STORE    TFFRTALF                              #  SQRT( ABS(ALFA) )  E:(10+NA) M:(9+NA)
057427,000193: 27,3021           75316                           DSQ      SIGN                                  #  NOT SO ACCURATE, BUT OK
057428,000194:                                                                                                  #  ALFA FROM PDL+2  E:(20) M:(18)
057429,000195: 27,3022           55254                           BZE      BDDV                                  #  SET 1/ALFA =0, TO SHOW SMALL ALFA
057430,000196: 27,3023           57025                                    +2                                    
057431,000197: 27,3024           15324                                    TFF1/4                                
057432,000198: 27,3025           00027                 +2        STORE    TFF1/ALF                              #  1/ALFA  E:(-22-2NA) M:(-20-2NA)
057433,000199: 27,3026           77616        DUMPCNIC           RVQ                                            
057434,000200:                                                                                                  #                        39 W
057435,000201:                                                                                                  #  SUBROUTINE NAME:  TFFRP/RA                    DATE: 01.17.67
057436,000202:                                                                                                  #  MOD NO:  0                                    LOG SECTION:  TIME OF FREE FALL
057437,000203:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
057438,000204:                                                                                                  #  MOD NO:  1    MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67
057439,000205:                                                                                                  #  MOD NO:  2    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 68         ACCEPT DIFFERENT EARTH/MOON SCALES
057440,000206:                                                                                                  #                                                                        ALSO IMPROVE ACCURACY OF RAPO.
057441,000207: 
057442,000208:                                                                                                  #  FUNCTIONAL DESCRIPTION:  USED BY CALCTPER AND TFF DISPLAYS TO CALCULATE PERIGEE RADIUS AND ALSO
057443,000209:                                                                                                  #        APOGEE RADIUS FOR A GENERAL CONIC.
057444,000210:                                                                                                  #        PROGRAM GIVES PERIGEE RADIUS AS         APOGEE RADIUS IS GIVEN BY
057445,000211:                                                                                                  #                RP = P/(1+E)                            RA = (1+E) / ALFA
057446,000212:                                                                                                  #        WHERE    2
057447,000213:                                                                                                  #                E  = 1 - P ALFA
057448,000214:                                                                                                  #        IF RA IS NEGATIVE OR SHOWS DIVIDE OVERFLOW, THEN RA = POSMAX BECAUSE
057449,000215:                                                                                                  #                1. APOGEE RADIUS IS NOT MEANINGFUL FOR HYPERBOLA
057450,000216:                                                                                                  #                2. APOGEE RADIUS IS NOT DEFINED FOR PARABOLA
057451,000217:                                                                                                  #                3. APOGEE RADIUS EXCEEDS THE SCALING FOR ELLIPSE.
057452,000218: 
057453,000219:                                                                                                  #        THIS SUBROUTINE REQUIRES THE SIGNED RECIPROCAL SEMI MAJ AXIS, ALFA, AND SEMI LATUS RECTUM AS DATA.
057454,000220: 
057455,000221:                                                                                                  #  CALLING SEQUENCE:     CALL
057456,000222:                                                                                                  #                                TFFRP/RA
057457,000223:                                                                                                  #        PUSHLOC = PDL+0, ARBITRARY IF LEQ 10D
057458,000224:                                                                                                  #        C(MPAC) UNSPECIFIED
057459,000225: 
057460,000226:                                                                                                  #  SUBROUTINES CALLED:   NONE
057461,000227: 
057462,000228:                                                                                                  #  NORMAL EXIT MODE:     RVQ
057463,000229:                                                                                                  #        IF ELLIPSE, WITHIN NORMAL SCALING, RAPO IS CORRECT.
057464,000230:                                                                                                  #        OTHERWISE, RAPO = POSMAX.
057465,000231: 
057466,000232:                                                                                                  #  ALARMS:       NONE
057467,000233: 
057468,000234:                                                                                                  #  OUTPUT:       STORED IN PUSH LIST AREA.  SCALE OF OUTPUT AGREES WITH DATA SUPPLIED TO TFF/CONIC.
057469,000235:                                                                                                  #        RPER    E:(-29) M:(-27)         M       PERIGEE RADIUS          DESTROYED BY CALCTFF/CALCTPER, TFFTRIG.
057470,000236:                                                                                                  #        RAPO    E:(-29) M:(-27)         M       APOGEE RADIUS           WILL BE DESTROYED BY CALCTFF/CALCTPER
057471,000237:                                                                                                  #        PUSHLOC AT PDL+0
057472,000238: 
057473,000239:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
057474,000240:                                                                                                  #        TFFALFA E:(26-NR)               M       1/SEMI MAJ AXIS LEFT BY TFFCONIC
057475,000241:                                                                                                  #                M:(24-NR)
057476,000242:                                                                                                  #        TFFNP   E:(-38+2NR)             M       LC P, SEMI LATUS RECTUM LEFT BY TFFCONIC
057477,000243:                                                                                                  #                M:(-36+2NR)
057478,000244:                                                                                                  #        X1                              -NR, NORM COUNT OF RMAG         LEFT BY TFFCONIC
057479,000245:                                                                                                  #        X2                              -NA, NORM COUNT OF ALFA         LEFT BY TFFCONIC
057480,000246: 
057481,000247:                                                                                                  #  DEBRIS:       QPRET, PDL+0 ... PDL+1
057482,000248: 
057483,000249: 27,3027                        RAPO               =        16D                                   #  APOGEE RADIUS  M  E:(-29) M:(-27)
057484,000250: 27,3027                        RPER               =        14D                                   #  PERIGEE RADIUS  M  E:(-29) M:(-27)
057485,000251: 
057486,000252: 27,3027           41345        TFFRP/RA           DLOAD    DMP                                   
057487,000253: 27,3030           00033                                    TFFALFA                               #  ALFA  1/M  E:(26-NR) M:(24-NR)
057488,000254: 27,3031           00035                                    TFFNP                                 #  LC P  M E:(-38+2NR) M:(-36+2NR)
057489,000255: 27,3032           57457                           SR*      DCOMP                                 #  ALFA P (-12+NR)
057490,000256: 27,3033           20571                                    0          -8D,1                      #  ALFA P (-4)
057491,000257: 27,3034           51415                           DAD      ABS                                   #  (DCOMP GIVES VALID TP RESULT FOR SQRT)
057492,000258:                                                                                                  #  (ABS PROTECTS SQRT IF E IS VERY NEAR 0)
057493,000259: 27,3035           17367                                    DP2(-4)                               
057494,000260: 27,3036           43366                           SQRT     DAD                                   #  E SQ = (1- P ALFA) (-4)
057495,000261: 27,3037           15324                                    TFF1/4                                
057496,000262: 27,3040           55206                           PUSH     BDDV                                  #  (1+E)  (-2)  TO PDL+0
057497,000263: 27,3041           00035                                    TFFNP                                 #  LCP  M  E:(-38+2NR) M:(-36+2NR)
057498,000264: 27,3042           53657                           SR*      SR*                                   #  (DOES SR THEN SL TO AVOID OVFL)
057499,000265: 27,3043           20601                                    0,1                                   #  X1=-NR
057500,000266: 27,3044           20572                                    0          -7,1                       #  (EFFECTIVE SL)
057501,000267: 27,3045           14017                           STODL    RPER                                  #  PERIGEE RADIUS  M  E:(-29) M:(-27)
057502,000268:                                                                                                  #  (1+E)  (-2)  FROM PDL+0
057503,000269: 27,3046           41005                           DMP      BOVB                                  
057504,000270: 27,3047           00027                                    TFF1/ALF                              #  E:(-22-2NA) M:(-20-2NA)
057505,000271: 27,3050           57353                                    TCDANZIG                              #  CLEAR OVFIND, IF ON.
057506,000272: 27,3051           53654                           BZE      SL*                                   
057507,000273: 27,3052           57061                                    MAXRA                                 #  SET POSMAX, IF ALFA=0
057508,000274: 27,3053           57603                                    0          -5,2                       #  -5+NA
057509,000275: 27,3054           40057                           SL*      BOV                                   
057510,000276: 27,3055           57576                                    0,2                                   
057511,000277: 27,3056           57061                                    MAXRA                                 #  SET POSMAX IF OVFL.
057512,000278: 27,3057           77644                           BPL                                            #  CONTINUE WITH VALID RAPO.
057513,000279: 27,3060           57063                                    +3                                    
057514,000280: 27,3061           77745        MAXRA              DLOAD                                          #  RAPO CALC IS NOT VALID.  SET RAPO =
057515,000281: 27,3062           17373                                    NEARONE                               #  POSMAX AS A TAG.
057516,000282: 27,3063           00021                 +3        STORE    RAPO                                  #  APOGEE RADIUS  M  E:(-29) M:(-27)
057517,000283: 27,3064           77616        DUMPRPRA           RVQ                                            
057518,000284:                                                                                                  #                        30 W
057519,000285:                                                                                                  #  SUBROUTINE NAME:  CALCTPER / CALCTFF          DATE:  01.29.67
057520,000286:                                                                                                  #  MOD NO:  0                                    LOG SECTION:  TIME OF FREE FALL
057521,000287:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
057522,000288:                                                                                                  #  MOD NO:  1    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 67
057523,000289:                                                                                                  #  MOD NO:  2    MOD BY:  RR BAIRNSFATHER        DATE: 14 APR 67
057524,000290:                                                                                                  #  MOD NO:  3    MOD BY:  RR BAIRNSFATHER        DATE: 8 JUL 67          NEAR EARTH MUE AND NEG TFF (GONEPAST)
057525,000291:                                                                                                  #  MOD NO:  4    MOD BY:  RR BAIRNSFATHER        DATE: 21 NOV 67         ADD VARIABLE MU.
057526,000292:                                                                                                  #  MOD NO:  5    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 68         ACCEPT DIFFERENT EARTH/MOON SCALES
057527,000293: 
057528,000294:                                                                                                  #  FUNCTIONAL DESCRIPTION:  PROGRAM CALCULATES THE FREE-FALL TIME OF FLIGHT FROM PRESENT POSITION RN AND
057529,000295:                                                                                                  #        VELOCITY VN TO A RADIUS LENGTH SPECIFIED BY RTERM, SUPPLIED BY THE USER.  THE POSITION VECTOR
057530,000296:                                                                                                  #        RN MAY BE ON EITHER SIDE OF THE CONIC, BUT RTERM IS CONSIDERED ON THE INBOUND SIDE.
057531,000297:                                                                                                  #        THE EQUATIONS ARE
057532,000298: 
057533,000299:                                                                                                  #                Q2 = -SQRT(RTERM (2-RTERM ALFA) - LCP)  (INBOUND SIDE)) LEQ +- LCE/SQRT(ALFA)
057534,000300:                                                                                                  #                     -  -
057535,000301:                                                                                                  #                Q1 = RN.VN / SQRT(MU)                                   LEQ +- LCE/SQRT(ALFA)
057536,000302: 
057537,000303:                                                                                                  #                Z = NUM / DEN                                           LEQ +- 1/SQRT(ALFA)
057538,000304: 
057539,000305:                                                                                                  #        WHERE, IF INBOUND
057540,000306:                                                                                                  #                NUM = RTERM -RN                                         LEQ +- 2 LCE/ALFA
057541,000307:                                                                                                  #                DEN = Q2+Q1                                             LEQ +- 2 LCE/SQRT(ALFA)
057542,000308: 
057543,000309:                                                                                                  #        AND, IF OUTBOUND
057544,000310:                                                                                                  #                NUM = Q2-Q1                                             LEQ +- 2 LCE/SQRT(ALFA)
057545,000311:                                                                                                  #                DEN = 2 - ALFA (RTERM + RN).                            LEQ +- 2 LCE
057546,000312: 
057547,000313:                                                                                                  #        IF      ALFA ZZ < 1.0           (FOR ALL CONICS EXCEPT ELLIPSES HAVING ABS(DEL ECC ANOM) G 90 DEG)
057548,000314:                                                                                                  #        THEN    X = ALFA Z Z
057549,000315:                                                                                                  #        AND     TFF = (RTERM +RN -2 ZZ T(X) ) Z/SQRT(MU)
057550,000316:                                                                                                  #                EXCEPT  IF ALFA PNZ, AND IF TFF NEG,
057551,000317:                                                                                                  #                THEN    TFF = 2 PI /(ALFA SQRT(ALFA)) + TFF
057552,000318:                                                                                                  #        OR      IF ALFA ZZ GEQ 1.0      (FOR ELLIPSES HAVING ABS(DEL ECC ANOM) GEQ 90 DEG)
057553,000319:                                                                                                  #        THEN    X = 1/ALFA Z Z
057554,000320:                                                                                                  #        AND     TFF = (PI/SQRT(ALFA) -Q2 +Q1 +2(X T(X) -1) /ALFA Z) /ALFA SQRT(MU)
057555,000321:                                                                                                  #        WHERE   T(X) IS A POLYNOMIAL APPROXIMATION TO THE SERIES
057556,000322:                                                                                                  #                             2      3             2
057557,000323:                                                                                                  #                1/3 - X/5 + X /7 - X /9 ...     (X  < 1.0)
057558,000324: 
057559,000325:                                                                                                  #  CALLING SEQUENCE:     TIME TO RTERM                   TIME TO PERIGEE
057560,000326:                                                                                                  #                        CALL                            CALL
057561,000327:                                                                                                  #                                CALCTFF                         CALCTPER
057562,000328:                                                                                                  #                        C(MPAC) = TERMNL RAD M          C(MPAC) = PERIGEE RAD M
057563,000329:                                                                                                  #        FOR EITHER, E:(-29) M:(-27)
057564,000330:                                                                                                  #        FOR EITHER, PUSHLOC = PDL+0, ARBITRARY IF LEQ 8D.
057565,000331: 
057566,000332:                                                                                                  #  SUBROUTINES CALLED:   T(X), VIA RTB
057567,000333: 
057568,000334:                                                                                                  #  NORMAL EXIT MODE:     RVQ
057569,000335:                                                                                                  #        HOWEVER, PROGRAM EXITS WITH ONE OF THE FOLLOWING VALUES FOR TFF (-28) CS IN MPAC.  USER MUST STORE.
057570,000336:                                                                                                  #                A. TFF = FLIGHT TIME.  NORMAL CASE FOR POSITIVE FLIGHT TIME LESS THAN ONE ORBITAL PERIOD.
057571,000337:                                                                                                  #                B. (THIS OPTION IS NO LONGER USED.)
057572,000338:                                                                                                  #                C. TFF = POSMAX.  THIS INDICATES THAT THE CONIC FROM THE PRESENT POSITION WILL NOT RETURN TO
057573,000339:                                                                                                  #                   THE SPECIFIED ALTITUDE.  ALSO INDICATES OUTBOUND PARABOLA OR HYPERBOLA.
057574,000340: 
057575,000341:                                                                                                  #  OUTPUT:       C(MPAC)         (-28) CS        TIME OF FLIGHT, OR TIME TO PERIGEE
057576,000342:                                                                                                  #                TFFX            (0)             X,                                      LEFT FOR ENTRY DISPLAY TFF ROUTINES
057577,000343:                                                                                                  #                NRTERM          E:(-29+NR) M    RTERM, WEIGHTED BY NR                   LEFT FOR ENTRY DISPLAY TFF ROUTINES
057578,000344:                                                                                                  #                                M:(-27+NR)
057579,000345:                                                                                                  #                TFFTEM          E:(-59+2NR)     LCP Z Z SGN(SDELF)                      LEFT FOR ENTRY DISPLAY TFF ROUTINES
057580,000346:                                                                                                  #                                M:(-55+2NR)     LCP /ALFA SGN(SDELF)                    LEFT FOR ENTRY DISPLAY TFF ROUTINES
057581,000347:                                                                                                  #                NOTE:   TFFTEM = PDL 36D AND WILL BE DESTROYED BY .:UNIT:.
057582,000348:                                                                                                  #                RMAG1           E:(-29) M:(-27) PDL 12 NOT TOUCHED.
057583,000349:                                                                                                  #                TFFQ1           E:(-16) M:(-15) PDL 14D
057584,000350:                                                                                                  #                TFFDELQ         E:(-16) M:(-15) PDL 10D
057585,000351:                                                                                                  #                PUSHLOC AT PDL+0
057586,000352: 
057587,000353:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
057588,000354:                                                                                                  #                RONE            E:(-29) M:(-27) M  STATE VECTOR                         LEFT BY USER
057589,000355:                                                                                                  #                VONE'           E:(+10) M:(+9)  VN/SQRT(MU)                             LEFT BY TFF/CONIC
057590,000356:                                                                                                  #                RMAG1           E:(-29) M:(-27) PRESENT RADIUS, M                       LEFT BY TFFCONIC
057591,000357:                                                                                                  #                C(MPAC)         E:(-29) M:(-27) RTERM, TERMINAL RADIUS LENGTH, M        LEFT BY USER
057592,000358: 
057593,000359:                                                                                                  #                THE FOLLOWING ARE STORED IN THE PUSH LIST AREA.
057594,000360:                                                                                                  #                TFF/RTMU        E:(17) M:(14)   1/SQRT(MU)                              LEFT BY TFFCONIC.
057595,000361:                                                                                                  #                NRMAG           E:(-29+NR)      M  RMAG, NORMALIZED                     LEFT BY TFFCONIC
057596,000362:                                                                                                  #                                M:(-27+NR)
057597,000363:                                                                                                  #                X1                              -NR, NORM COUNT                         LEFT BY TFFCONIC
057598,000364:                                                                                                  #                TFFNP           E:(-38+2NR)     M  LCP, SEMI LATUS RECTUM, WEIGHT NR    LEFT BY TFFCONIC
057599,000365:                                                                                                  #                                M:(-36+2NR)
057600,000366:                                                                                                  #                TFFALFA         E:(26-NR)       1/M  ALFA, WEIGHT NR                    LEFT BY TFFCONIC
057601,000367:                                                                                                  #                                M:(24-NR)
057602,000368:                                                                                                  #                TFFRTALF        E:(10+NA)       SQRT(ALFA), NORMALIZED                  LEFT BY TFFCONIC
057603,000369:                                                                                                  #                                M:(9+NA)
057604,000370:                                                                                                  #                X2                              -NA, NORM COUNT                         LEFT BY TFFCONIC
057605,000371:                                                                                                  #                TFF1/ALF        E:(-22-2NA)     SIGNED SEMIMAJ AXIS, WEIGHTED BY NA     LEFT BY TFFCONIC
057606,000372:                                                                                                  #                                M:(-20-2NA)
057607,000373: 
057608,000374:                                                                                                  #  DEBRIS:       QPRET, PDL+0 ... PDL+3
057609,000375:                                                                                                  #                RTERM           E:(-29) M:(-27) RTERM, TERMINAL RADIUS LENGTH
057610,000376:                                                                                                  #                RAPO            E:(-29) M:(-27) PDL 16D (=NRTERM)
057611,000377:                                                                                                  #                RPER            E:(-29) M:(-27) PDL 14D (=TFFQ1)
057612,000378: 
057613,000379: 27,3065           77614        CALCTPER           SETGO                                          #  ENTER WITH RPER IN MPAC
057614,000380: 27,3066           03436                                    TFFSW                                 
057615,000381: 27,3067           57072                                    +3                                    
057616,000382: 27,3070           77614        CALCTFF            CLEAR                                          #  ENTER WITH RTERM IN MPAC
057617,000383: 27,3071           03676                                    TFFSW                                 
057618,000384: 27,3072           00023                 +3        STORE    RTERM                                 #  E:(-29) M:(-27)
057619,000385: 27,3073           77657                           SL*                                            
057620,000386: 27,3074           20201                                    0,1                                   #  X1=-NR
057621,000387: 27,3075           00021                           STORE    NRTERM                                #  RTERM  E:(-29+NR) M:(-27+NR)
057622,000388: 27,3076           44205                           DMP      BDSU                                  
057623,000389: 27,3077           00033                                    TFFALFA                               #  ALFA  E:(26-NR) M:(24-NR)
057624,000390: 27,3100           15324                                    TFF1/4                                
057625,000391: 27,3101           41206                           PUSH     DMP                                   #  (2-ALFA RTERM)  (-3)  TO PDL+0
057626,000392: 27,3102           00021                                    NRTERM                                #  E:(-29+NR) M:(-27+NR)
057627,000393: 27,3103           53725                           PDDL     SR*                                   #  RTERM(2-ALFA RTERM) TO PDL+2
057628,000394:                                                                                                  #  E:(-32+NR) M:(-30+NR)
057629,000395: 27,3104           00035                                    TFFNP                                 #  LC P  E:(-38+2NR) M:(-36+2NR)
057630,000396: 27,3105           20573                                    0          -6,1                       #  X1 = -NR
057631,000397: 27,3106           43276                           DCOMP    DAD                                   #  DUE TO SHIFTS, KEEP PRECISION FOR SQRT
057632,000398:                                                                                                  #  RTERM(2-ALFA RTERM) FROM PDL +2
057633,000399:                                                                                                  #  E:(-32+NR) M:(-30+NR)
057634,000400: 27,3107           77657                           SR*                                            #  LEAVE  E:(-32) M:(-30)
057635,000401: 27,3110           20601                                    0,1                                   #  X1 = -NR
057636,000402: 27,3111           71214                           BOFF     DLOAD                                 #  CHECK TFF /TPER SWITCH
057637,000403: 27,3112           03756                                    TFFSW                                 
057638,000404: 27,3113           57115                                    +2                                    #  IF TFF, CONTINUE
057639,000405: 27,3114           15334                                    TFFZEROS                              #  IF TPER, SET Q2 = 0
057640,000406: 27,3115           75440                 +2        BMN      SQRT                                  #  E:(-16) M:(-15)
057641,000407: 27,3116           57250                                    MAXTFF1                               #  NO FREE FALL CONIC TO RTERM FROM HERE
057642,000408:                                                                                                  #  RESET PDL, SET TFF=POSMAX, AND EXIT.
057643,000409: 
057644,000410: 27,3117           41076                           DCOMP    BOVB                                  #  RT IS ON INBOUND SIDE.  ASSURE OVFIND=0
057645,000411: 27,3120           57353                                    TCDANZIG                              #  ANY PORT IN A STORM.
057646,000412: 27,3121           24045                           STOVL    TFFTEM                                #  Q2  E:(-16) M:(-15)
057647,000413: 27,3122           02372                                    VONE'                                 #  VN/SQRT(MU)  E:(10) M:(9)
057648,000414: 27,3123           52441                           DOT      SL3                                   
057649,000415: 27,3124           02327                                    RONE                                  #  SAVED RN.  E:(-29) M:(-27)
057650,000416: 27,3125           00017                           STORE    TFFQ1                                 #  Q1, SAVE FOR GONEPAST TEST.
057651,000417:                                                                                                  #  E:(-16) M:(-15)
057652,000418: 27,3126           44240                           BMN      BDSU                                  
057653,000419: 27,3127           57150                                    INBOUND                               #  USE ALTERNATE Z
057654,000420: 27,3130           00045                                    TFFTEM                                #  Q2  E:(-16) M:(-15)
057655,000421: 
057656,000422:                                                                                                  #  OUTBOUND Z CALC CONTINUES HERE
057657,000423: 
057658,000424: 27,3131           14043                           STODL    TFFX                                  #  NUM=Q2-Q1  E:(-16) M:(-15)
057659,000425: 27,3132           00033                                    TFFALFA                               #  ALFA  E:(26-NR) M:(24-NR)
057660,000426: 27,3133           44205                           DMP      BDSU                                  
057661,000427: 27,3134           00041                                    NRMAG                                 #  RMAG  E:(-29+NR) M:(-27+NR)
057662,000428:                                                                                                  #  (2-RTERM ALFA)  (-3) FROM PDL+0
057663,000429: 27,3135           51406        SAVEDEN            PUSH     ABS                                   #  DEN TO PDL+0  E:(-3) OR (-16)
057664,000430:                                                                                                  #                M:(-3) OR (-15)
057665,000431: 27,3136           40015                           DAD      BOV                                   #  INDETERMINANCY TEST
057666,000432: 27,3137           17361                                    LIM(-22)                              #  =1.0-B(-22)
057667,000433: 27,3140           57161                                    TFFXTEST                              #  GO IF DEN >/= B(-22)
057668,000434: 27,3141           65345                           DLOAD    PDDL                                  #  SET DEN=0 OTHERWISE
057669,000435: 27,3142           15334                                    TFFZEROS                              
057670,000436:                                                                                                  #  XCH ZERO WITH PDL+0
057671,000437: 27,3143           57545                           DLOAD    DCOMP                                 
057672,000438: 27,3144           00033                                    TFFALFA                               #  ALFA  E:(26-NR) M:(24-NR)
057673,000439: 27,3145           71240                           BMN      DLOAD                                 #  FOR TPER:  Z INDET AT DELE/2=0 AND 90.
057674,000440: 27,3146           57255                                    TFFEL1                                #  ASSUME 90, AND LEAVE 0 IN PDL: 1/Z=D/N
057675,000441: 
057676,000442:                                                                                                  #  Z INDET. AT PERIGEE FOR PARAB OR HYPERB.
057677,000443: 27,3147           77616        DUMPTFF1           RVQ                                            #  RETURN TFF =0
057678,000444: 
057679,000445:                                                                                                  #  INBOUND Z CALC CONTINUES HERE
057680,000446: 
057681,000447: 27,3150           77745        INBOUND            DLOAD                                          #  RESET PDL+0
057682,000448: 27,3151           45345                           DLOAD    DSU                                   #  ALTERNATE Z CALC
057683,000449: 27,3152           00023                                    RTERM                                 #  E:(-29) M:(-27)
057684,000450: 27,3153           00015                                    RMAG1                                 #  E:(-29) M:(-27)
057685,000451: 27,3154           14043                           STODL    TFFX                                  #  NUM=RTERM-RN  E:(-29) M:(-27)
057686,000452: 27,3155           00045                                    TFFTEM                                #  Q2  E:(-16) M:(-15)
057687,000453: 27,3156           52015                           DAD      GOTO                                  
057688,000454: 27,3157           00017                                    TFFQ1                                 #  Q1  E:(-16) M:(-15)
057689,000455: 27,3160           57135                                    SAVEDEN                               #  DEN = Q2+Q1  E:(-16) M:(-15)
057690,000456: 
057691,000457: 27,3161           65215        TFFXTEST           DAD      PDDL                                  #  (ABS(DEN) TO PDL+2))  E:(-3) OR (-16)
057692,000458:                                                                                                  #                        M:(-3) OR (-15)
057693,000459: 27,3162           17363                                    DP(-22)                               #  RESTORE ABS(DEN) TO MPAC
057694,000460: 27,3163           00043                                    TFFX                                  #  NUM  E:(-16) OR (-29)  M:(-15) OR (-27)
057695,000461: 27,3164           53605                           DMP      SR*                                   
057696,000462: 27,3165           00031                                    TFFRTALF                              #  SQRT(ALFA)  E:(10+NA) M:(9+NA)
057697,000463: 27,3166           57201                                    0          -3,2                       #  X2=-NA
057698,000464: 27,3167           77671                           DDV                                            #  C(MPAC) =NUM SQRT(ALFA)       E:(-3) OR (-16)
057699,000465:                                                                                                  #                                M:(-3) OR (-15)
057700,000466:                                                                                                  #  ABS(DEN) FROM PDL+2   E:(-3) OR (-16)
057701,000467:                                                                                                  #                        M:(-3) OR (-15)
057702,000468: 27,3170           40145                           DLOAD    BOV                                   #  (THE DLOAD IS SHARED WITH TFFELL)
057703,000469: 27,3171           00043                                    TFFX                                  #  NUM  E:(-16) OR (-29)  M:(-15) OR (-27)
057704,000470: 27,3172           57253                                    TFFELL                                #  USE EQN FOR DELE GEQ 90, LEQ -90
057705,000471: 
057706,000472:                                                                                                  #  OTHERWISE, CONTINUE FOR GENERAL CONIC FOR TFF EQN
057707,000473: 
057708,000474: 27,3173           45471                           DDV      STADR                                 
057709,000475:                                                                                                  #  DEN FROM PDL+0        E:(-3) OR (-16)
057710,000476:                                                                                                  #                        M:(-3) OR (-15)
057711,000477: 27,3174           77732                           STORE    TFFTEM                                #  Z SAVE FOR SIGN OF SDELF.
057712,000478:                                                                                                  #  E:(-13) M:(-12)
057713,000479: 27,3175           63406                           PUSH     DSQ                                   #  Z TO PDL+0
057714,000480: 27,3176           41206                           PUSH     DMP                                   #  Z SQ TO PDL+2  E:(-26) M:(-24)
057715,000481: 27,3177           00035                                    TFFNP                                 #  LC P  E:(-38+2NR) M:(-36+2NR)
057716,000482: 27,3200           75261                           SL       SIGN                                  
057717,000483: 27,3201           20206                                    5                                     
057718,000484: 27,3202           00045                                    TFFTEM                                #  AFFIX SIGN FOR SDELF (ENTRY DISPLAY)
057719,000485: 27,3203           14045                           STODL    TFFTEM                                #  P ZSQ  E:(-59+2NR) M:(-55+2NR)
057720,000486:                                                                                                  #  (ARG IS USED IN TFF/TRIG)
057721,000487:                                                                                                  #  ZSQ FROM PDL+2  E:(-26) M:(-24)
057722,000488: 27,3204           41206                           PUSH     DMP                                   #  RESTORE PUSH LOC
057723,000489: 27,3205           00033                                    TFFALFA                               #  ALFA  E:(26-NR) M:(24-NR)
057724,000490: 27,3206           77657                           SL*                                            
057725,000491: 27,3207           20201                                    0,1                                   #  X1=-NR
057726,000492: 27,3210           00043                           STORE    TFFX                                  #  X
057727,000493: 27,3211           41234                           RTB      DMP                                   
057728,000494: 27,3212           57335                                    T(X)                                  #  POLY
057729,000495:                                                                                                  #  ZSQ FROM PDL+2  E:(-26) M:(-24)
057730,000496: 27,3213           44302                           SR2      BDSU                                  #  2 ZSQ T(X)  E:(-29) M:(-27)
057731,000497: 27,3214           00023                                    RTERM                                 #  RTERM  E:(-29) M:(-27)
057732,000498: 27,3215           41215                           DAD      DMP                                   
057733,000499: 27,3216           00015                                    RMAG1                                 #  E:(-29) M:(-27)
057734,000500:                                                                                                  #  Z FROM PDL+0  E:(-13) M:(-12)
057735,000501: 27,3217           51042                           SR3      BPL                                   #  TFF SQRT(MU)  E:(-45) M:(-42)
057736,000502: 27,3220           57241                                    ENDTFF                                #  (NO PUSH UP)
057737,000503: 27,3221           75206                           PUSH     SIGN                                  #  TFF SQRT(MU) TO PDL+0
057738,000504: 27,3222           00017                                    TFFQ1                                 #  Q1 FOR GONEPAST TEST
057739,000505: 27,3223           71244                           BPL      DLOAD                                 #  GONE PAST ?
057740,000506: 27,3224           57245                                    NEGTFF                                #  YES. TFF < 0.
057741,000507: 27,3225           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA) M:(-20-2NA)
057742,000508: 27,3226           51076                           DCOMP    BPL                                   #  ALFA > 0 ?
057743,000509: 27,3227           57245                                    NEGTFF                                #  NO. TFF IS NEGATIVE.
057744,000510: 
057745,000511:                                                                                                  #  CORRECT FOR ORBITAL PERIOD.
057746,000512: 
057747,000513: 27,3230           77676                           DCOMP                                          #  YES.  CORRECT FOR ORB PERIOD.
057748,000514: 27,3231           56205                           DMP      DDV                                   
057749,000515: 27,3232           17357                                    PI/16                                 #  2 PI (-5)
057750,000516: 27,3233           00031                                    TFFRTALF                              #  SQRT(ALFA)  E:(10+NA) M:(9+NA)
057751,000517: 27,3234           53657                           SL*      SL*                                   
057752,000518: 27,3235           57602                                    0          -4,2                       #  X2=-NA
057753,000519: 27,3236           57602                                    0          -4,2                       
057754,000520: 27,3237           43257                           SL*      DAD                                   
057755,000521: 27,3240           57576                                    0,2                                   
057756,000522:                                                                                                  #  TFF SQRT(MU) FROM PDL+0       E:(-45) M:(-42)
057757,000523: 27,3241           40005        ENDTFF             DMP      BOV                                   #  TFF SQRT(MU) IN MPAC          E:(-45) M:(-42)
057758,000524: 27,3242           00037                                    TFF/RTMU                              #  E:(17) M:(14)
057759,000525: 27,3243           57251                                    MAXTFF                                #  SET POSMAX IF OVFL.
057760,000526: 
057761,000527: 27,3244           77616        DUMPTFF2           RVQ                                            #  RETURN TFF (-28) CS IN MPAC.
057762,000528: 
057763,000529: 27,3245           77745        NEGTFF             DLOAD                                          
057764,000530:                                                                                                  #  TFF SQRT(MU) FROM PDL+0, NEGATIVE.
057765,000531: 27,3246           77650                           GOTO                                           
057766,000532: 27,3247           57241                                    ENDTFF                                
057767,000533: 
057768,000534: 27,3250           77745        MAXTFF1            DLOAD                                          #  RESET PDL
057769,000535: 27,3251           43545        MAXTFF             DLOAD    RVQ                                   
057770,000536: 27,3252           17373                                    NEARONE                               
057771,000537: 
057772,000538:                                                                                                  #  TIME OF FLIGHT ELLIPSE WHEN DEL (ECCENTRIC ANOM) GEQ 90 AND LEQ -90.
057773,000539: 
057774,000540:                                                                                                  #  NUM FROM TFFX.        E:(-16) OR (-29)
057775,000541:                                                                                                  #                        M:(-15) OR (-27)
057776,000542: 27,3253           77712        TFFELL             SL2                                            #  NUM  E:(-14) OR (-27)  M:(-13) OR (-25)
057777,000543: 27,3254           41465                           BDDV     PUSH                                  #  TEMP SAVE D/N IN PDL+0
057778,000544:                                                                                                  #  DEN FROM PDL+0  E:(-3)/( 16)  M:(-3)/(-15)
057779,000545:                                                                                                  #  N/D TO PDL+0  E:(11) M:(10)
057780,000546: 27,3255           45345        TFFEL1             DLOAD    DSU                                   #  (ENTER WITH D/N=0 IN PDL+0)
057781,000547: 27,3256           00045                                    TFFTEM                                #  Q2  E:(-16) M:(-15)
057782,000548: 27,3257           00017                                    TFFQ1                                 #  Q1  E:(-16) M:(-15)
057783,000549: 27,3260           14013                           STODL    TFFDELQ                               #  Q2-Q1  E:(-16) M:(-15)
057784,000550:                                                                                                  #  D/N FROM PDL+0
057785,000551: 27,3261           77626                           STADR                                          
057786,000552: 27,3262           77732                           STORE    TFFTEM                                #  D/N  E:(11) M:(10)
057787,000553: 27,3263           53605                           DMP      SL*                                   
057788,000554: 27,3264           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA) M:(-20-2NA)
057789,000555: 27,3265           57576                                    0,2                                   #  1/ALFA Z  E:(-11-NA) M:(-10-NA)
057790,000556: 27,3266           41206                           PUSH     DMP                                   #  TO PDL+0
057791,000557: 27,3267           00045                                    TFFTEM                                #  1/Z  E:(11) M:(10)
057792,000558: 27,3270           41057                           SL*      BOVB                                  
057793,000559: 27,3271           57576                                    0,2                                   #  X2= -NA
057794,000560: 27,3272           45712                                    SIGNMPAC                              #  IN CASE X= 1.0, CONTINUE
057795,000561: 27,3273           00043                           STORE    TFFX                                  #  X=1/ALFA ZSQ
057796,000562: 27,3274           41234                           RTB      DMP                                   
057797,000563: 27,3275           57335                                    T(X)                                  #  POLY
057798,000564: 27,3276           00043                                    TFFX                                  
057799,000565: 27,3277           45242                           SR3      DSU                                   
057800,000566: 27,3300           17365                                    DP2(-3)                               
057801,000567: 27,3301           41405                           DMP      PUSH                                  #  2(X T(X)-1) /Z ALFA   E:(-15-NA)
057802,000568:                                                                                                  #                        M:(-14-NA)
057803,000569:                                                                                                  #  1/ALFA Z FROM PDL+0   E:(-11-NA)
057804,000570:                                                                                                  #                        M:(-10-NA)
057805,000571: 27,3302           41345                           DLOAD    DMP                                   #  GET SIGN FOR SDELF
057806,000572: 27,3303           00045                                    TFFTEM                                #  1/Z  E:(11) M:(10)
057807,000573: 27,3304           00015                                    RMAG1                                 #  E:(-29) M:(-27)
057808,000574: 27,3305           43312                           SL2      DAD                                   
057809,000575: 27,3306           00017                                    TFFQ1                                 #  Q1  E:(-16) M:(-15)
057810,000576: 27,3307           14045                           STODL    TFFTEM                                #  (Q1+R 1/Z) =SGN OF SDELF  E:(-16) M:(-15
057811,000577: 27,3310           00035                                    TFFNP                                 #  LC P  E:(-38+2NR) M:(-36+2NR)
057812,000578: 27,3311           53605                           DMP      SL*                                   #  CALC FOR ARG FOR TFF/TRIG.
057813,000579: 27,3312           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA) M:(-20-2NA)
057814,000580: 27,3313           57575                                    1,2                                   #  X2=-NA
057815,000581: 27,3314           53765                           SIGN     SL*                                   
057816,000582: 27,3315           00045                                    TFFTEM                                #  AFFIX SIGN FOR SDELF
057817,000583: 27,3316           57576                                    0,2                                   
057818,000584: 27,3317           14045                           STODL    TFFTEM                                #  P/ALFA  E:(-59+2NR) M:(-55+2NR)
057819,000585:                                                                                                  #  (ARG FOR USE IN TFF/TRIG)
057820,000586: 27,3320           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA) M:(-20-2NA)
057821,000587: 27,3321           41366                           SQRT     DMP                                   
057822,000588: 27,3322           17357                                    PI/16                                 #  PI (-4)
057823,000589: 27,3323           77615                           DAD                                            
057824,000590:                                                                                                  #  2(XT(X)-1)/Z ALFA FROM PDL    E:(-15-NA)
057825,000591:                                                                                                  #                                M:(-14-NA)
057826,000592: 27,3324           45257                           SL*      DSU                                   
057827,000593: 27,3325           57577                                    0          -1,2                       
057828,000594: 27,3326           00013                                    TFFDELQ                               #  Q2-Q1  E:(-16) M:(-15)
057829,000595: 27,3327           53605                           DMP      SL*                                   
057830,000596: 27,3330           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA) M:(-20-2NA)
057831,000597: 27,3331           57601                                    0          -3,2                       
057832,000598: 27,3332           52057                           SL*      GOTO                                  
057833,000599: 27,3333           57602                                    0          -4,2                       
057834,000600: 27,3334           57241                                    ENDTFF                                #  TFF SQRT(MU) IN MPAC E:(-45) M:(-42)
057835,000601: 
057836,000602:                                                                                                  #  PROGRAM NAME:  T(X)                           DATE:  01.17.67
057837,000603:                                                                                                  #  MOD NO:  0                                    LOG SECTION:  TIME OF FREE FALL
057838,000604:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
057839,000605: 
057840,000606:                                                                                                  #  FUNCTIONAL DESCRIPTION:  THE POLYNOMIAL T(X) IS USED BY TIME OF FLIGHT SUBROUTINES CALCTFF AND
057841,000607:                                                                                                  #        CALCTPER TO APPROXIMATE THE SERIES
057842,000608:                                                                                                  #                           2     3
057843,000609:                                                                                                  #                1/3 -X/5 +X /7 -X /9 ...
057844,000610: 
057845,000611:                                                                                                  #        WHERE   X = ALFA Z Z            IF ALFA Z Z LEQ 1
057846,000612:                                                                                                  #                X = 1/(ALFA Z Z)        IF ALFA Z Z G 1
057847,000613: 
057848,000614:                                                                                                  #        ALSO    X IS NEG FOR HYPERBOLIC ORBITS
057849,000615:                                                                                                  #                X = 0 FOR PARABOLIC ORBITS
057850,000616:                                                                                                  #                X IS POSITIVE FOR ELLIPTIC ORBITS
057851,000617: 
057852,000618:                                                                                                  #        FOR FLIGHT 278, THE POLYNOMIAL T(X) IS FITTED OVER THE RANGE (0,+1) AND HAS A MAXIMUM
057853,000619:                                                                                                  #        DEVIATION FROM THE SERIES OF 2 E-5       (T(X) IS A CHEBYCHEV TYPE FIT AND WAS OBTAINED USING
057854,000620:                                                                                                  #        MAC PROGRAM AUTCURFIT294RRB AND IS VALID TO THE SAME TOLERANCE OVER THE RANGE (-.08,+1).)
057855,000621: 
057856,000622:                                                                                                  #  CALLING SEQUENCE:     RTB
057857,000623:                                                                                                  #                                T(X)
057858,000624:                                                                                                  #        C(MPAC) = X
057859,000625: 
057860,000626:                                                                                                  #  SUBROUTINES CALLED:  NONE
057861,000627: 
057862,000628:                                                                                                  #  NORMAL EXIT MODE:  TC DANZIG
057863,000629: 
057864,000630:                                                                                                  #  ALARMS:  NONE
057865,000631: 
057866,000632:                                                                                                  #  OUTPUT:  C(MPAC) = T(X)
057867,000633: 
057868,000634:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
057869,000635:                                                                                                  #        C(MPAC) = X
057870,000636: 
057871,000637:                                                                                                  #  DEBRIS:  NONE
057872,000638: 
057873,000639: 27,3335           07171        T(X)               TC       POLY                                  
057874,000640: 27,3336           00004                           DEC      4          B-14                       #  N-1
057875,000641: 27,3337           12525 12525                     2DEC     3.333333333 E-1                        
057876,000642: 27,3341           71463 57703                     2DEC*    -1.999819135 E-1*                       
057877,000643: 27,3343           04423 17645                     2DEC*    1.418148467 E-1*                       
057878,000644: 27,3345           74604 43667                     2DEC*    -1.01310997 E-1*                       
057879,000645: 27,3347           01626 37256                     2DEC*    5.609004986 E-2*                       
057880,000646: 27,3351           77404 52071                     2DEC*    -1.536156925 E-2*                       
057881,000647: 
057882,000648: 27,3353           06030        ENDT(X)            TC       DANZIG                                
057883,000649: 
057884,000650: 27,3354  27,3353               TCDANZIG           =        ENDT(X)                               
057885,000651: 
057886,000652:                                                                                                  #  TFF CONSTANTS
057887,000653: 
057888,000654: 32,3770                                           BANK     32                                    
057889,000655: 
057890,000656: 27,2000                                           SETLOC   TOF-FF1                               
057891,000657: 27,2000                                           BANK                                           
057892,000658: 
057893,000659:                                                                                                  #                                                NOTE _  NOTE _ ADJUSTED MUE FOR NEAR EARTH TRAJ.
057894,000660:                                                                                                  # MUE            =       3.990815471 E10         M CUBE/CS SQ
057895,000661:                                                                                                  # RTMUE          =       1.997702549 E5 B-18*    MODIFIED EARTH MU
057896,000662: 
057897,000663: 27,3354           24775 30424  1/RTMU             2DEC*    .5005750271 E-5        B17*            #  MODIFIED EARTH MU
057898,000664: 
057899,000665:                                                                                                  #                                                NOTE _  NOTE _ ADJUSTED MUE FOR NEAR EARTH TRAJ.
057900,000666:                                                                                                  # MUM            =       4.902778 E8             M CUBE/CS SQ
057901,000667:                                                                                                  # RTMUM          2DEC*   2.21422176 E4 B-18*
057902,000668: 27,3356           06220 37553  PI/16              2DEC     3.141592653 B-4                        
057903,000669: 27,3360           37777 37700  LIM(-22)           2OCT     3777737700                            #  1.0 -B(-22)
057904,000670: 27,3362           00000 00100  DP(-22)            2OCT     0000000100                            #  B(-22)
057905,000671: 27,3364           04000 00000  DP2(-3)            2DEC     1          B-3                        
057906,000672: 27,3366           02000 00000  DP2(-4)            2DEC     1          B-4                        #  1/16
057907,000673: 
057908,000674:                                                                                                  #  RPAD1         2DEC    6373338 B-29            M (-29) = 20909901.57 FT
057909,000675: 27,3370  22,3151               RPAD1              =        RPAD                                  
057910,000676: 
057911,000677: 27,3370           00305 11205  R300K              2DEC     6464778    B-29                       #  (-29) M
057912,000678: 27,3372           37777 37777  NEARONE            2DEC     .999999999                            
057913,000679: 27,3374  26,3333               TFFZEROS           EQUALS   HI6ZEROS                              
057914,000680: 27,3374  26,3323               TFF1/4             EQUALS   HIDP1/4                               

End of include-file TIME_OF_FREE_FALL.agc.  Parent file is MAIN.agc