van1.bas |
10 ' Program van1; 実在気体の体積
20 A = 1.390 : B = .03913
30 P = 10! ' 圧力の初期値(気圧)
40 T = 500 ' 温度の初期値(K)
50 V = .1
60 V = V + .01
70 TRIAL = V^3 -(B + 0.0821*T/P)*V^2 + A*V/P - A*B/P
80 IF TRIAL<0 THEN GOTO 60
90 PRINT "T ="; T," 圧力 ="; P;" 気体の体積 ="; V
100 T = T - 50 ' 温度を50 K ずつ下げながら
110 IF T>100 THEN GOTO 50 ' 150Kまで計算する
120 P = P - 1! ' 圧力を1気圧ずつ下げながら
140 IF P>0 THEN GOTO 35 ' 1気圧まで計算する
150 END
10 ' Program van1-n; 気体の体積
20 A = 1.39 : B = .03913
30 FOR P = 10 TO 1 STEP -1
35 PRINT "圧力 ="; P
40 FOR T = 500 TO 150 STEP -50
50 V = .1
60 V = V + .01
70 TRIAL = V^3 -(B +.0821*T/P)*V^2 + A*V/P - A*B/P
80 IF TRIAL<0 THEN GOTO 60
90 PRINT "T ="; T, "気体の体積 ="; V
100 NEXT T
120 NEXT P
130 END
実行結果
T = 500 圧力 = 10 気体の体積 = 4.11999999999996
T = 450 圧力 = 10 気体の体積 = 3.69999999999997
T = 400 圧力 = 10 気体の体積 = 3.28999999999997
‥‥‥‥‥‥‥‥‥‥
T = 250 圧力 = 1 気体の体積 = 20.5000000000004
T = 200 圧力 = 1 気体の体積 = 16.3799999999998
T = 150 圧力 = 1 気体の体積 = 12.2499999999998