1 |
# This file is part of the ASCEND Modeling Library and is released |
2 |
# under the GNU Public License as described at the end of this file. |
3 |
# |
4 |
# This file demonstrates the use of ASCEND's "STUDY ... VARYING" |
5 |
# construct for doing case studies |
6 |
|
7 |
DELETE TYPES; |
8 |
READ FILE "ben/benflash.a4l"; |
9 |
COMPILE t OF test_vapor_liquid_flash; |
10 |
RUN {t.defaults}; |
11 |
BROWSE {t}; |
12 |
RUN {t.values}; |
13 |
RUN {t.reset}; |
14 |
SOLVE {t} WITH QRSlv; |
15 |
|
16 |
STUDY {Liqout.f['n_pentane']} {Liqout.f['n_hexane']} {Liqout.f['n_heptane']} \ |
17 |
IN t \ |
18 |
VARYING {Feed.f['n_hexane'] {1 mole/s} {2 mole/s} {3 mole/s} {4 mole/s} {5 mole/s} {6 mole/s} {7 mole/s} {8 mole/s}} \ |
19 |
USING QRSlv \ |
20 |
OUTFILE /tmp/sl.dat \ |
21 |
ERROR STOP; |
22 |
|
23 |
ASCPLOT /tmp/sl.dat |
24 |
|
25 |
# The following does not work because WRITE_VIRTUAL doesn't support |
26 |
# saving boolean state and because of the complexity of dealing with |
27 |
# DOF and the need to rerun methods before solving. In general, we do |
28 |
# not yet support case studies over discrete variables, though with |
29 |
# minor work we probably could. |
30 |
STUDY {Liqout.f['n_pentane']} {Liqout.f['n_hexane']} {Liqout.f['n_heptane']} \ |
31 |
IN t VARYING {equilibrated 0 1} \ |
32 |
USING QRSlv OUTFILE /tmp/sl ERROR STOP; |
33 |
|
34 |
# now do an interesting case study instead of just generating |
35 |
# some sort of flash curve. |
36 |
# generate an optimum curve. |
37 |
# To do this, load and explore simple_fs_cost.a4s. |
38 |
|
39 |
########## casestudy.a4s ends here ########## |
40 |
# |
41 |
# casestudy.a4s |
42 |
# by Ben Allen |
43 |
# January 27, 1998 |
44 |
# Part of the ASCEND Library |
45 |
# $Date: 1998/06/17 20:08:27 $ |
46 |
# $Revision: 1.3 $ |
47 |
# $Author: mthomas $ |
48 |
# $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/casestudy.a4s,v $ |
49 |
# |
50 |
# This file is part of the ASCEND Modeling Library. |
51 |
# |
52 |
# Copyright (C) 1998 Carnegie Mellon University |
53 |
# |
54 |
# The ASCEND Modeling Library is free software. You can redistribute |
55 |
# it and/or modify it under the terms of the GNU General Public |
56 |
# License as published by the Free Software Foundation---either |
57 |
# version 2 of the License, or (at your option) any later version. |
58 |
# |
59 |
# The ASCEND Modeling Library is distributed in hope that it |
60 |
# will be useful, but WITHOUT ANY WARRANTY--without even the implied |
61 |
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
62 |
# See the GNU General Public License for more details. |
63 |
# |
64 |
# You should have received a copy of the GNU General Public License |
65 |
# along with the program. If not, write to the Free Software |
66 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check |
67 |
# the file named COPYING. |