/[ascend]/trunk/models/kchittur/pg352version7.a4c
ViewVC logotype

Contents of /trunk/models/kchittur/pg352version7.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1631 - (show annotations) (download) (as text)
Sun Sep 30 23:37:48 2007 UTC (12 years, 9 months ago) by kchittur
File MIME type: text/x-ascend
File size: 1480 byte(s)
Z
1 REQUIRE "atoms.a4l";
2 IMPORT "johnpye/extpy/extpy";
3 IMPORT "vleplots";
4
5 MODEL antoine(nc WILL_BE symbol_constant;);
6
7 A, B, C IS_A factor;
8
9 SELECT(nc)
10
11 CASE 'acetonitrile':A = 14.2724; B = 2945.47; C = 224.070;
12 CASE 'nitromethane':A = 14.2043; B = 2972.64; C = 209.000;
13
14 END SELECT;
15
16 END antoine;
17
18 MODEL example101;
19
20 A1, B1, C1, A2, B2, C2 IS_A factor;
21 P1S, P2S, P IS_A pressure;
22 T IS_A temperature;
23 x1, x2, y1, y2 IS_A fraction;
24 T_degC IS_A factor;
25 TdegC IS_A factor;
26
27 nc1, nc2 IS_A symbol_constant;
28
29 nc1 :== 'acetonitrile';
30 nc2 :== 'nitromethane';
31
32 mync1 IS_A antoine(nc1);
33 mync2 IS_A antoine(nc2);
34
35 A1 = mync1.A;
36 B1 = mync1.B;
37 C1 = mync1.C;
38 A2 = mync2.A;
39 B2 = mync2.B;
40 C2 = mync2.C;
41
42 P1S/1000.0{Pa} = exp(A1 - B1/(T/1.0{K} - 273.15 + C1));
43 P2S/1000.0{Pa} = exp(A2 - B2/(T/1.0{K} - 273.15 + C2));
44
45 x1 + x2 = 1.0;
46 y1 + y2 = 1.0;
47
48 x1*P1S = y1*P;
49 x2*P2S = y2*P;
50
51 T_degC = T/1{K} - 273.15;
52 TdegC = T_degC;
53
54 METHODS
55
56 METHOD parta;
57 FIX T; FIX x1;
58 x1 := 0.6;
59 T := 348.15 {K};
60 END parta;
61
62 METHOD partb;
63 FIX P; FIX x1;
64 x1 := 0.1;
65 P := 70.0 {kPa};
66 END partb;
67
68 METHOD doparta;
69 RUN ClearAll;
70 RUN parta;
71 END doparta;
72
73 METHOD dopartb;
74 RUN ClearAll;
75 RUN partb;
76 END dopartb;
77
78 METHOD generatepxyplot;
79 RUN ClearAll;
80 RUN parta;
81 RUN doparta;
82 EXTERNAL pxyplot(SELF);
83 END generatepxyplot;
84
85 METHOD generatetxyplot;
86 RUN ClearAll;
87 RUN partb;
88 RUN dopartb;
89 EXTERNAL txyplot(SELF);
90 END generatetxyplot;
91
92 END example101;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22