/[ascend]/trunk/models/dyn_tank.a4c
ViewVC logotype

Contents of /trunk/models/dyn_tank.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Fri Oct 29 20:54:12 2004 UTC (19 years, 7 months ago) by aw0a
File MIME type: text/x-ascend
File size: 3425 byte(s)
Setting up web subdirectory in repository
1 REQUIRE "ivpsystem.a4l";
2 (* => modified version of system.a4l, basemodel.a4l *)
3 REQUIRE "atoms.a4l";
4 (* => atoms.a4l, measures.a4l, system.a4l, basemodel.a4l *)
5 PROVIDE "dyn_tank.a4c";
6 (*
7 * This file is part of the ASCEND Modeling Library and is released
8 * under the GNU Public License as described at the end of this file.
9 *)
10
11 MODEL tank;
12 (* List of Variables *)
13 dM_dt IS_A molar_rate;
14 M IS_A mole;
15 input IS_A molar_rate;
16 output IS_A molar_rate;
17 Volume IS_A volume;
18 density IS_A real_constant;
19 dynamic IS_A boolean;
20 t IS_A time;
21
22 (* Equations *)
23 dM_dt = input - output;
24 M = Volume * density;
25
26 (* Assignment of values to Constants *)
27 density :==10 {mol/m^3};
28
29 METHODS
30 METHOD check_self;
31 IF (input < 1e-4 {mole/s}) THEN
32 STOP {Input dried up in tank};
33 END IF;
34 IF (output < 1e-4 {mole/s}) THEN
35 STOP {Output dried up in tank};
36 END IF;
37 END check_self;
38
39 METHOD check_all;
40 RUN check_self;
41 END check_all;
42
43 METHOD default_self;
44 dynamic := FALSE;
45 t :=0 {sec};
46 dM_dt :=0 {mol/sec};
47 dM_dt.lower_bound := -1e49 {mol/sec};
48 END default_self;
49
50 METHOD default_all;
51 RUN default_self;
52 END default_all;
53
54 METHOD bound_self;
55 END bound_self;
56
57 METHOD bound_all;
58 RUN bound_self;
59 END bound_all;
60
61 METHOD scale_self;
62 END scale_self;
63
64 METHOD scale_all;
65 RUN scale_self;
66 END scale_all;
67
68 METHOD seqmod;
69 dM_dt.fixed :=TRUE;
70 M.fixed :=FALSE;
71 Volume.fixed :=TRUE;
72 input.fixed :=TRUE;
73 output.fixed :=FALSE;
74 IF dynamic THEN
75 dM_dt.fixed :=FALSE;
76 M.fixed :=TRUE;
77 Volume.fixed :=FALSE;
78 output.fixed :=TRUE;
79 END IF;
80 END seqmod;
81
82 METHOD specify;
83 input.fixed :=TRUE;
84 RUN seqmod;
85 END specify;
86
87 METHOD set_ode;
88 (* set ODE_TYPE -1=independent variable,
89 0=algebraic variable, 1=state variable,
90 2=derivative *)
91 t.ode_type :=-1;
92 dM_dt.ode_type :=2;
93 M.ode_type :=1;
94 (* Set ODE_ID *)
95 dM_dt.ode_id :=1;
96 M.ode_id :=1;
97 END set_ode;
98
99 METHOD set_obs;
100 (* Set OBS_ID to any integer value greater
101 than 0, the variable will be recorded
102 (i.e., observed) *)
103 M.obs_id :=1;
104 Volume.obs_id :=2;
105 input.obs_id :=3;
106 output.obs_id :=4;
107 END set_obs;
108
109 METHOD values;
110 Volume :=5 {m^3};
111 input :=100 {mole/s};
112 END values;
113 END tank;
114
115
116 (*
117 * dyn_tank.a4c
118 * by Duncan Coffey
119 * Part of the ASCEND Library
120 * $Date: 1998/06/17 19:05:02 $
121 * $Revision: 1.2 $
122 * $Author: mthomas $
123 * $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/dyn_tank.a4c,v $
124 *
125 * This file is part of the ASCEND Modeling Library.
126 *
127 * Copyright (C) 1998 Carnegie Mellon University
128 *
129 * The ASCEND Modeling Library is free software; you can redistribute
130 * it and/or modify it under the terms of the GNU General Public
131 * License as published by the Free Software Foundation; either
132 * version 2 of the License, or (at your option) any later version.
133 *
134 * The ASCEND Modeling Library is distributed in hope that it will
135 * be useful, but WITHOUT ANY WARRANTY; without even the implied
136 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
137 * See the GNU General Public License for more details.
138 *
139 * You should have received a copy of the GNU General Public License
140 * along with the program; if not, write to the Free Software
141 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the
142 * file named COPYING.
143 *)

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