~jdpipe/ascend/trunk-old

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
REQUIRE "basemodel.a4l";
(* => basemodel.a4l *)
PROVIDE "ivpsystem.a4l";
PROVIDE "system.a4l";

(*
 *  ivpsystem.a4l
 *  by Benjamin A. Allan, Jennifer Stokes
 *  Part of the ASCEND Library
 *  $Date: 1998/06/17 19:09:35 $
 *  $Revision: 1.7 $
 *  $Author: mthomas $
 *  $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/ivpsystem.a4l,v $
 *
 *  This file is part of the ASCEND Modeling Library.
 *
 *  Copyright (C) 1994 - 1998 Carnegie Mellon University
 *
 *  The ASCEND Modeling Library is free software; you can redistribute
 *  it and/or modify it under the terms of the GNU General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  The ASCEND Modeling Library is distributed in hope that it
 *  will be useful, but WITHOUT ANY WARRANTY; without even the implied
 *  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *)

(*============================================================================*

    I V P S Y S T E M  .  A 4 L
    -----------------------------

    AUTHOR:      Benjamin A. Allan

    DATES:       06/94 - Original Code (system.a4l)
                 02/95 - Definitions for discrete variables added by
                         Craig Schmidt (CWS). (system.a4l)
                 08/95   Jennifer Stokes extensions for ODE solvers.
                 04/96 - Modified for the use of constants
		 03/98 - Added messages.

    CONTENTS:	 Basic definitions for relation, solver_var,
                 and generic_real.  This file is necessary for all
                 other ASCEND models to work on ASCEND3C with the
                 blsode DAE interface. For strictly algebraic
                 modeling, the other system.a4l should be used and
                 will give rather smaller (memorywise) solver_var.

*============================================================================*)

DEFINITION relation

    included IS_A boolean;
    message  IS_A symbol;

    included := TRUE;
    message := 'none';
END relation;


DEFINITION logic_relation

    included IS_A boolean;
    included := TRUE;

    message  IS_A symbol;
    message := 'none';

END logic_relation;

ATOM boolean_var REFINES boolean
    DEFAULT TRUE;

    fixed     IS_A boolean;
    fixed := FALSE;

END boolean_var;

ATOM solver_var REFINES real
    DEFAULT 0.5 {?};

    lower_bound     IS_A real;
    upper_bound     IS_A real;
    nominal         IS_A real;
    fixed           IS_A boolean;
    message	    IS_A symbol;

    ode_type        IS_A integer;
    ode_id          IS_A integer;
    obs_id          IS_A integer;
    ode_atol        IS_A real;
    ode_rtol        IS_A real;

    fixed       := FALSE;
    lower_bound := -1e20 {?};
    upper_bound := 1e20 {?};
    nominal     := 0.5 {?};
    message	:= 'none';

    ode_type    := 0;
    ode_atol    := 1e-4 {?};
    ode_rtol    := 1e-8 {?};

END solver_var;

ATOM generic_real REFINES solver_var
    DIMENSIONLESS
    DEFAULT 0.5;
    lower_bound := -1e20;
    upper_bound := 1e20;
    nominal     := 0.5;
END generic_real;

(*============================================================================*

  Modified by CWS, 2/95

  solver_int is an integer variable for an MILP solver
       lower bound almost always 0
       relaxed indicates if the var should be treated as a normal solver_var
  solver_binary is a binary variable for a MILP solver
       lower bound must be 0, and upper bound must be 1
  solver_semi is a semicontinous variable for use in SCICONIC
       this var can have a value between 1 and the arbitrary upper bound, or 0.
       (note that SCICONIC requires the lower bound to be 1)
       if is_zero = true, then the current value is taken as 0

 *===========================================================================*)


ATOM solver_int REFINES solver_var
    DIMENSIONLESS
    DEFAULT 0.0;

    relaxed IS_A boolean;

    lower_bound := 0.0;
    upper_bound := 1000000.0;
    nominal     := 0.5;
END solver_int;

ATOM solver_binary REFINES solver_int
    DIMENSIONLESS
    DEFAULT 0.0;

    lower_bound := 0.0;
    upper_bound := 1.0;
    nominal     := 0.5;
END solver_binary;

ATOM solver_semi REFINES solver_var
    DEFAULT 1.0 {?};

    is_zero IS_A boolean;
    relaxed IS_A boolean;

    lower_bound := 1 {?};
    upper_bound := 1e20 {?};
    nominal     := 1.0 {?};
END solver_semi;