home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG058.ARC
/
ORBITT.BAS
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
27KB
|
549 lines
10 REM ---------------------------------------------------------
20 REM ******* *******
30 REM ******* AMSAT ORBITAL PREDICTION PROGRAM DE W3IWI *******
40 REM ******* *******
50 REM ******* F I L E = O R B I T *******
60 REM ******* *******
70 REM ******* D E W 3 I W I 1 0 J A N . 8 2 *******
80 REM ******* *******
90 REM ---------------------------------------------------------
100 REM
110 PRINT "ERROR MEANS YOU FORGOT TO APPEND ORBITAL ELEMENTS !!"
120 RESTORE 20000 : PRINT" THAT'S GOOD!"
130 DIM C(3,2) : P=0 : REM--P=PAGE # COUNTER
140 DIM X(4,9) : REM PLACE-HOLDERS FOR STATION NAME/COORD
150 DIM S(10) : REM--PLACE-HOLDERS FOR MULTI-SATELLITE LOOP
151 REM--FNT$ RETURNS TWO CHARACTER PRINTABLE STRING CORRESPONDING TO D--
152 DEF FNT$(D) = CHR$(48 + INT(D/10)) + CHR$(48 + D - 10 * INT(D/10))
153 REM ------------------------------
154 REM--FNI ROUNDS TO NEAREST INTEGER, ACCOUNTING FOR SIGN--
155 DEF FNI(D)=SGN(D) * INT (ABS(D) + .5)
160 REM
170 REM ------------------------------
180 GOSUB 2660 : REM*** (RE)INITIALIZATION FOR MULTIPLE PASSES ***
190 REM
200 REM ------------------------------
210 REM ***** SIGN-ON HEADER AND DISCLAIMER *****
220 PRINT" AMSAT ORBITAL PREDICTION PROGRAM DE W3IWI -- MAY, 1980"
230 PRINT" THIS VERSION PREPARED FOR DISTRIBUTION 10 JAN. 1982"
240 PRINT
250 PRINT" COPYRIGHT 1980 BY DR. THOMAS A. CLARK, W3IWI"
260 PRINT" 6388 GUILFORD ROAD"
270 PRINT" CLARKSVILLE, MD 21029"
280 PRINT" PERMISSION GRANTED FOR NON-COMMERCIAL USE PROVIDING"
290 PRINT" CREDIT IS GIVEN TO THE AUTHOR, AMSAT AND ORBIT MAGAZINE."
310 REM
320 REM ------------------------------
330 REM--***** REVISIONS FROM THE VERSION IN ORBIT #6 *****
340 REM
350 REM (1) ORBITAL ELEMENTS MOVED FROM THE LINES RANGING FROM
360 REM LINES 1100 THRU 9999 TO LINES BEGINNING 20000.
370 REM THIS ALLOWS THE ORBITAL ELEMENTS TO BE SEPARATE
380 REM FILES WHICH CAN BE MERGED WITH "APPEND". W3IWI 15 JULY 81
390 REM
400 REM (2) A PROCEEDURE HAS BEEN ADDED TO ALLOW THE PROGRAM
410 REM TO STEP MORE RAPIDLY WHILE THE SATELLITE IS BELOW
420 REM THE ELEVATION LIMIT (E8). THE PROCEEDURE INVOLVES
430 REM FORCIBLY MANIPULATING THE TIME VARIABLE (T)
440 REM WHILE THE SATELLITE IS BELOW THE LIMIT BY THE AD HOC
450 REM ALGORITHM IN LINE 2120. ONCE THE SATELLITE RISES, THE
460 REM TIME IS RE-SYNCHRONIZED IN LINE 2100. THE 3-POSITION
470 REM SWITCH (D0) IS USED TO SELECT THE ACTION NEXT TIME
480 REM THRU THE LOOP.
490 REM W3IWI 15 JULY 81
500 REM
510 REM (3) INCLUSION OF A PERIOD DERIVATIVE TERM IN MEAN MOTION
520 REM TO BETTER MODEL LOW-ALTITUDE SATELLITES LIKE UOSAT.
530 REM THIS INVOLVES CHANGES IN THE FNX "SUBROUTINES" IN LINES
540 REM 10140-10156, 10190, 10345-10350, 10450, PLUS THE NEW
550 REM VARIABLES N & A (MEAN MOTION & SMA AT T) & N1 (DRAG TERM).
560 REM NOTE THAT YOU MUST ADD THE N1 DRAG TERM (ORBITS/DAY^2)
570 REM TO THE ORBITAL ELEMENTS DATA STATEMENTS. THE 1ST PAGE
580 REM SUMMARY OF THE ELEMENTS HAS BEEN MADE MORE INFORMATIVE &
590 REM THE S.S.P. LONG & LAT NOW HAVE ONE MORE DIGIT THAN
600 REM IN THE PRINTOUTS IN ORBIT#6 ARTICLE.
610 REM W3IWI 15 NOV 81
620 REM
630 REM (4) IT IS NOW POSSIBLE TO SPECIFY MORE THAN ONE STATION.
640 REM AFTER CALCULATIONS FOR THE "MASTER" STATION HAVE BEEN
650 REM MADE, THE ADDITIONAL STATIONS ARE TESTED TO SEE IF THE
660 REM SATELLITE IS ALSO VISIBLE AT THE OTHER STATIONS.
670 REM
680 REM (5) SINCE RS-3 THRU RS-8 WERE LAUNCHED, WE FELT A NEED
690 REM TO BE ABLE TO SET UP A "BATCH" PROCESSING MODE TO
700 REM HANDLE MULTIPLE SATELLITES. YOU ARE NOW ABLE TO
710 REM SPECIFY A LIST OF UP TO 11 SATELLITES FOR PROCESSING.
720 REM
730 REM (6) WITH THE REVISIONS CITED ABOVE, THE LISTING WAS GETTING
740 REM RATHER CLUTTERED, SO THE LINE NUMBERS HAVE BEEN CLEANED
750 REM UP BY RENMUBERING. THE SUBROUTINES AT 10000 ARE STILL
760 REM AS THEY APPEARED IN ORBIT, WITH SLIGHT REVISIONS MADE
770 REM NECESSARY TO ACCOMMODATE THESE CHANGES.
780 REM W3IWI 10 JAN 82
790 REM
800 REM 73 ES GUD LUCK DE W3IWI
810 REM ------------------------------
820 REM
830 REM ***** SET STARTING DAY/TIME, DURATION & STEP SIZE & INITIALIZE *****
840 INPUT "START: YEAR = ",Y : Y=Y/100 : Y2=INT(100* (Y-INT(Y)) + .1)
850 IF Y2/4=INT(Y2/4) THEN F9=1 ELSE F9=0 : REM--F9=LEAP-YEAR FLAG
860 INPUT " MONTH (1-12) = ",M : INPUT " DAY = ",D
870 T1$=FNT$(Y2) + "/" + FNT$(M) + "/" + FNT$(D) + " AT "
880 REM--CALCULATE D8=DAY# (NOTE THAT MONTH #13 = JANUARY OF FOLLOWING YEAR)
890 RESTORE 2480 : FOR I=1 TO M : READ D9 : NEXT : D8=D+D9
900 IF M>2 THEN D8=D8+F9 : PRINT " DAY #";D8
910 INPUT "START: UTC HOURS = ",H
920 INPUT " MIN. = ",M : T7=D8 + H/24 + M/1440
930 T1$=T1$ + FNT$(H) + FNT$(M) + ":00" : REM--FOR PRINTING
940 INPUT "DURATION: HOURS = ",H1
950 INPUT " MIN. = ",M1: T8=T7 + H1/24 + M1/1440
960 INPUT "TIME STEP: MIN. = ",M2 : T9=M2/1440
965 IF M2 >= .999 THEN GOTO 970
967 PRINT "STEP OF A MINUTE OR MORE PLEASE." : GOTO 960
970 PRINT " FROM ";T7;" TO ";T8
980 REM INPUT "OUTPUT UNIT # ",P9 : IF P9<>0 THEN C9$=C8$
990 INPUT"PRINT SUMMARY OF ELEMENTS (Y/N)? ",Q2$
992 INPUT "SAVE TIME/AZ/EL DATA (Y/N)?"; SAVEOP$
993 IF SAVEOP$ <> "Y" THEN GOTO 1000
995 INPUT "FILE NAME FOR SAVED OUTPUT AZ/EL DATA:"; FILE$
1000 REM ------------------------------
1010 REM ***** GET VARIOUS PHYSICAL CONSTANTS *****
1020 RESTORE 2510 : READ P1,C,R0,F,G0,G1
1030 P2=2*P1 : P0=P1/180 : F=1/F
1040 READ Y1,G2 : IF Y1=Y2 THEN 1090 ELSE IF Y1>0 THEN 1040
1050 PRINT "UNABLE TO FIND YEAR ";Y2;" IN SIDEREAL TIME TABLE" : STOP
1060 REM
1070 REM ------------------------------
1080 REM ***** SELECT OBSERVING STATIONS *****
1090 RESTORE 15000 : PRINT C9$; "STATION SELECTION MENU" : I=1 : PRINT
1100 PRINT "STATION # 0 WILL BE THE MASTER STATION" : PRINT
1110 READ C$ : IF LEFT$(C$,3)="END" THEN 1170 ELSE READ W9,L9,H9,E8
1120 C$=C$+" " : C$=LEFT$(C$,10) : REM--PAD LENGTH
1130 REM--NOW PICK UP UP TO 4 ADDITIONAL STATIONS
1140 PRINT "STN # ";I;" = ";C$;"AT ";W9;" WLONG",
1150 PRINT " ";L9;" LAT ";E8;" EL"
1160 I=I+1 : GOTO 1110
1170 PRINT
1180 FOR K9=0 TO 8: REM--FILL IN STATION LIST
1190 PRINT "SELECT STATION # ";K9;" <0 TO END> "; : INPUT " ",K
1200 IF K=0 THEN 1270
1201 IF K>I THEN 1190
1202 RESTORE 15000 : K5=K9
1210 FOR J=1 TO K : READ C$,W9,L9,H9,E8 : NEXT J
1220 GOSUB 10520 : REM--CALCULATE EACH OBSERVER'S COORDINATES
1230 X(K5,0)=0 : X(K5,1)=X9 : X(K5,2)=Y9 : X(K5,3)=Z9 : X(K5,4)=0
1240 X(K5,5)=E8 : X(K5,6)=S8 : X(K5,7)=C8 : X(K5,8)=S9 : X(K5,9)=C9
1250 C$=C$+" " : C$=LEFT$(C$,10) : REM--PAD LENGTH
1260 C1$ = LEFT$(C1$,K5*10) + C$ + MID$(C1$,K5*10+11) : NEXT K9
1270 PRINT "THE FOLLOWING STATIONS HAVE BEEN SELECTED "
1280 PRINT " ";C1$ : C$=LEFT$(C1$,10) : IF K5<0 THEN 180
1290 REM
1300 REM ------------------------------
1310 REM ****** SELECT PARAMETERS FOR SATELLITE(S) OF INTEREST ******
1320 PRINT "SATELLITE SELECTION MENU" : I=0 : RESTORE 20000 : PRINT
1330 READ S$ : IF LEFT$(S$,3)="END" THEN 1360 ELSE READ I$ : I=I+1
1340 PRINT "ENTRY #";I;" FOR ";S$ : PRINT " ID = ";I$
1350 READ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D : GOTO 1330 : REM--D'S ARE DUMMY
1360 IF I>1 THEN 1370
1361 S(0)=1 : S(1)=1 : GOTO 1470
1370 PRINT
1380 PRINT "SELECT 1ST SATELLITE # <0 FOR ALL> ", : INPUT " ",J
1390 IF J>0 THEN 1410 ELSE S(0)=I
1400 FOR J=1 TO I : S(J)=J : NEXT J : GOTO 1470
1410 S(0)=1 : S(1)=J : PRINT "SELECT ADDITIONAL SATELLITES <0 ENDS LIST>"
1420 FOR J=2 TO I : PRINT "SATELLITE # ";J;TAB(37); : INPUT "",K
1430 IF K<=0 THEN 1470
1431 S(0)=J : S(J)=K : NEXT J
1440 REM
1450 REM ------------------------------
1460 REM ***** OUTER LOOP THROUGH ALL REQUESTED SATELLITES *****
1470 FOR J4=1 TO S(0) : RESTORE 20000
1480 FOR I=1 TO S(J4) : READ S$,I$,Y3,D3,H3,M3,S3
1490 READ K0,M0,N0,A0,N1,I0,E0,W0,O0,F1 : NEXT I
1500 IF J4>1 THEN 1540 : REM--SUPRESS DOPPLER INQUIRY IN "BATCH" MODE
1510 PRINT : PRINT "DOPPLER CALCULATED FOR FREQ = ";F1;" MHZ"
1520 REM : INPUT " CHANGE FREQUENCY TO (0 FOR DEFAULT) ",D
1530 IF D<>0 THEN F1=D
1540 IF Y3=Y2 THEN 1590 ELSE PRINT "ELEMENTS NOT FROM CURRENT YEAR"
1550 GOTO 2360
1560 REM--IF D3 IS AN INTEGER THEN EPOCH IS ASSUMED TO BE IN HH,MM,SS
1570 REM AS A TIME-OF-DAY.
1580 REM IF D3 IS NOT INTEGER, THEN D3 IS EPOCH IN DAYS + FRACTIONS.
1590 IF D3=INT(D3) THEN T0=D3 + H3/24 + M3/1440 + S3/86400! ELSE T0=D3
1600 REM
1605 IF Q2$<>"Y" THEN 1800 : REM--BYPASS PRINTOUT SUMMARY
1610 REM ------------------------------
1620 REM ***** PRINTOUT SUMMARY OF ELEMENTS, ETC *****
1630 PRINT C7$ : GOSUB 2390 : PRINT : PRINT
1640 PRINT "NORTH-STAR BASIC VERSION OF W3IWI ORBIT PROGRAM"
1650 PRINT "REVISIONS AS OF 10 JANUARY 1982 INCLUDED BY W3IWI"
1660 PRINT : PRINT,"ORBITAL ELEMENTS FOR ";S$
1670 PRINT " REFERENCE ID= ";I$ : PRINT
1680 PRINT "REFERENCE EPOCH = ";Y3;" +",T0
1690 PRINT "STARTING EPOCH = ";Y2;" +";T7;" = ";T1$
1700 PRINT "ELEMENTS ARE";T7-T0;" DAYS OLD AT STARTING EPOCH."
1710 PRINT
1720 PRINT "DURATION =";(T8-T7)*1440;" MINUTES = ",
1730 PRINT (T8-T7)*24;" HOURS"
1740 PRINT "STEP SIZE =";T9*1440;" MINUTES."
1750 PRINT
1760 PRINT "PARAMETER";TAB(20);"REFERENCE EPOCH",
1770 PRINT TAB(40);"STARTING EPOCH"
1780 PRINT "---------";TAB(20);"---------------",
1790 PRINT TAB(40);"--------------"
1800 REM--INITIALIZE TO EPOCH T BY CALLING FNC & FNM--
1810 T=T7 : GOSUB 10110 : GOSUB 10310
1815 IF Q2$<>"Y" THEN 1960
1820 PRINT "ORBIT NUMBER ";TAB(20);K0;TAB(40);K
1830 PRINT "MEAN ANOMALY ";TAB(20);M0;TAB(40);M/P0
1840 PRINT "INCLINATION ";TAB(20);I0;TAB(40);" [ NO CHANGE ]"
1850 PRINT "ECCENTRICITY ";TAB(20);E0;TAB(40);" [ NO CHANGE ]"
1860 PRINT "MEAN MOTION ";TAB(20);N0;TAB(40);N
1870 PRINT "DRAG CORRECTION";TAB(20);N1;" <+ FOR NORMAL DRAG SPEED-UP>"
1880 PRINT "S.M.A.,KM ";TAB(20);A0;TAB(40);A
1890 PRINT "PERIGEE HT,KM";TAB(20);A0*(1-E0)-R0;TAB(40);A*(1-E0)-R0
1900 PRINT "APOGEE HT,KM";TAB(20);A0*(1+E0)-R0;TAB(40);A*(1+E0)-R0
1910 PRINT "ARG. PERIGEE ";TAB(20);W0;TAB(40);W
1920 PRINT "R. A. A. N. ";TAB(20);O0;TAB(40);O
1930 PRINT "FREQ.,MHZ ";TAB(20);F1 : K9=9E+09 : K8=9E+09 : D0=2
1940 REM
1950 REM ------------------------------
1960 REM ****** HERE FOLLOWS THE ACTUAL COMPUTATION LOOP ******
1965 IF SAVEOP$ = "Y" THEN OPEN "O", #2, FILE$
1970 FOR T=T7 TO T8 STEP T9 : IF NOT K5 THEN 2000
1980 R6=X(0,0) : X9=X(0,1) : Y9=X(0,2) : Z9=X(0,3) : T6=X(0,4)
1990 E8=X(0,5) : S8=X(0,6) : C8=X(0,7) : S9=X(0,8) : C9=X(0,9)
2000 K7=INT(T) : GOSUB 10310 : IF D0 THEN 2040
2010 REM--NEW ORBIT? IF SO, UPDATE THE VALUES FOR W & O FOR NEW ORBIT
2020 IF K=K9 THEN 2040
2021 GOSUB 10110 : K8=9E+09 : K9=9E+09
2030 REM--ABOVE ELEVATION LIMIT? NEW DATE?
2040 GOSUB 10370 : GOSUB 10630 : D=E9-E8 : IF D<0 THEN 2120
2050 REM--IF IT'S BEEN BELOW HORIZON,THEN RESET TIME IN #726
2060 IF D0=0 THEN 2100 ELSE D0=2
2070 REM--ABOVE HORIZON--TEST ORBIT ## AND DATE
2080 IF K7=K8 AND K9=K THEN 2200 ELSE 2140
2090 REM--RESET TIME TO BE IN STEP
2100 T=T7 + T9*INT(((T-T7)/T9)-1) : D0=1 : GOTO 2000
2110 REM--THIS AD-HOC ALGORITHM SPEEDS UP THE STEPPING
2120 IF D0=1 THEN 2350
2121 D= R5*D*D *1E-09 : D0=0
2130 IF D > .2/N0 THEN T=T+ .2/N0
2131 T=T+D : GOTO 2350
2140 IF K=K9 THEN 2190
2141 GOSUB 2390 : K9=K
2150 PRINT " U.T.C. AZ EL DOPPLER RANGE HEIGHT";
2160 PRINT " LAT LONG PHASE"
2170 PRINT "HHMM:SS DEG DEG HZ KM KM ";
2180 PRINT " DEG DEG <256>"
2190 GOSUB 2800 : REM PRINT DAY + ORBIT HEADER
2200 K8=K7 : T4=T-K7 : S4=INT(T4*86400! + .5) : H4=INT(S4/3600 + .000001)
2210 M4=INT((S4 - H4*3600) / 60 + .000001) : S4=S4 - 3600*H4 - 60*M4
2211 IF FNI(S4) < 30 THEN S4 = 0!
2212 IF FNI(S4) = 0 THEN GOTO 2219
2213 S4 = 0! : M4 = M4 + 1!
2214 IF FNI(M4) < 60 THEN GOTO 2219
2216 M4 = 0! : H4 = H4 + 1!
2217 IF FNI(H4) < 24 THEN GOTO 2219
2218 H4 = 0! : K7 = K7 + 1 : GOSUB 2800
2219 T = K7 + H4/24! + M4/1440! + S4/86400! : REM RE-CALCULATE T
2220 T$=FNT$(H4) + FNT$(M4) + ":" + FNT$(S4) : REM--PRINTABLE TIME STRING
2230 F9=-F1*1E+06 * R8/C : REM--F9=DOPPLER(HZ)=FREQUENCY * VELOCITY/C
2240 PRINT : PRINT T$ TAB(10) FNI(A9) TAB(16) FNI(E9) TAB(22) FNI(F9) TAB(30)
2250 PRINT FNI(R5) TAB(38) FNI(R-R0) TAB(46) L5 TAB(56) W5 TAB(66) M9;
2255 IF SAVEOP$ = "Y" THEN PRINT #2, "(";T$;",";FNI(A9);",";FNI(E9);")"
2260 IF K5=0 THEN 2350
2261 X(0,0)=R6 : X(0,4)=T6
2270 FOR I=1 TO K5 : REM--LOOP THRU OTHER STATIONS TO SEE IF VISIBLE
2280 R6=X(I,0) : X9=X(I,1) : Y9=X(I,2) : Z9=X(I,3) : T6=X(I,4)
2290 E8=X(I,5) : S8=X(I,6) : C8=X(I,7) : S9=X(I,8) : C9=X(I,9)
2300 GOSUB 10630 : IF E9<E8 THEN 2330 ELSE F9=-F1*1E+06 * R8/C
2310 PRINT " ----";FNI(A9);FNI(E9);
2320 PRINT "AT ";MID$(C1$,I*10+1,I*10+10);
2330 X(I,0)=R6 : X(I,4)=T6
2340 NEXT I
2350 NEXT T : PRINT "END OF LOOP # ";J4;" FOR SATELLITE # ";S(J4)
2355 IF SAVEOP$ = "Y" THEN CLOSE #2
2360 NEXT J4 : PRINT : INPUT "PRESS RETURN TO CONTINUE ";D$ : GOTO 180
2370 REM ------------------------------
2380 REM ****** PAGE HEADER SUBROUTINE ******
2390 PRINT C8$;"ORBITAL PREDICTIONS FOR ";C$;" MIN. EL. =";E8;" DEG.";
2400 P=P+1 : PRINT TAB(55);"PG.#";P
2410 IF K5 THEN PRINT "SELECTED STATIONS = ";C1$
2420 PRINT "LOOP # ";J4;" FOR SATELLITE # ";S(J4);" = ";S$
2430 PRINT "ELEMENT SET ID = ";I$
2440 PRINT : RETURN
2450 REM ------------------------------
2460 REM ****** NUMERICAL AND PHYSICAL CONSTANTS ******
2470 REM--DAY# AT START OF EACH MONTH (THIRTY DAYS HATH SEPTOBER ...)
2480 DATA 0,31,59,90,120,151,181,212,243,273,304,334,365
2490 REM--PI, VELOCITY OF LIGHT, EARTH RADIUS,
2500 REM AND RECIPROCAL OF EARTH FLATTENING COEFFICIENT.
2510 DATA 3.1415926535 , 2.997925E5 , 6378.160 , 298.25
2520 REM--GRAVITATIONAL MASS (GM) OF EARTH IN UNITS OF
2530 REM ((ORBITS/DAY)^2) / (KM^3), AND SIDEREAL/SOLAR TIME RATE RATIO
2540 DATA 7.5369793E13 , 1.0027379093
2550 REM--GREENWICH SIDEREAL TIMES ON JAN 0.0 IN DAYS FOR 1979 THRU 1985
2560 DATA 79 , 0.2751843198
2570 DATA 80 , 0.2745212008
2580 DATA 81 , 0.2765959911
2590 DATA 82 , 0.2759328721
2600 DATA 83 , 0.2752697531
2610 DATA 84 , 0.2746066342
2620 DATA 85 , 0.2766814244
2630 DATA 0,0 : REM---TERMINATES SIDEREAL TIME TABLE
2640 REM ------------------------------
2650 REM**** (RE)INITIALIZATION FOR MULTIPLE PASSES RETURNS HERE ****
2660 REM--C7$=PAGE EJECT FOR FIRST PAGE OF EACH PASS
2670 C7$=CHR$(12)
2680 REM--C8$=PAGE-SEPARATOR $TRING (COULD BE FORM-FEED) FOR YOUR PRINTER--
2690 C8$=CHR$(10)+CHR$(13) : C8$=C8$+C8$ : C8$=C8$+C8$ : REM--4 LF/CR'S
2700 REM--C9$=CLEAR CRT SCREEN AND BEEP FOR PROMPT--
2710 C9$=CHR$(12) : PRINT C9$ : REM--AMS80+VDB4 COMPATIBLE
2720 REM--FILL C1$ WITH 50 BLANKS
2730 C1$=" ":C1$=C1$+C1$:C1$=C1$+C1$:C1$=C1$+C1$+LEFT$(C1$,10)
2740 REM--RESET THE PARAMETERS ASSOCIATED WITH MULTIPLE STATIONS/SATELLITES
2750 K5=-1 : FOR I=0 TO 10 : S(I)=0 : NEXT : S$="" : C$="" : I$=""
2760 REM--ANY OTHER SPECIALIZED CONFIGURATION INSTRUCTIONS GO HERE--
2770 RETURN
2780 REM ------------------------------
2800 PRINT TAB(10);"- - - DAY #";K7;" - - - ORBIT #";K;" - - -"
2810 IF SAVEOP$ = "Y" THEN PRINT #2, "DAY #";K7;"ORBIT #";K
2820 RETURN
10000 REM ****** ORBIT DETERMINATION AND UTILITY ROUTINES ******
10010 REM DEF FNA(X,Y)
10020 REM--CALCULATES INVERSE TANGENT IN PROPER QUADRANT, JUST LIKE
10030 REM THE FORTRAN ATAN2 FUNCTION.
10040 REM--CASES LYING IN QUADRANTS 2&3--
10050 IF XXX>=0 THEN 10055
10051 RRR = P1 + ATN(YYY/XXX) : RETURN
10055 IF XXX>0 THEN GOTO 10090
10060 REM--THE TWO CASES FOR XXX=0--
10070 IF YYY<0 THEN 10075
10071 RRR = P1/2 : RETURN
10075 RRR = 3*P1/2 : RETURN
10080 REM--CASES LYING IN QUADRANTS 1&4--
10090 IF YYY<0 THEN 10095
10091 RRR = ATN(YYY/XXX) : RETURN
10095 RRR = P2 + ATN(YYY/XXX) : RETURN
10100 REM FNEND ----------------------------
10110 REM DEF FNC(T)
10120 REM--ROUTINE TO INITIALIZE THE C(J,K) COORDINATE ROTATION MATRIX
10130 REM AND OTHER PARAMETERS ASSOCIATED WITH THE ORBITAL ELEMENTS.
10139 REM--GIVEN N0=MEAN MOTION, EXECUTE LINES 1014X
10140 REM--INPUT ELEMENTS GIVE EITHER A0= SEMI-MAJOR AXIS IN KM OR
10142 REM N0=MEAN MOTION IN ORBITS/DAY. DECIDE WHICH WAS GIVEN AND
10144 REM CALCULATE THE OTHER, INCLUDING DRAG CORRECTIONS --
10146 IF N0 > .1 THEN 10150
10148 N0=SQR(G0 / (A0^3)) : GOTO 10154 : REM CALCULATE MEAN MOTION
10150 A0=((G0 / (N0*N0)) ^ (1/3)) : REM--CALCULATE SMA
10152 REM--THE FOLLOWING CORRECT FOR DRAG IN LOW-ALTITUDE SATELLITES--
10154 N=N0 + 2*(T-T0)*N1 : REM--MEAN MOTION AT T
10156 A =((G0 / (N *N )) ^ (1/3)) : REM--SMA AT EPOCH T
10160 E2=1-E0^2 : E1=SQR(E2) : Q0=M0/360 + K0 : REM--Q0=INITIAL ORBIT PHASE
10170 REM--ACCOUNT FOR NODAL EFFECTS DUE TO LUMPY GRAVITY FIELD DUE TO THE
10180 REM FLATTENED, OBLATE SPHEROIDAL, FIGURE OF THE EARTH
10190 K2=9.95 * ((R0/A)^3.5) / (E2^2)
10200 REM--UPDATE ELEMENTS TO CURRENT EPOCH & EVALUATE THEIR SIN/COS'S
10210 S1=SIN(I0*P0) : C1=COS(I0*P0) : REM--I0=INCLINATION (DEG)
10220 O=O0 - (T-T0) * K2 * C1
10230 S0=SIN(O*P0) : C0=COS(O*P0) : REM--O=R.A.A.N. (DEGREES)
10240 W=W0 + (T-T0) * K2 * (2.5 * (C1^2) - .5)
10250 S2=SIN(W*P0) : C2=COS(W*P0) : REM--W=ARGUMENT OF PERIGEE (DEGREES)
10260 REM--SET UP COORDINATE ROTATION MATRIX FOR THE CURRENT ORBIT
10270 C(1,1)= + (C2*C0) - (S2*S0*C1) : C(1,2)= - (S2*C0) - (C2*S0*C1)
10280 C(2,1)= + (C2*S0) + (S2*C0*C1) : C(2,2)= - (S2*S0) + (C2*C0*C1)
10290 C(3,1)= + (S2*S1) : C(3,2)= + (C2*S1) : RETURN
10300 REM FNEND ----------------------------
10310 REM DEF FNM(T)
10320 REM--FUNCTION TO EVALUATE M=MEAN ANOMALY IN (0-2*PI) RANGE,
10330 REM K=PERIGEE PASSAGE KOUNTER (=ORBIT ##) & M9=MODULO 256
10340 REM ORBITAL PHASE COMPATIBLE WITH GENERAL BEACON TELEMETRY.
10345 Q=Q0 + N0*(T-T0) + N1*((T-T0)^2) : REM--REVISED TO INCLUDE DRAG
10350 K=INT(Q+.000001) : M9=INT((Q-K+.000001)*256) : M=(Q-K)*P2 : RETURN
10360 REM FNEND ----------------------------
10370 REM DEF FNK(M)
10380 REM--ROUTINE TO SOLVE KEPLER'S EQUATION GIVEN M & RETURN
10390 REM THE SATELLITE'S GEOCENTRIC COORDINATES.
10400 E=M + E0*SIN(M) + .5 * (E0^2) * SIN(2*M) : REM--INITIAL TRIAL VALUE
10410 REM--ITERATION LOOP TO SOLVE TRANCENDENTAL KEPLER'S EQUATION--
10420 S3=SIN(E) : C3=COS(E) : R3=1 - E0*C3 : M1=E - E0*S3
10430 M5=M1-M : IF ABS(M5) < .000001 THEN 10450
10431 E=E - M5/R3 : GOTO 10420
10440 REM--NOW GET SATELLITE'S XYZ COORDINATES--
10450 X0=A*(C3-E0) : Y0=A*E1*S3 : R=A*R3 : REM--IN THE PLANE OF THE ORBIT
10460 REM--ROTATE FROM ORBIT PLANE TO INERTIAL CELESTIAL COORDINATES.
10470 X1=X0*C(1,1)+Y0*C(1,2) : Y1=X0*C(2,1)+Y0*C(2,2) : Z1=X0*C(3,1)+Y0*C(3,2)
10480 REM--ROTATE THRU CURRENT GHA OF ARIES, CONVERT TO GEOCENTRIC COORDINATES
10490 G7=T*G1 + G2 : G7=(G7-INT(G7)) * P2 : S7=-SIN(G7) : C7=COS(G7)
10500 X= + (X1*C7) - (Y1*S7) : Y= + (X1*S7) + (Y1*C7) : Z=Z1 : RETURN
10510 REM FNEND ----------------------------
10520 REM DEF FNO(D)
10530 REM--ROUTINE TO EVALUATE OBSERVER'S GEOCENTRIC COORDINATES,
10540 REM WHERE X-AXIS=GREENWICH, Y-AXIS=VU-LAND & Z-AXIS=NORTH POLE.
10550 L8=L9*P0 : S9=SIN(L8) : C9=COS(L8) : REM--INITIAL GEODETIC COORDINATES
10560 S8=SIN(-W9*P0) : C8=COS(W9*P0) : REM--W9=WEST LONGITUDE
10570 REM--FOLLOWING ACCOUNTS FOR FLATTENED OBLATE SPHEROIDAL EARTH--
10580 R9=R0*(1 - (F/2) + (F/2) *COS(2*L8)) + H9/1000 : REM--H9=HEIGHT(METERS)
10590 REM--FOLLOWING MAKES L8 BE THE GEOCENTRIC LATITUDE--
10600 L8=ATN( (1-F)^2 * S9/C9 ) : Z9=R9 * SIN(L8)
10610 X9=R9 * COS(L8) * C8 : Y9=R9 * COS(L8) * S8 : RETURN
10620 REM FNEND ----------------------------
10630 REM DEF FNX(T)
10640 REM--ROUTINE TO EXTRACT ALL THE PARAMETERS YOU MIGHT EVER NEED.
10650 REM FIRST GET VECTOR FROM OBSERVER TO SATELLITE--
10660 X5= (X-X9) : Y5= (Y-Y9) : Z5= (Z-Z9) : R5=SQR(X5^2 + Y5^2 + Z5^2)
10670 REM--FINITE DIFFERENCE THE RANGE (R5) TO GET THE VELOCITY (R8)--
10680 IF T6<>T THEN R8=((R6-R5)/(T6-T)) / 86400! ELSE R8=-9E+09
10690 R6=R5 : T6=T : REM--& SAVE CURRENT RANGE & TIME FOR NEXT TIME THRU
10700 REM--NOW ROTATE INTO OBSERVER'S LOCAL COORDINATES
10710 REM WHERE X8=NORTH, Y8=EAST & Z8=UP (LEFT-HANDED SYSTEM!)
10720 Z8= + (X5*C8*C9) + (Y5*S8*C9) + (Z5*S9)
10730 X8= - (X5*C8*S9) - (Y5*S8*S9) + (Z5*C9) : Y8= + (Y5*C8) - (X5*S8)
10740 S5=Z8/R5 : C5=SQR(1-S5*S5) : E9=ATN(S5/C5) / P0 : REM--E9=ELEVATION
10750 XXX=X8 : YYY = Y8 : GOSUB 10000 : A9=RRR / P0 : REM--FNA RESOLVES CORRECT QUADRANT FOR A9=AZIMUTH
10760 XXX = X : YYY = Y : GOSUB 10000 : W5=RRR / P0 : REM--W5=SUB-SATELLITE POINT (SSP) W.LONGITUDE
10770 B5=Z/R : L5=ATN(B5 / (SQR(1 - B5^2))) / P0 : REM--L5=SSP LATITUDE
10780 RETURN : REM--NOTE R-R0=SATELLITE'S ALTITUDE ABOVE MEAN SPHEROID.
10790 REM FNEND ----------------------------
15000 REM---LIST OF STATIONS. CALL,W.LONG,LAT,HT(METERS),MIN ELEV.
15010 DATA "VE3MWM", 79.838, 43.372, 0, 0
15020 DATA "VE3IXT", 80.07, 43.75, 0, 0
15040 DATA "N.GOSFORD", 208.82, -33.25, 0, 0
16000 DATA "END" : REM--ENDS STATION LIST
20000 REM
23000 DATA "RS3 = 81120A = #12997"
23010 DATA "NORAD DATA 19 mar --- ELEMS #52"
23020 DATA 83,078.48020061 ,0,0,0 : REM--EPOCH
23030 DATA 5553: REM -- REV
23040 DATA 138.5206 : REM--MEAN ANOM.
23050 DATA 12.15575695 ,0 : REM--MEAN MOTION
23060 DATA -.00000004 : REM--DRAG CORRECTION TERM
23070 DATA 82.9581 : REM--INCL.
23080 DATA 0.0057404 : REM--ECR.
23090 DATA 221.1520 : REM--ARG. OF PERG.
23100 DATA 25.7519 : REM--R.A.A.N.
23110 DATA +29.322 : REM--FREQ.
23120 REM
23130 REM
23140 REM
24000 DATA "RS4 = 81120D = #13000"
24010 DATA "NORAD DATA 23 mar 83 ---ELEMS #90"
24020 DATA 83,082.02218938 ,0,0,0 : REM--EPOCH
24030 DATA 5555 : REM -- REV
24040 DATA 73.4931 : REM--MEAN ANOM.
24050 DATA 12.06666541 ,0 : REM--MEAN MOTION
24060 DATA .00000112 : REM--DRAG CORRECTION TERM
24070 DATA 82.9539 : REM--INCL.
24080 DATA 0.0017600 : REM--ECR.
24090 DATA 286.4152 : REM--ARG. OF PERG.
24100 DATA 28.2136 : REM--R.A.A.N.
24110 DATA +29.360 : REM--FREQ.
24120 REM
24130 REM
24140 REM
25000 DATA "RS5 = 81120C = #12999"
25010 DATA "NORAD DATA 24 mar 83 -- ELEMS #79"
25020 DATA 83,083.05588240 ,0,0,0 : REM--EPOCH
25030 DATA 5560 : REM -- REV
25040 DATA 44.0837 : REM--MEAN ANOM.
25050 DATA 12.05040479 ,0 : REM--MEAN MOTION
25060 DATA .00000011 : REM--DRAG CORRECTION TERM
25070 DATA 82.9605 : REM--INCL.
25080 DATA 0.0009463 : REM--ECR.
25090 DATA 315.9507 : REM--ARG. OF PERG.
25100 DATA 28.3849 : REM--R.A.A.N.
25110 DATA +29.452 : REM--FREQ.
25120 REM
25130 REM
25140 REM
26000 DATA "RS6 = 81120F = #13002"
26010 DATA "NORAD DATA 24 mar 83-- ELEMS #50"
26020 DATA 83,083.03564248 ,0,0,0 : REM--EPOCH
26030 DATA 5599 : REM -- REV
26040 DATA 132.9637 : REM--MEAN ANOM.
26050 DATA 12.13552833 ,0 : REM--MEAN MOTION
26060 DATA .00000001 : REM--DRAG CORRECTION TERM
26070 DATA 82.9586 : REM--INCL.
26080 DATA 0.0048817 : REM--ECR.
26090 DATA 226.7347 : REM--ARG. OF PERG.
26100 DATA 24.2301 : REM--R.A.A.N.
26110 DATA +29.453 : REM--FREQ.
26120 REM
26130 REM
26140 REM
27000 DATA "RS7 = 81120E = #13001"
27010 DATA "NORAD DATA 21 mar 83-- ELEMS #94"
27020 DATA 83,080.34568085 ,0,0,0 : REM--EPOCH
27030 DATA 5544 : REM -- REV
27040 DATA 112.4729 : REM--MEAN ANOM.
27050 DATA 12.08674848 ,0 : REM--MEAN MOTION
27060 DATA .0000007: REM--DRAG CORRECTION TERM
27070 DATA 82.9577 : REM--INCL.
27080 DATA 0.0020583 : REM--ECR.
27090 DATA 247.4133 : REM--ARG. OF PERG.
27100 DATA 28.0496 : REM--R.A.A.N.
27110 DATA +29.341 : REM--FREQ.
27120 REM
27130 REM
27140 REM
28000 DATA "RS8 = 81120B = #12998"
28010 DATA "NORAD DATA 24-mar 83-- ELEMS #204"
28020 DATA 83,083.03372725 ,0,0,0 : REM--EPOCH
28030 DATA 5550 : REM -- REV
28040 DATA 1.0611 : REM--MEAN ANOM.
28050 DATA 12.02935231 ,0 : REM--MEAN MOTION
28060 DATA .00000201 : REM--DRAG CORRECTION TERM
28070 DATA 82.9427 : REM--INCL.
28080 DATA 0.0022939 : REM--ECR.
28090 DATA 359.0295 : REM--ARG. OF PERG.
28100 DATA 29.3461 : REM--R.A.A.N.
28110 DATA +29.502 : REM--FREQ.
28120 REM
28130 REM
28140 REM
29000 DATA "UOSAT -- OBJECT 81-100B -- CAT# 12888"
29010 DATA "NORAD ELEMENT SET #440 23 mar 83"
29020 DATA 83,082.39442220 ,0,0,0 : REM--EPOCH (Y,DAY#,H,M,S)
29030 DATA 8075 : REM--ORBIT # AT EPOCH
29040 DATA 134.4621 : REM--MEAN ANOMALY AT EPOCH
29050 DATA 15.21163225,0 : REM--MEAN MOTION,S.M.A
29060 DATA .00006115 : REM--DRAG CORRECTION TERM
29070 DATA 97.5352 : REM--INCLINATION
29080 DATA 0.0001396 : REM--ECCENTRICITY
29090 DATA 225.6474 : REM--ARG. OF PERIGEE
29100 DATA 48.3410 : REM--R.A.A.N.
29110 DATA +145.825 : REM--2M BEACON FREQ, MHZ
29120 REM
29130 REM
29140 REM
29500 DATA "AMSAT-OSCAR-8"
29510 DATA "NORAD ELEMENT SET #742 22 mar 82"
29520 DATA 83,081.44075485,0,0,0 : REM--EPOCH (Y,D.DD,OR H,M,S)
29530 DATA 25713 : REM--ORBIT # AT EPOCH
29540 DATA 164.6946 : REM--MEAN ANOMALY AT EPOCH
29550 DATA 13.96549749,0 : REM--MEAN MOTION OR SEMI-MAJOR AXIS
29560 DATA 0.00000147 : REM--DRAG CORRECTION TERM
29570 DATA 98.7637 : REM--INCLINATION
29580 DATA 0.0005770 : REM--ECCENTRICITY
29590 DATA 195.4035 : REM--ARG. OF PERIGEE
29600 DATA 98.2877 : REM--R.A.A.N.
29610 DATA +435.10 : REM--MODE-J BEACON FREQ.,MHZ
29630 REM
29800 DATA "AMSAT-OSCAR-10 OBJECT 14129"
29810 DATA "AFTER THE BURN, FROM NET 14/JUL"
29820 DATA 83,194.0 ,0,0,0 : REM--EPOCH (Y,D.DD,OR H,M,S)
29830 DATA 52 : REM--ORBIT # AT EPOCH
29840 DATA 249.2680 : REM--MEAN ANOMALY AT EPOCH
29850 DATA 2.05858267,0 : REM--MEAN MOTION OR SEMI-MAJOR AXIS
29860 DATA -5.841099E-6 : REM--DRAG CORRECTION TERM
29870 DATA 26.4305 : REM--INCLINATION
29880 DATA 0.6053443 : REM--ECCENTRICITY
29890 DATA 186.1003 : REM--ARG. OF PERIGEE
29900 DATA 250.2993 : REM--R.A.A.N.
29910 DATA +145.810 : REM--GENERAL BEACON FREQ.,MHZ
29930 REM
29998 DATA "END"
29999 END
ATA 250.2993 : REM--R.A.A.N.
29910 DATA +145.810 : REM--GENERAL BE