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

Contents of /trunk/models/kchittur/pg352version8.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: 1279 byte(s)
Z
1 REQUIRE "atoms.a4l";
2 REQUIRE "mymodels.a4c";
3 IMPORT "johnpye/extpy/extpy";
4 IMPORT "vleplots";
5
6 MODEL example101;
7
8 A1, B1, C1, A2, B2, C2 IS_A factor;
9 P1S, P2S, P IS_A pressure;
10 T IS_A temperature;
11 x1, x2, y1, y2 IS_A fraction;
12 T_degC IS_A factor;
13 TdegC IS_A factor;
14
15 nc1, nc2 IS_A symbol_constant;
16
17 nc1 :== 'acetonitrile';
18 nc2 :== 'nitromethane';
19
20 mync1 IS_A antoine(nc1);
21 mync2 IS_A antoine(nc2);
22
23 A1 = mync1.A;
24 B1 = mync1.B;
25 C1 = mync1.C;
26 A2 = mync2.A;
27 B2 = mync2.B;
28 C2 = mync2.C;
29
30 P1S/1000.0{Pa} = exp(A1 - B1/(T/1.0{K} - 273.15 + C1));
31 P2S/1000.0{Pa} = exp(A2 - B2/(T/1.0{K} - 273.15 + C2));
32
33 x1 + x2 = 1.0;
34 y1 + y2 = 1.0;
35
36 x1*P1S = y1*P;
37 x2*P2S = y2*P;
38
39 T_degC = T/1{K} - 273.15;
40 TdegC = T_degC;
41
42 METHODS
43
44 METHOD parta;
45 FIX T; FIX x1;
46 x1 := 0.6;
47 T := 348.15 {K};
48 END parta;
49
50 METHOD partb;
51 FIX P; FIX x1;
52 x1 := 0.1;
53 P := 70.0 {kPa};
54 END partb;
55
56 METHOD doparta;
57 RUN ClearAll;
58 RUN parta;
59 END doparta;
60
61 METHOD dopartb;
62 RUN ClearAll;
63 RUN partb;
64 END dopartb;
65
66 METHOD generatepxyplot;
67 RUN ClearAll;
68 RUN parta;
69 RUN doparta;
70 EXTERNAL pxyplot(SELF);
71 END generatepxyplot;
72
73 METHOD generatetxyplot;
74 RUN ClearAll;
75 RUN partb;
76 RUN dopartb;
77 EXTERNAL txyplot(SELF);
78 END generatetxyplot;
79
80 END example101;

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