/[ascend]/trunk/models/system.a4l
ViewVC logotype

Contents of /trunk/models/system.a4l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1684 - (show annotations) (download) (as text)
Thu Dec 20 22:30:30 2007 UTC (11 years, 10 months ago) by jpye
File MIME type: text/x-ascend
File size: 4061 byte(s)
Added test cases to instantiate models using the compiler, and test for resulting child instances etc.
Changed most 'AddSymbolL' to 'AddSymbol' (to reduce use of magic #s).
Cleaned up a few #include lists.
Renamed 'Asc_DeAllocSim' to 'sim_destroy'.
Removed some CVS 'lint'.
Removed 'SimsProc' commenting from 'simlist.c'.
Added some missing #includes in .h files (FWIW).
Removed the 'STATIC_xxx' headers from base/generic/solver/SConscript.
1 REQUIRE "basemodel.a4l";
2 PROVIDE "system.a4l";
3
4 (*
5 * system.a4l
6 * by Benjamin A. Allan
7 * Part of the ASCEND Library
8 * $Date: 1998/06/17 19:31:48 $
9 * $Revision: 1.7 $
10 * $Author: mthomas $
11 * $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/system.a4l,v $
12 *
13 * This file is part of the ASCEND Modeling Library.
14 *
15 * Copyright (C) 1994-1998 Carnegie Mellon University
16 *
17 * The ASCEND Modeling Library is free software; you can redistribute
18 * it and/or modify it under the terms of the GNU General Public
19 * License as published by the Free Software Foundation; either
20 * version 2 of the License, or (at your option) any later version.
21 *
22 * The ASCEND Modeling Library is distributed in hope that it will be
23 * useful, but WITHOUT ANY WARRANTY; without even the implied
24 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 * See the GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with the program; if not, write to the Free Software
29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check
30 * the file named COPYING.
31 *)
32
33 (*============================================================================*
34
35 S Y S T E M . A 4 L
36 ----------------------
37
38 AUTHOR: Benjamin A. Allan
39
40 DATES: 06/94 - Original Code
41 02/95 - Definitions for discrete variables added by
42 Craig Schmidt (CWS).
43
44 CONTENTS: Basic definitions for relation, solver_var,
45 and generic_real. This file is necessary for all
46 other ASCEND models to work on ASCEND3C.
47 If integration with the new DAE interface (blsode)
48 is desired, ivpsystem.a4l should be loaded instead.
49 This file is strictly for algebraic modeling.
50
51 *============================================================================*)
52
53 DEFINITION relation
54
55 included IS_A boolean;
56 message IS_A symbol;
57
58 included := TRUE;
59 message := 'none';
60 END relation;
61
62
63 DEFINITION logic_relation
64
65 included IS_A boolean;
66 message IS_A symbol;
67
68 included := TRUE;
69 message := 'none';
70
71 END logic_relation;
72
73 ATOM solver_var REFINES real
74 DEFAULT 0.5 {?};
75
76 lower_bound IS_A real;
77 upper_bound IS_A real;
78 nominal IS_A real;
79 fixed IS_A boolean;
80 message IS_A symbol;
81
82 fixed := FALSE;
83 lower_bound := -1e20 {?};
84 upper_bound := 1e20 {?};
85 nominal := 0.5 {?};
86 message := 'none';
87
88 END solver_var;
89
90 ATOM boolean_var REFINES boolean
91 DEFAULT TRUE;
92
93 nominal IS_A boolean;
94 fixed IS_A boolean;
95 fixed := FALSE;
96 nominal := TRUE;
97
98 END boolean_var;
99
100 ATOM generic_real REFINES solver_var
101 DIMENSIONLESS
102 DEFAULT 0.5;
103 lower_bound := -1e20;
104 upper_bound := 1e20;
105 nominal := 0.5;
106 END generic_real;
107
108
109 ADD NOTES IN solver_int;
110 'purpose' SELF {
111 solver_int is an integer variable for an MILP solver
112 lower bound almost always 0
113 relaxed indicates if the var should be treated as a normal solver_var
114 }
115 END NOTES;
116 ADD NOTES IN solver_binary;
117 'purpose' SELF {
118 solver_binary is a binary variable for a MILP solver
119 lower bound must be 0, and upper bound must be 1
120 }
121 END NOTES;
122 ADD NOTES IN solver_semi;
123 'purpose' SELF {
124 solver_semi is a semicontinous variable for use in SCICONIC
125 this var can have a value between 1 and the arbitrary upper bound, or 0.
126 (note that SCICONIC requires the lower bound to be 1)
127 if is_zero = true, then the current value is taken as 0
128 }
129 END NOTES;
130
131
132 ATOM solver_int REFINES solver_var
133 DIMENSIONLESS
134 DEFAULT 0.0;
135
136 relaxed IS_A boolean;
137
138 lower_bound := 0.0;
139 upper_bound := 1000000.0;
140 nominal := 0.5;
141 END solver_int;
142
143 ATOM solver_binary REFINES solver_int
144 DIMENSIONLESS
145 DEFAULT 0.0;
146
147 lower_bound := 0.0;
148 upper_bound := 1.0;
149 nominal := 0.5;
150
151 END solver_binary;
152
153 ATOM solver_semi REFINES solver_var
154 DEFAULT 1.0 {?};
155
156 is_zero IS_A boolean;
157 relaxed IS_A boolean;
158
159 lower_bound := 1 {?};
160 upper_bound := 1e20 {?};
161 nominal := 1.0 {?};
162
163 END solver_semi;

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