home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
999.QSTMUFPC.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-07-03
|
8KB
|
266 lines
10 REM***************************************************
20 REM MINI IBM-PC MUF DRIVER
30 REM NATIONAL OCEANIC AND ATMOSPHERIC ADMINISTRATION
40 REM BOULDER, COLORADO
50 REM AUGUST 1985
60 REM
70 REM TAKEN FROM: QST, DEC.82 MINIMUF 3.5 R.B.ROSE, NOSC
80 REM***************************************************
90 REM
100 REM UTILIZATION OF FUNCTION:
110 REM
120 REM ARCCOS X = PI/2 - ARCTAN (X / SQR(1 - X*X))
130 REM
140 DEF FNC(Z) = 1.5708 - ATN(Z / SQR(1 -Z*Z))
150 REM INIT
160 REM OPEN FILE(2,1),"MUFOUT.DAT"
170 REM DIM M$(37)
180 DIM M5(24)
185 ANS2$="N"
190 A$ = " "
200 M = 31
210 M$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC"
220 P9=3.14159
230 R9=P9/180
240 P1=2*P9
250 R1=180/P9
260 P0=P9/2
270 CLS
280 PRINT
290 PRINT"** MAXIMUM USABLE FREQUENCY - PREDICTION PROGRAM **"
300 PRINT"___________________________________________________"
310 PRINT:PRINT
315 IF ANS2$="y" OR ANS2$="Y" THEN 345
320 INPUT "Transmitter lat, lon(west) = ";L1,W1
321 GOTO 380
330 IF L1<-90 THEN 360
340 IF L1>90 THEN 360
345 PRINT "Transmitter lat, lon(west) = ";L1;",";W1
350 GOTO 380
360 PRINT "Invalid latitude. Must be in range (-90,+90)."
370 GOTO 320
380 IF W1<-360 THEN 410
390 IF W1>360 THEN 410
400 GOTO 430
410 PRINT "Invalid longitude. Must be in range (-360,+360)."
420 GOTO 320
430 INPUT "Receiver lat, lon(west) = ";L2,W2
440 IF L2<-90 THEN 470
450 IF L2>90 THEN 470
460 GOTO 490
470 PRINT "Invalid latitude. Must be in range (-90,+90)."
480 GOTO 430
490 IF W2<-360 THEN 520
500 IF W2>360 THEN 520
510 GOTO 540
520 PRINT "Invalid longitude. Must be in range (-360,+360)."
530 GOTO 430
540 INPUT "Date (dd,mm) = ";D6,M0
550 IF M0<1 THEN 580
560 IF M0>12 THEN 580
570 GOTO 600
580 PRINT "Invalid month. Must be in range (1,12)."
590 GOTO 540
600 IF D6<1 THEN 630
610 IF D6>M THEN 630
620 GOTO 650
630 PRINT "Invalid day. Must be in range (1,";M;")."
640 GOTO 540
650 INPUT"Entering sunspot number(1) or 10.7cm solar flux(2) ";SUN1
660 IF SUN1 = 1 THEN 700
670 INPUT"Solar flux = ";S8
680 S9 = -62 + 1.08*S8
690 GOTO 710
700 INPUT "Sunspot number = ";S9
710 IF S9>0 THEN 740
720 PRINT "Invalid sunspot number. Must be non-negative."
730 GOTO 650
740 INPUT"Do you wish to save data to a file (Y or N) ";ANS$
750 IF ANS$ = "Y" THEN GOSUB 2550
760 IF ANS$ = "y" THEN GOSUB 2550
770 INPUT"Will you be using the printer (Y or N) ";PRI$
780 IF PRI$= "Y" THEN GOSUB 2570
790 IF PRI$= "y" THEN GOSUB 2570
800 REM **BEARING ROUTINE**
810 DR=3.14159265#/180:RD=1/DR
820 LATS=L1*DR
830 LONGS=W1*DR
840 LATD=L2*DR
850 LONGD=W2*DR
860 DIF=LONGD-LONGS
870 X=COS(LATD)*SIN(DIF)
880 Y=SIN(LATD)-SIN(LATS)
890 Z=COS(LATD)-COS(LATS)+COS(LATD)*(COS(DIF)-1)
900 N=Y*COS(LATS)-Z*SIN(LATS)
910 E=X
920 IF E>0 THEN 1010
930 IF N=0 THEN 970
940 IF N<0 THEN 990
950 BRG=ATN(E/N)*RD+360
960 GOTO 1080
970 BRG=270
980 GOTO 1080
990 BRG=ATN(E/N)*RD+180
1000 GOTO 1080
1010 IF N=0 THEN 1050
1020 IF N<0 THEN 1070
1030 BRG=ATN(E/N)*RD
1040 GOTO 1080
1050 BRG=90
1060 GOTO 1080
1070 BRG=180+ATN(E/N)*RD
1080 CH=SQR(X^2+Y^2+Z^2)
1090 CH1=CH/2
1100 CH3=SQR(CH1^2/(1-CH1^2))
1110 ARC=2*ATN(CH3)
1120 R=3960
1130 D=ARC*R
1140 CLS
1150 A$=MID$(M$,3*M0-2,3)
1160 PRINT"** MAXIMUM USABLE FREQUENCY - PREDICTION PROGRAM **"
1170 PRINT"___________________________________________________"
1180 PRINT
1190 PRINT "DATE: ";D6,A$
1200 PRINT"LOCATION:"
1210 PRINT " TRANSMITTER : ";"LATITUDE: ";L1;", LONGITUDE: ";W1
1220 PRINT " RECEIVER : ";"LATITUDE: ";L2;", LONGITUDE: ";W2
1230 PRINT "SUNSPOT NUMBER = ";S9
1235 PRINT
1240 PRINT "BEARING = ";:PRINT USING"#####.##";BRG;:PRINT" DEGREES"
1250 PRINT "DISTANCE = ";:PRINT USING"#####.##";D;:PRINT" MILES"
1260 PRINT:PRINT
1270 PRINT TAB(4);"HOUR";TAB(16);"MUF(MHZ)"
1280 PRINT " ------------------------"
1290 L1 = L1*R9
1300 W1 = W1*R9
1310 L2 = L2*R9
1320 W2 = W2*R9
1330 FOR T5=0 TO 23
1340 GOSUB 1580
1350 T5$ = STR$(T5)
1360 M5(T5) = INT(J9*100+1)/100
1370 J9$ = STR$(INT(J9))
1380 IF ANS$ = "Y" THEN GOSUB 2500
1390 IF ANS$ = "y" THEN GOSUB 2500
1400 PRINT TAB(5)USING"##";T5;
1410 PRINT TAB(17)USING"##.#";M5(T5)
1420 NEXT T5
1430 PRINT
1440 PRINT"Press 0 to preform next case,"
1450 PRINT" 1 to perform case over,"
1460 INPUT" 2 to stop execution ";A1
1470 L1 = L1/R9
1480 W1 = W1/R9
1490 L2 = L2/R9
1500 W2 = W2/R9
1510 IF A1 = 2 THEN 1560
1520 IF A1 = 1 THEN 740
1530 IF PRI$ = "Y" OR PRI$ = "y" THEN GOSUB 2570
1540 IF PRI$ = "Y" OR PRI$ = "y" THEN LPRINT CHR$(12)
1545 PRINT:INPUT"Do you wish to keep same transmitter lat/lon ";ANS2$
1550 GOTO 270
1560 BEEP : BEEP
1570 END
1580 REM - MINIMUF 3.5
1590 K7 = SIN(L1)*SIN(L2) + COS(L1)*COS(L2)*COS(W2-W1)
1600 IF K7>=-1 THEN 1630
1610 K7 = -1
1620 GOTO 1650
1630 IF K7<=1 THEN 1650
1640 K7 = 1
1650 G1 = FNC(K7)
1660 K6 = 1.59*G1
1670 IF K6 >=1 THEN 1690
1680 K6 = 1
1690 K5 = 1/K6
1700 J9 = 100
1710 FOR K1 = 1/(2*K6) TO 1-1/(2*K6) STEP .9999-1/K6
1720 IF K5 = 1 THEN 1740
1730 K5 = .5
1740 P = SIN(L2)
1750 Q = COS(L2)
1760 A = (SIN(L1) - P*COS(G1)) / (Q*SIN(G1))
1770 B = G1*K1
1780 C = P*COS(B) + Q*SIN(B)*A
1790 D = (COS(B) - C*P) / (Q*SQR(1-C^2))
1800 IF D=>-1 THEN 1830
1810 D = -1
1820 GOTO 1850
1830 IF D<=1 THEN 1850
1840 D = 1
1850 D = FNC(D)
1860 W0 = W2 + SGN(SIN(W1-W2))*D
1870 IF W0=>0 THEN 1890
1880 W0 = W0 + P1
1890 IF W0 < P1 THEN 1910
1900 W0 = W0 - P1
1910 IF C=>-1 THEN 1940
1920 C = -1
1930 GOTO 1960
1940 IF C<=1 THEN 1960
1950 C = 1
1960 L0 = P0 - FNC(C)
1970 Y1 = .0172*(10+(M0-1)*30.4+D6)
1980 Y2 = .409*COS(Y1)
1990 K8 = 3.82*W0+12+.13*(SIN(Y1)+1.2*SIN(2*Y1))
2000 K8 = K8-12*(1+SGN(K8-24))*SGN(ABS(K8-24))
2010 IF COS(L0+Y2)>-.26 THEN 2100
2020 K9 = 0
2030 G0 = 0
2040 M9 = 2.5*G1*K5
2050 IF M9<=P0 THEN 2070
2060 M9 = P0
2070 M9 = SIN(M9)
2080 M9 = 1+2.5*M9*SQR(M9)
2090 GOTO 2350
2100 K9 = (-.26+SIN(Y2)*SIN(L0))/(COS(Y2)*COS(L0)+.001)
2110 K9 = 12-ATN(K9/SQR(ABS(1-K9*K9)))*7.63944
2120 T = K8-K9/2+12*(1-SGN(K8-K9/2))*SGN(ABS(K8-K9/2))
2130 T4 = K8+K9/2-12*(1+SGN(K8+K9/2-24))*SGN(ABS(K8+K9/2-24))
2140 C0 = ABS(COS(L0+Y2))
2150 T9 = 9.7*C0^9.600001
2160 IF T9>.1 THEN 2180
2170 T9 = .1
2180 M9 = 2.5*G1*K5
2190 IF M9 <= P0 THEN 2210
2200 M9 = P0
2210 M9 = SIN(M9)
2220 M9 = 1+2.5*M9*SQR(M9)
2230 IF T4<T THEN 2260
2240 IF (T5-T)*(T4-T5)>0 THEN 2270
2250 GOTO 2400
2260 IF (T5-T4)*(T-T5)>0 THEN 2400
2270 T6 = T5+12*(1+SGN(T-T5))*SGN(ABS(T-T5))
2280 G9 = P9*(T6-T)/K9
2290 G8 = P9*T9/K9
2300 U = (T-T6)/T9
2310 G0 = C0*(SIN(G9)+G8*(EXP(U)-COS(G9)))/(1+G8*G8)
2320 G7 = C0*(G8*(EXP(-K9/T9)+1))*EXP((K9-24)/2)/(1+G8*G8)
2330 IF G0=>G7 THEN 2350
2340 G0 = G7
2350 G2 = (1+S9/250)*M9*SQR(6+58*SQR(G0))
2360 G2 = G2*(1-.1*EXP((K9-24)/3))
2370 G2 = G2*(1+(1-SGN(L1)*SGN(L2))*.1)
2380 G2 = G2*(1-.1*(1+SGN(ABS(SIN(L0))-COS(L0))))
2390 GOTO 2460
2400 T6 = T5+12*(1+SGN(T4-T5))*SGN(ABS(T4-T5))
2410 G8 = P9*T9/K9
2420 U = (T4-T6)/2
2430 U1 = -K9/T9
2440 G0 = C0*(G8*(EXP(U1)+1))*EXP(U)/(1+G8*G8)
2450 GOTO 2350
2460 IF G2>J9 THEN 2480
2470 J9 = G2
2480 NEXT K1
2490 RETURN
2500 OPEN FILEN$ FOR APPEND AS #1
2510 WRITE #1,T5,M5(T5)
2520 CLOSE #1
2530 RETURN
2540 RETURN
2550 INPUT"Name of data file (.DAT)";FILEN$
2560 RETURN
2570 PRINT"Pausing 10 seconds for you to toggle printer <CTRL+PRTSC>... "
2580 FOR T = 1 TO 5000:NEXT T
2590 RETURN