~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
REQUIRE "basemodel.a4l";
PROVIDE "system.a4l";

(*
 *  system.a4l
 *  by Benjamin A. Allan
 *  Part of the ASCEND Library
 *  $Date: 1998/06/17 19:31:48 $
 *  $Revision: 1.7 $
 *  $Author: mthomas $
 *  $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/system.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/>.
 *)

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

    S Y S T E M  .  A 4 L
    ----------------------

    AUTHOR:      Benjamin A. Allan

    DATES:       06/94 - Original Code
                 02/95 - Definitions for discrete variables added by
                         Craig Schmidt (CWS).

    CONTENTS:	 Basic definitions for relation, solver_var,
		 and generic_real.  This file is necessary for all
		 other ASCEND models to work on ASCEND3C.
                 If integration with the new DAE interface (blsode)
                 is desired, ivpsystem.a4l should be loaded instead.
                 This file is strictly for algebraic modeling.

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

DEFINITION relation

    included IS_A boolean;
    message	IS_A symbol;

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


DEFINITION logic_relation

    included IS_A boolean;
    message	IS_A symbol;

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

END logic_relation;

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;

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

END solver_var;

ATOM boolean_var REFINES boolean
	DEFAULT TRUE;

    nominal	IS_A boolean;
    fixed	IS_A boolean;
    fixed := FALSE;
    nominal := TRUE;

END boolean_var;

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


ADD NOTES IN solver_int;
'purpose' SELF {
  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
}
END NOTES;
ADD NOTES IN solver_binary;
'purpose' SELF {
  solver_binary is a binary variable for a MILP solver
       lower bound must be 0, and upper bound must be 1
}
END NOTES;
ADD NOTES IN solver_semi;
'purpose' SELF {
  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
}
END NOTES;


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;