C H A P T E R A
1155 | X(I)=LOG(R(I)) : Y(I)=1/(T(I)+273.15) |
| |||||
1160 | PRINT USING H$; I, T(I), R(I) |
|
| ||||
1170 | GOTO 1130 |
|
|
|
|
| |
1180 | N=I 1 |
|
|
|
|
|
|
1190 | CLOSE |
|
|
|
|
|
|
1200 | REM |
| **** accumulate sums **** |
| |||
1205 | SX=0 : SY=0 : SXY=0 : SXX=0 |
|
| ||||
1210 | FOR I = 1 TO N |
|
|
|
| ||
1220 | SX=SX+X(I) |
|
|
|
| ||
1230 | SY=SY+Y(I) |
|
|
|
| ||
1240 | SXY=SXY+X(I)*Y(I) |
|
|
|
| ||
1250 | SXX=SXX+X(I)*X(I) |
|
|
|
| ||
1260 | NEXT I |
|
|
|
|
|
|
1300 | REM |
| **** | print out results **** |
| ||
1310 | C[2]=(N*SXY SX*SY)/(N*SXX SX*SX) |
|
| ||||
1320 | C[1] = (SY C[2]*SX)/N |
|
| ||||
1620 |
|
|
|
|
|
| |
1630 | G$="Key in: | C1 | C2" |
|
| ||
1640 | P$=" |
| #.## | #.##" |
|
| |
1650 | PRINT G$ |
|
|
|
|
| |
1660 | PRINT USING P$; C[1]*1000!, C[2]*10000! |
| |||||
1700 | ' |
|
|
|
|
|
|
1702 | C1=INT(C[1]*1000000!)/1000000! |
|
| ||||
1704 | C2=INT(C[2]*1E+07)/1E+07 |
|
| ||||
1710 |
|
|
|
|
|
| |
1712 | PRINT " |
|
| T | T | T" | |
1714 | PRINT " | R |
| ACTUAL | CALC | ERROR" | |
1716 | " | ======== |
| ========= | ========== | =========" | |
1718 | P$= | " | ####### |
| ####.## | ####.## | ####.##" |
1720 | FOR L=1 TO N |
|
|
|
| ||
1730 | X=LOG(R(L)) |
|
|
|
| ||
1740 | TCALC=1/(C1+C2*X) 273.15 |
|
| ||||
1760 | PRINT USING P$;R(L),T(L),TCALC,T(L) TCALC |
| |||||
1780 | NEXT L |
|
|
|
|
|
|
06_07 | 31 |