home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
educatin
/
aviautl1.lbr
/
AIRDATA.BZS
/
AIRDATA.BAS
Wrap
BASIC Source File
|
1987-03-22
|
5KB
|
115 lines
5 'This program written by R. G. Gross, Santa Cruz, CA
6 'Anyone is free to use it for non-commercial purposes. No responsibility
7 'can be accepted by the above for consequences of use of this program.
8 'This program was modified to run on H/Z-89,H/Z-90 CP/M-80 system. 3/15/87
10 PRINT CHR$(27);CHR$(69)
11 PRINT TAB(31)"AIRDATA PROGRAM"
12 PRINT
20 INPUT "What is the pressure altitude";PRESSALT
30 'determine standard atmospheric pressure ratio, delta
40 DELTA=((288.2-.001981*PRESSALT)/288.2)^5.2561
50 IF PRESSALT>36089! THEN LET DELTA=.2234*EXP(-(PRESSALT-36089!)/20806)
60 PRINT
70 INPUT "What is the Outside Air Temperature";OBSTEMP
80 PRINT
90 PRINT" Celsius (C) or Fahrenheit (F)?"
100 F$=INKEY$:IF F$="" THEN 100
110 IF F$="f" OR F$="F" THEN LET F$="F":INDTEMP=OBSTEMP
120 IF F$="F" THEN LET OBSTEMP=(OBSTEMP-32)*5/9 ELSE LET F$="C"
130 IF F$="C" THEN INDTEMP=OBSTEMP
140 AMBOBSTEMP=273.2+OBSTEMP
150 PRINT
160 PRINT " Is this Total (T), Ram (R), or Static (S) Air Temperature?"
170 PRINT
180 PRINT " Type H for help"
190 PRINT
200 TEMP$=INKEY$:IF TEMP$="" THEN 200
210 IF TEMP$="H" OR TEMP$="h" THEN 650
220 READ TRC
230 IF TEMP$="s" OR TEMP$="S" THEN SAT=AMBOBSTEMP
240 IF TEMP$="t" OR TEMP$="T" THEN LET IND$="Total"
250 IF TEMP$="r" OR TEMP$="R" THEN LET IND$="RAM"
260 IF TEMP$="s" OR TEMP$="S" THEN LET IND$="Static"
270 INPUT "What is Calibrated Air Speed (CAS) or Mach (M)";S
280 CAS=S
290 IF S<1 THEN MACH=S:CAS=0:GOTO 310
295 'use CAS and Press Alt to compute missing Mach
300 MACH=SQR(5*((1/DELTA*((1+.2*(CAS/661.5)^2)^3.5-1)+1)^(1/3.5)-1))
305 'use Mach to compute missing CAS
310 CAS=661.5*SQR(5*((DELTA*((MACH^2/5+1)^3.5-1)+1)^(1/3.5)-1))
315 'use observed Total, Ram, or Static Air Temp to compute absolute temperature
330 IF TEMP$="s" OR TEMP$="S" THEN SAT=AMBOBSTEMP-273.2
340 IF TEMP$="r" OR TEMP$="R" THEN SAT=AMBOBSTEMP/(1+.2*TRC*MACH*MACH)-273.2
350 IF TEMP$="t" OR TEMP$="T" THEN SAT=AMBOBSTEMP/(1+.2*MACH*MACH)-273.2
355 'compute speed of sound at observed temperature
360 A=SQR((273.2+SAT)/288.2)*661.5
365 'compute TAS from Mach and sonic velocity
370 TAS=MACH*A
380 PRINT CHR$(27);CHR$(69)
390 PRINT:PRINT
400 PRINT" If the pressure altitude is";
410 PRINT PRESSALT;
420 PRINT" feet and the ";IND$;" Air Temperature is"
430 PRINT USING "####.#";INDTEMP;
440 PRINT CHR$(248);F$;".,";
450 PRINT" then the OAT=";
460 PRINT USING "####.#";SAT;
470 PRINT CHR$(248);F$;"."
480 PRINT
490 PRINT" A Calibrated Air Speed of";
500 PRINT USING"####";CAS;
510 PRINT " knots or a Mach Number of ";
520 PRINT USING "#.###";MACH;
530 PRINT" will result"
540 PRINT "in a True Air Speed of";
550 PRINT USING"####";TAS;
560 PRINT" knots!"
570 PRINT:PRINT
580 PRINT TAB(25);"touch any key to continue"
590 IF INKEY$="" THEN 590
600 PRINT
610 CLEAR
620 RESTORE
621 PRINT TAB(20)"Would you like to run another (Y or N)?";:X$=INPUT$(1)
622 IF X$="Y" THEN 630
623 IF X$="N" THEN 640
630 GOTO 10
640 PRINT CHR$(27); CHR$(69):END
650 PRINT CHR$(27);CHR$(69):PRINT "The temperature read by the Outside Air Temperature (OAT)"
660 PRINT "gauge is distorted by the warming effect of friction in flight."
670 PRINT "Most single engine and reciprocating twins are slow enough that"
680 PRINT "no friction correction need be made. Later generation jets have"
690 PRINT "a temperature recovery coefficient of 1.0, or have the Ram Air"
700 PRINT "Temperature corrected by computer to read Static Air Temperature"
710 PRINT "or actual outside temperature. Other aircraft, including earlier"
720 PRINT "jets require a temperature recovery coefficient from 0.5 to 0.8"
730 PRINT "to give a true Static Air Temperature reading."
740 PRINT
750 PRINT " This program incorporates a temperature recovery coefficient"
760 PRINT "in it, so that Indicated Air Temperature may be used directly, "
770 PRINT "whether the gauge is indicating Total, Ram, or Static Air "
780 PRINT "Temperature. The program default temperature recovery coeffficent,"
790 PRINT "is set in line 980 at 1.0. Thus, the program will compute a very"
800 PRINT "nearly correct speed for most singles and light twins, as well as"
810 PRINT "late model jets. For other aircraft, the user should, if possible,"
820 PRINT "determine the temperature recovery coefficient applicable to his"
830 PRINT "particular OAT indicator, and enter this in line 980 in place of"
840 PRINT "the default 1.0. If unable to determine the actual temperature "
850 PRINT "recovery coefficient, a value of 0.5 would be recommended for light"
860 PRINT "twins and singles, and a value of 0.8 for light jets or earlier"
870 PRINT "jet transports."
880 IF INKEY$="" THEN 880
890 PRINT CHR$(27);CHR$(69)
900 PRINT"If your OAT gauge reads Static Air Temperature, enter an S when"
910 PRINT"the computer prompts you to; if it reads Ram (or is unspecified) then"
920 PRINT"enter R on prompt. If the gauge reads Total Air Temperature (TAT),"
930 PRINT"then type a T."
940 PRINT
950 PRINT TAB(25);"touch a key.."
960 IF INKEY$="" THEN 960
970 GOTO 220
975 'Temperature recovery coeffecient (not greater than 1.0) goes in next line.
980 DATA 1.0
985 'Maximum accuracy for your type of airplane can be achieved by adjusting
990 'Temp recovery coeff in above DATA statement. See notes.
ccur