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 / CPM / EDUCATIN / AVIAUTL1.LBR / AIRDATA.BZS / AIRDATA.BAS
BASIC Source File  |  2000-06-30  |  5KB  |  115 lines

  1. 5 'This program written by R. G. Gross, Santa Cruz, CA
  2. 6 'Anyone is free to use it for non-commercial purposes.  No responsibility
  3. 7 'can be accepted by the above for consequences of use of this program.
  4. 8 'This program was modified to run on H/Z-89,H/Z-90  CP/M-80 system. 3/15/87
  5. 10 PRINT CHR$(27);CHR$(69)
  6. 11 PRINT TAB(31)"AIRDATA PROGRAM"
  7. 12 PRINT
  8. 20 INPUT "What is the pressure altitude";PRESSALT
  9. 30 'determine standard atmospheric pressure ratio, delta
  10. 40 DELTA=((288.2-.001981*PRESSALT)/288.2)^5.2561
  11. 50 IF PRESSALT>36089! THEN LET DELTA=.2234*EXP(-(PRESSALT-36089!)/20806)
  12. 60 PRINT
  13. 70 INPUT "What is the Outside Air Temperature";OBSTEMP
  14. 80 PRINT
  15. 90 PRINT"     Celsius (C) or Fahrenheit (F)?"
  16. 100 F$=INKEY$:IF F$="" THEN 100
  17. 110 IF F$="f" OR F$="F" THEN LET F$="F":INDTEMP=OBSTEMP
  18. 120 IF F$="F" THEN LET OBSTEMP=(OBSTEMP-32)*5/9 ELSE LET F$="C"
  19. 130 IF F$="C" THEN INDTEMP=OBSTEMP
  20. 140 AMBOBSTEMP=273.2+OBSTEMP
  21. 150 PRINT
  22. 160 PRINT "     Is this Total (T), Ram (R), or Static (S) Air Temperature?"
  23. 170 PRINT
  24. 180 PRINT "          Type H for help"
  25. 190 PRINT
  26. 200 TEMP$=INKEY$:IF TEMP$="" THEN 200
  27. 210 IF TEMP$="H" OR TEMP$="h" THEN 650
  28. 220 READ TRC
  29. 230 IF TEMP$="s" OR TEMP$="S" THEN SAT=AMBOBSTEMP
  30. 240 IF TEMP$="t" OR TEMP$="T" THEN LET IND$="Total"
  31. 250 IF TEMP$="r" OR TEMP$="R" THEN LET IND$="RAM"
  32. 260 IF TEMP$="s" OR TEMP$="S" THEN LET IND$="Static"
  33. 270 INPUT "What is Calibrated Air Speed (CAS) or Mach (M)";S
  34. 280 CAS=S
  35. 290 IF S<1 THEN MACH=S:CAS=0:GOTO 310
  36. 295 'use CAS and Press Alt to compute missing Mach
  37. 300 MACH=SQR(5*((1/DELTA*((1+.2*(CAS/661.5)^2)^3.5-1)+1)^(1/3.5)-1))
  38. 305 'use Mach to compute missing CAS
  39. 310 CAS=661.5*SQR(5*((DELTA*((MACH^2/5+1)^3.5-1)+1)^(1/3.5)-1))
  40. 315 'use observed Total, Ram, or Static Air Temp to compute absolute temperature
  41. 330  IF TEMP$="s" OR TEMP$="S" THEN SAT=AMBOBSTEMP-273.2
  42. 340  IF TEMP$="r" OR TEMP$="R" THEN SAT=AMBOBSTEMP/(1+.2*TRC*MACH*MACH)-273.2
  43. 350  IF TEMP$="t" OR TEMP$="T" THEN SAT=AMBOBSTEMP/(1+.2*MACH*MACH)-273.2
  44. 355 'compute speed of sound at observed temperature
  45. 360 A=SQR((273.2+SAT)/288.2)*661.5
  46. 365 'compute TAS from Mach and sonic velocity
  47. 370 TAS=MACH*A
  48. 380 PRINT CHR$(27);CHR$(69)
  49. 390 PRINT:PRINT
  50. 400 PRINT"     If the pressure altitude is";
  51. 410 PRINT PRESSALT;
  52. 420 PRINT" feet and the ";IND$;" Air Temperature is"
  53. 430 PRINT USING "####.#";INDTEMP;
  54. 440 PRINT CHR$(248);F$;".,";
  55. 450 PRINT" then the OAT=";
  56. 460 PRINT USING "####.#";SAT;
  57. 470 PRINT CHR$(248);F$;"."
  58. 480 PRINT
  59. 490 PRINT"     A Calibrated Air Speed of";
  60. 500 PRINT USING"####";CAS;
  61. 510 PRINT " knots or a Mach Number of ";
  62. 520 PRINT USING "#.###";MACH;
  63. 530 PRINT" will result"
  64. 540 PRINT "in a True Air Speed of";
  65. 550 PRINT USING"####";TAS;
  66. 560 PRINT" knots!"
  67. 570 PRINT:PRINT
  68. 580 PRINT TAB(25);"touch any key to continue"
  69. 590 IF INKEY$="" THEN 590
  70. 600 PRINT
  71. 610 CLEAR
  72. 620 RESTORE
  73. 621 PRINT TAB(20)"Would you like to run another (Y or N)?";:X$=INPUT$(1)
  74. 622 IF X$="Y" THEN 630
  75. 623 IF X$="N" THEN 640
  76. 630 GOTO 10
  77. 640 PRINT CHR$(27); CHR$(69):END
  78. 650 PRINT CHR$(27);CHR$(69):PRINT "The temperature read by the Outside Air Temperature (OAT)"
  79. 660 PRINT "gauge is distorted by the warming effect of friction in flight."
  80. 670 PRINT "Most single engine and reciprocating twins are slow enough that"
  81. 680 PRINT "no friction correction need be made.  Later generation jets have"
  82. 690 PRINT "a temperature recovery coefficient of 1.0, or have the Ram Air"
  83. 700 PRINT "Temperature corrected by computer to read Static Air Temperature"
  84. 710 PRINT "or actual outside temperature.  Other aircraft, including earlier"
  85. 720 PRINT "jets require a temperature recovery coefficient from 0.5 to 0.8"
  86. 730 PRINT "to give a true Static Air Temperature reading."
  87. 740 PRINT
  88. 750 PRINT "     This program incorporates a temperature recovery coefficient"
  89. 760 PRINT "in it, so that Indicated Air Temperature may be used directly, "
  90. 770 PRINT "whether the gauge is indicating Total, Ram, or Static Air "
  91. 780 PRINT "Temperature.  The program default temperature recovery coeffficent,"
  92. 790 PRINT "is set in line 980 at 1.0.  Thus, the program will compute a very"
  93. 800 PRINT "nearly correct speed for most singles and light twins, as well as"
  94. 810 PRINT "late model jets.  For other aircraft, the user should, if possible,"
  95. 820 PRINT "determine the temperature recovery coefficient applicable to his"
  96. 830 PRINT "particular OAT indicator, and enter this in line 980 in place of"
  97. 840 PRINT "the default 1.0.  If unable to determine the actual temperature "
  98. 850 PRINT "recovery coefficient, a value of 0.5 would be recommended for light"
  99. 860 PRINT "twins and singles, and a value of 0.8 for light jets or earlier"
  100. 870 PRINT "jet transports."
  101. 880 IF INKEY$="" THEN 880
  102. 890 PRINT CHR$(27);CHR$(69)
  103. 900 PRINT"If your OAT gauge reads Static Air Temperature, enter an S when"
  104. 910 PRINT"the computer prompts you to; if it reads Ram (or is unspecified) then"
  105. 920 PRINT"enter R on prompt.  If the gauge reads Total Air Temperature (TAT),"
  106. 930 PRINT"then type a T."
  107. 940 PRINT
  108. 950 PRINT TAB(25);"touch a key.."
  109. 960 IF INKEY$="" THEN 960
  110. 970 GOTO 220
  111. 975 'Temperature recovery coeffecient (not greater than 1.0) goes in next line.
  112. 980 DATA 1.0
  113. 985 'Maximum accuracy for your type of airplane can be achieved by adjusting
  114. 990 'Temp recovery coeff in above DATA statement.  See notes.
  115. ccur