10 ! This program converted from BASIC to True BASIC. 11 ! 12 ! Converter version 2.0 copyright (c) 1998 by: 13 ! True BASIC, Inc. 14 ! 12 Commerce Ave. 15 ! West Lebanon, NH 03784 16 ! 17 ! True BASIC makes no warranty, expressed or implied, that 18 ! this converted program is a precise and accurate equivalent 19 ! of the original BASIC program. This conversion is provided 20 ! only as an aid to a more complete conversion by the owner of 21 ! the original BASIC program. 22 ! 23 OPTION BASE 0 24 ! 25 LIBRARY "DefLib.trc" 29 DEF Eof(f) 30 IF end #f then LET Eof = -1 else LET Eof = 0 31 END DEF 20 ! 30 ! EXPERIMENT 3.A. HEAT CAPACITY RATIO OF GASES 40 ! ADIABATIC EXPANSION METHOD 50 ! 60 ! (LAB.14.WBASIC) 70 ! 80 ! 90 ! 100 ! 110 open #3: name "e:\INPUT14.txt", org text, access input, create old 120 open #2: name "e:\OUTPUT", org text, access output, create newold 130 on eof(3) goto 1310 else goto 131 131 rem To allow falling through, which BasicA allows 140 ! 150 ! "INPUT YOUR NAME" 160 input #3: e$ 170 ! "INPUT THE NAME OF THE EXPERIMENT " 180 input #3: a$ 190 ! "INPUT THE NAME OF YOUR PARTNER " 200 input #3: b$ 210 ! "INPUT THE DATE " 220 line input #3: c$ 230 print #2: "NAME: ", e$ 240 print #2: " " 250 print #2: "EXPERIMENT: ", a$ 260 print #2: " " 270 print #2: "PARTNER: ", b$ 280 print #2: " " 290 print #2: "DATE: ", c$ 300 for i = 1 to 5 310 print #2: " " 320 next i 350 input #3: bap, ebap 360 print #2: "The barometric pressure during your experiment" 370 print #2: " ="; bap; "+/-"; ebap; "mm Hg" 380 print #2: " " 390 input #3: ddbp, eddbp 400 print #2: "The density of dibutyl phthalate" 410 print #2: " ="; ddbp; "+/-"; eddbp; "g/cm3" 420 print #2: " " 430 input #3: dhg, edhg 440 print #2: "The density of mercury" 450 print #2: " ="; dhg; "+/-"; edhg; "g/cm3" 460 print #2: " " 470 input #3: ep 480 print #2: "The uncertainty in mm for the U-tube manometer" 490 print #2: "containing the dibutyl phthalate is +/-"; ep; "mm Hg" 500 input #3: ng 510 print #2: " " 520 print #2: ng; "gases were studied." 530 print #2: " " 540 for i = 1 to ng 550 input #3: q$(i) 560 print #2: q$(i) 570 print #2: "=========" 580 input #3: m 590 print #2: " ", "HEIGHTS OF DIBUTYL PHTHALATE" 600 print #2: " ", "============================" 610 print #2: tab(9); "INITIAL EQUILIBRIUM"; tab(41); "FINAL EQUILIBRIUM" 620 print #2: tab(10); "External Internal "; 630 print #2: tab(40); "External Internal" 640 print #2: tab(10); " (open) (closed)"; 650 print #2: tab(40); " (open) (closed)" 660 print #2: " " 670 for j = 1 to m 680 input #3: poi(i, j), pci(i, j), pof(i, j), pcf(i, j) 690 let ok(i, j) = poi(i, j)-pci(i, j) 700 let ol(i, j) = pof(i, j)-pcf(i, j) 710 print #2: "trial"; j; tab(10); poi(i, j); tab(20); pci(i, j); "="; 720 print #2: ok(i, j); "mm DBP"; tab(40); pof(i, j); tab(50); pcf(i, j); 730 print #2: "="; ol(i, j); "mm DBP" 740 next j 750 print #2: " " 760 next i 770 print #2: " " 780 print #2: " " 790 let lnp2 = log(bap) 800 let elnp2 = ebap/bap 810 let b = ddbp/dhg 820 let eb = b*((eddbp/ddbp)^2+(edhg/dhg)^2)^.5 830 let ec = ep*2^.5 840 for i = 1 to ng 842 let sum1(i) = 0 844 let esum1(i) = 0 850 for j = 1 to m 860 let ci(i, j) = poi(i, j)-pci(i, j) 870 let ai(i, j) = b*ci(i, j) 880 let eai(i, j) = a*((eb/b)^2+(ec/ci(i, j))^2)^.5 890 let p1(i, j) = bap+ai(i, j) 900 let ep1(i, j) = (ebap^2+eai(i, j)^2)^.5 910 let lnp1(i, j) = log(p1(i, j)) 920 let elnp1(i, j) = ep1(i, j)/p1(i, j) 930 let cf(i, j) = pof(i, j)-pcf(i, j) 940 let af(i, j) = b*cf(i, j) 950 let eaf(i, j) = a*((eb/b)^2+(ec/cf(i, j))^2)^.5 960 let p3(i, j) = bap+af(i, j) 970 let ep3(i, j) = (ebap^2+eaf(i, j)^2)^.5 980 let lnp3(i, j) = log(p3(i, j)) 990 let elnp3(i, j) = ep3(i, j)/p3(i, j) 1000 let n(i, j) = lnp1(i, j)-lnp2 1010 let en(i, j) = (elnp1(i, j)^2+elnp2^2)^.5 1020 let d(i, j) = lnp1(i, j)-lnp3(i, j) 1030 let ed(i, j) = (elnp1(i, j)^2+elnp3(i, j)^2)^.5 1040 let r(i, j) = n(i, j)/d(i, j) 1050 let er(i, j) = r(i, j)*((en(i, j)/n(i, j))^2+(ed(i, j)/d(i, j))^2)^.5 1060 let sum1(i) = sum1(i)+r(i, j) 1070 let esum1(i) = esum1(i)+er(i, j)^2 1080 next j 1090 let mr(i) = sum1(i)/m 1100 let emr(i) = esum1(i)^.5/m 1110 next i 1120 for i = 1 to ng 1130 print #2: "Gas:"; q$(i) 1140 print #2: " ", " Pressure, mm DBP", " Pressure, mm Hg" 1150 print #2: " ", " ================", " ===============" 1160 print #2: " " 1170 for j = 1 to m 1180 print #2: "Trial ="; j 1190 print #2: "Initial Equilibrium"; tab(27); "="; 1200 print #2: ok(i, j), " ", " ="; p1(i, j) 1210 print #2: "Final Equilibrium"; tab(27); "="; 1220 print #2: ol(i, j), " ", " ="; p3(i, j) 1230 print #2: " " 1240 print #2: " ", " ", "Cp/Cv ="; r(i, j); "+/-"; er(i, j) 1250 print #2: " " 1260 next j 1270 print #2: tab(29); "Average Cp/Cv ="; mr(i); "+/-"; emr(i) 1280 print #2: " " 1290 print #2: " " 1300 next i 1310 close #2 1320 close #3 1330 end