1 |
aw0a |
1 |
REQUIRE "basemodel.a4l"; |
2 |
|
|
(* => basemodel.a4l *) |
3 |
|
|
PROVIDE "ivpsystem.a4l"; |
4 |
|
|
PROVIDE "system.a4l"; |
5 |
|
|
|
6 |
|
|
(* |
7 |
|
|
* ivpsystem.a4l |
8 |
|
|
* by Benjamin A. Allan, Jennifer Stokes |
9 |
|
|
* Part of the ASCEND Library |
10 |
|
|
* $Date: 1998/06/17 19:09:35 $ |
11 |
|
|
* $Revision: 1.7 $ |
12 |
|
|
* $Author: mthomas $ |
13 |
|
|
* $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/ivpsystem.a4l,v $ |
14 |
|
|
* |
15 |
|
|
* This file is part of the ASCEND Modeling Library. |
16 |
|
|
* |
17 |
|
|
* Copyright (C) 1994 - 1998 Carnegie Mellon University |
18 |
|
|
* |
19 |
|
|
* The ASCEND Modeling Library is free software; you can redistribute |
20 |
|
|
* it and/or modify it under the terms of the GNU General Public |
21 |
|
|
* License as published by the Free Software Foundation; either |
22 |
|
|
* version 2 of the License, or (at your option) any later version. |
23 |
|
|
* |
24 |
|
|
* The ASCEND Modeling Library is distributed in hope that it |
25 |
|
|
* will be useful, but WITHOUT ANY WARRANTY; without even the implied |
26 |
|
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
27 |
|
|
* See the GNU General Public License for more details. |
28 |
|
|
* |
29 |
|
|
* You should have received a copy of the GNU General Public License |
30 |
|
|
* along with the program; if not, write to the Free Software |
31 |
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check |
32 |
|
|
* the file named COPYING. |
33 |
|
|
*) |
34 |
|
|
|
35 |
|
|
(*============================================================================* |
36 |
|
|
|
37 |
|
|
I V P S Y S T E M . A 4 L |
38 |
|
|
----------------------------- |
39 |
|
|
|
40 |
|
|
AUTHOR: Benjamin A. Allan |
41 |
|
|
|
42 |
|
|
DATES: 06/94 - Original Code (system.a4l) |
43 |
|
|
02/95 - Definitions for discrete variables added by |
44 |
|
|
Craig Schmidt (CWS). (system.a4l) |
45 |
|
|
08/95 Jennifer Stokes extensions for ODE solvers. |
46 |
|
|
04/96 - Modified for the use of constants |
47 |
|
|
03/98 - Added messages. |
48 |
|
|
|
49 |
|
|
CONTENTS: Basic definitions for relation, solver_var, |
50 |
|
|
and generic_real. This file is necessary for all |
51 |
|
|
other ASCEND models to work on ASCEND3C with the |
52 |
|
|
blsode DAE interface. For strictly algebraic |
53 |
|
|
modeling, the other system.a4l should be used and |
54 |
|
|
will give rather smaller (memorywise) solver_var. |
55 |
|
|
|
56 |
|
|
*============================================================================*) |
57 |
|
|
|
58 |
|
|
DEFINITION relation |
59 |
|
|
|
60 |
|
|
included IS_A boolean; |
61 |
|
|
message IS_A symbol; |
62 |
|
|
|
63 |
|
|
included := TRUE; |
64 |
|
|
message := 'none'; |
65 |
|
|
END relation; |
66 |
|
|
|
67 |
|
|
|
68 |
|
|
DEFINITION logic_relation |
69 |
|
|
|
70 |
|
|
included IS_A boolean; |
71 |
|
|
included := TRUE; |
72 |
|
|
|
73 |
|
|
message IS_A symbol; |
74 |
|
|
message := 'none'; |
75 |
|
|
|
76 |
|
|
END logic_relation; |
77 |
|
|
|
78 |
|
|
ATOM boolean_var REFINES boolean |
79 |
|
|
DEFAULT TRUE; |
80 |
|
|
|
81 |
|
|
fixed IS_A boolean; |
82 |
|
|
fixed := FALSE; |
83 |
|
|
|
84 |
|
|
END boolean_var; |
85 |
|
|
|
86 |
|
|
ATOM solver_var REFINES real |
87 |
|
|
DEFAULT 0.5 {?}; |
88 |
|
|
|
89 |
|
|
lower_bound IS_A real; |
90 |
|
|
upper_bound IS_A real; |
91 |
|
|
nominal IS_A real; |
92 |
|
|
fixed IS_A boolean; |
93 |
|
|
message IS_A symbol; |
94 |
|
|
|
95 |
|
|
ode_type IS_A integer; |
96 |
|
|
ode_id IS_A integer; |
97 |
|
|
obs_id IS_A integer; |
98 |
|
|
ode_atol IS_A real; |
99 |
|
|
ode_rtol IS_A real; |
100 |
|
|
|
101 |
|
|
fixed := FALSE; |
102 |
|
|
lower_bound := -1e20 {?}; |
103 |
|
|
upper_bound := 1e20 {?}; |
104 |
|
|
nominal := 0.5 {?}; |
105 |
|
|
message := 'none'; |
106 |
|
|
|
107 |
|
|
ode_type := 0; |
108 |
|
|
ode_atol := 1e-4 {?}; |
109 |
|
|
ode_rtol := 1e-8 {?}; |
110 |
|
|
|
111 |
|
|
END solver_var; |
112 |
|
|
|
113 |
|
|
ATOM generic_real REFINES solver_var |
114 |
|
|
DIMENSIONLESS |
115 |
|
|
DEFAULT 0.5; |
116 |
|
|
lower_bound := -1e20; |
117 |
|
|
upper_bound := 1e20; |
118 |
|
|
nominal := 0.5; |
119 |
|
|
END generic_real; |
120 |
|
|
|
121 |
|
|
(*============================================================================* |
122 |
|
|
|
123 |
|
|
Modified by CWS, 2/95 |
124 |
|
|
|
125 |
|
|
solver_int is an integer variable for an MILP solver |
126 |
|
|
lower bound almost always 0 |
127 |
|
|
relaxed indicates if the var should be treated as a normal solver_var |
128 |
|
|
solver_binary is a binary variable for a MILP solver |
129 |
|
|
lower bound must be 0, and upper bound must be 1 |
130 |
|
|
solver_semi is a semicontinous variable for use in SCICONIC |
131 |
|
|
this var can have a value between 1 and the arbitrary upper bound, or 0. |
132 |
|
|
(note that SCICONIC requires the lower bound to be 1) |
133 |
|
|
if is_zero = true, then the current value is taken as 0 |
134 |
|
|
|
135 |
|
|
*===========================================================================*) |
136 |
|
|
|
137 |
|
|
|
138 |
|
|
ATOM solver_int REFINES solver_var |
139 |
|
|
DIMENSIONLESS |
140 |
|
|
DEFAULT 0.0; |
141 |
|
|
|
142 |
|
|
relaxed IS_A boolean; |
143 |
|
|
|
144 |
|
|
lower_bound := 0.0; |
145 |
|
|
upper_bound := 1000000.0; |
146 |
|
|
nominal := 0.5; |
147 |
|
|
END solver_int; |
148 |
|
|
|
149 |
|
|
ATOM solver_binary REFINES solver_int |
150 |
|
|
DIMENSIONLESS |
151 |
|
|
DEFAULT 0.0; |
152 |
|
|
|
153 |
|
|
lower_bound := 0.0; |
154 |
|
|
upper_bound := 1.0; |
155 |
|
|
nominal := 0.5; |
156 |
|
|
END solver_binary; |
157 |
|
|
|
158 |
|
|
ATOM solver_semi REFINES solver_var |
159 |
|
|
DEFAULT 1.0 {?}; |
160 |
|
|
|
161 |
|
|
is_zero IS_A boolean; |
162 |
|
|
relaxed IS_A boolean; |
163 |
|
|
|
164 |
|
|
lower_bound := 1 {?}; |
165 |
|
|
upper_bound := 1e20 {?}; |
166 |
|
|
nominal := 1.0 {?}; |
167 |
|
|
END solver_semi; |