Overview
Comment:Added dummy first argument for compatibility with new _ese.r format.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 1484260aed648b88049016acd2fc0374bc71aebe4df2218ca56125a426489806
User & Date: gawthrop@users.sourceforge.net on 2003-01-07 10:16:26
Other Links: branch diff | manifest | tags
Context
2003-01-07
18:09:21
More informative error message. check-in: d2cfe6e011 user: geraint@users.sourceforge.net tags: origin/master, trunk
10:16:26
Added dummy first argument for compatibility with new _ese.r format. check-in: 1484260aed user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:11:45
Octavised.
Added new first argument to write component type to cr in ese file.
check-in: f5b5f826d5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/cr/r/lin.cr from [ad1038d916] to [044595bc38].

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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$



% % Revision 1.3  1998/07/04 10:47:04  peterg
% % back under RCS
% %
% % Revision 1.2  1998/03/04 15:38:54  peterg
% % Added END statement
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%DESCRIPTION    single port components: R,C,I
%Linear Constitutive Relationship for single port components: R,C,I.
% e = Gain*f (if gain_causality = flow) 
%           f = Gain*e (if gain_causality = effort)
OPERATOR lin;
FOR ALL gain_causality, gain, causality, input, other_causality
SUCH THAT causality = gain_causality
LET lin(gain_causality, gain, other_causality, 1, input, causality, 1)
         = gain*input;

%Linear CR: e = (1/Gain)*f (if gain_causality = flow) 
%           f = (1/Gain)*e (if gain_causality = effort)
FOR ALL gain_causality, gain, causality, input, other_causality
SUCH THAT causality NEQ gain_causality
LET lin(gain_causality, gain, other_causality, 1, input, causality, 1)
         = input/gain;

%DESCRIPTION    two port components: AE, AF
% Linear Constitutive Relationship for AE and AF
% Output = gain * input

% Unicausal form
FOR ALL gain, input, causality
LET lin(gain, causality, 2, input, causality, 1) = gain*input;

%Bicausal form
FOR ALL gain, output, causality
LET lin(gain, causality, 1, output, causality, 2) = output/gain;

%DESCRIPTION   two port component: TF
% Linear Constitutive Relationship for TF
FOR ALL gain_causality, gain, causality, outport, input, same_causality, inport

SUCH THAT 
       ( causality = same_causality ) 
       AND 
       ( inport NEQ outport )
       AND
       (
       ( (causality = gain_causality) AND (outport = 2) )
       OR
       ( (causality NEQ gain_causality) AND (outport = 1) )
       )
LET lin(gain_causality, gain, causality, outport, 
          input, same_causality, inport)
        = gain*input;

FOR ALL gain_causality, gain, causality, outport, 
        input, same_causality, inport
SUCH THAT 
       ( causality = same_causality ) 
       AND       
       ( inport NEQ outport )
       AND
       (
       ( (causality NEQ gain_causality) AND (outport = 2) )
       OR
       ( (causality = gain_causality) AND (outport = 1) )
       )
LET lin(gain_causality, gain, causality, outport, 
         input, same_causality, inport)
        = input/gain;

%% This version in not reliable. I rellly need to pass component names
%% as cr arguments.

%DESCRIPTION    two port component: GY
% Linear Constitutive Relationship for GY

FOR ALL gain, input, causality, gain_causality, other_causality, 
        outport, inport
SUCH THAT 
        (causality NEQ other_causality) 
        AND
        ( inport NEQ outport )
        AND
        (
        ( (causality NEQ gain_causality) AND (outport = 2) )
        OR
        ( (causality NEQ gain_causality) AND (outport = 1) )
        )
LET lin(gain_causality, gain, other_causality, outport, 
        input, causality, inport)
         = input/gain;

FOR ALL gain, input, causality, gain_causality, other_causality, 
        outport, inport
SUCH THAT 
        (causality NEQ other_causality) 
        AND
        ( inport NEQ outport )
        AND
        (
        ( (causality = gain_causality) AND (outport = 2) )
        OR
        ( (causality = gain_causality) AND (outport = 1) )
        )
LET lin(gain_causality, gain, other_causality, outport, 
        input, causality, inport)
         = gain*input;

%DESCRIPTION    three port component: FMR

% Linear Constitutive Relationship for FMR - unicausal case
% Flow modulation multiplies effort on port 1 (or divides flow)

% The 4 possibilities follow...
FOR ALL gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality=in_causality) AND (out_causality=flow)
LET lin(gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input*gain*mod_input;

FOR ALL gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality=in_causality) AND (out_causality=effort)
LET lin(gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input*gain/mod_input;

FOR ALL gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=flow)
LET lin(gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input*mod_input/gain;

FOR ALL gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=effort)
LET lin(gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input/(gain*mod_input);

% Linear Constitutive Relationship for FMR - bicausal case
% Deduces the flow on port 2.

% The 2 possibilities follow...
FOR ALL gain,  e_input, f_input
LET lin(effort, gain, flow, 2, 
                e_input, effort, 1,
                f_input, flow, 1)
         = (f_input/e_input)/gain;

%EMTF component - modulation only
% Linear Constitutive Relationship for EMTF
FOR ALL gain_causality, gain, causality, outport, input, same_causality, inport
SUCH THAT 
       ( (causality = gain_causality) AND (outport = 2) )
       OR
       ( (causality NEQ gain_causality) AND (outport = 1) )
LET lin(gain_causality, causality, outport, 
          input, same_causality, inport,
	  gain, effort, 3)
        = gain*input;

FOR ALL gain_causality, gain, causality, outport, 
        input, same_causality, inport
SUCH THAT 
       ( (causality NEQ gain_causality) AND (outport = 2) )
       OR
       ( (causality = gain_causality) AND (outport = 1) )
LET lin(gain_causality, causality, outport, 
         input, same_causality, inport,
	  gain, effort, 3)
        = input/gain;

%EMTF component - modulation and gain
% Linear Constitutive Relationship for EMTF
FOR ALL gain_causality, gain, causality, outport, input,
same_causality, inport, modulation
SUCH THAT 
       ( (causality = gain_causality) AND (outport = 2) )
       OR
       ( (causality NEQ gain_causality) AND (outport = 1) )
LET lin(gain_causality, gain, causality, outport, 
          input, same_causality, inport,
	  modulation, effort, 3)
        = gain*modulation*input;

FOR ALL gain_causality, gain, causality, outport, 
        input, same_causality, inport, modulation
SUCH THAT 
       ( (causality NEQ gain_causality) AND (outport = 2) )
       OR
       ( (causality = gain_causality) AND (outport = 1) )
LET lin(gain_causality, gain, causality, outport, 
         input, same_causality, inport,
	  modulation, effort, 3)
        = input/(gain*modulation);

END;;








>
>
>















|

|




|

|







|
|


|
|



|











|



|











|









|











|



|











|









|


|




|


|




|


|




|


|








|
|






|




|




|





|






|





|




|





|






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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229


% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$
% % Revision 1.1  2000/12/28 09:19:07  peterg
% % put under RCS
% %
% % Revision 1.3  1998/07/04 10:47:04  peterg
% % back under RCS
% %
% % Revision 1.2  1998/03/04 15:38:54  peterg
% % Added END statement
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%DESCRIPTION    single port components: R,C,I
%Linear Constitutive Relationship for single port components: R,C,I.
% e = Gain*f (if gain_causality = flow) 
%           f = Gain*e (if gain_causality = effort)
OPERATOR lin;
FOR ALL comp_type,  gain_causality, gain, causality, input, other_causality
SUCH THAT causality = gain_causality
LET lin(comp_type,gain_causality, gain, other_causality, 1, input, causality, 1)
         = gain*input;

%Linear CR: e = (1/Gain)*f (if gain_causality = flow) 
%           f = (1/Gain)*e (if gain_causality = effort)
FOR ALL comp_type,  gain_causality, gain, causality, input, other_causality
SUCH THAT causality NEQ gain_causality
LET lin(comp_type,gain_causality, gain, other_causality, 1, input, causality, 1)
         = input/gain;

%DESCRIPTION    two port components: AE, AF
% Linear Constitutive Relationship for AE and AF
% Output = gain * input

% Unicausal form
FOR ALL comp_type,  gain, input, causality
LET lin(comp_type,gain, causality, 2, input, causality, 1) = gain*input;

%Bicausal form
FOR ALL comp_type,  gain, output, causality
LET lin(comp_type,gain, causality, 1, output, causality, 2) = output/gain;

%DESCRIPTION   two port component: TF
% Linear Constitutive Relationship for TF
FOR ALL comp_type,  gain_causality, gain, causality, outport, input, same_causality, inport

SUCH THAT 
       ( causality = same_causality ) 
       AND 
       ( inport NEQ outport )
       AND
       (
       ( (causality = gain_causality) AND (outport = 2) )
       OR
       ( (causality NEQ gain_causality) AND (outport = 1) )
       )
LET lin(comp_type,gain_causality, gain, causality, outport, 
          input, same_causality, inport)
        = gain*input;

FOR ALL comp_type,  gain_causality, gain, causality, outport, 
        input, same_causality, inport
SUCH THAT 
       ( causality = same_causality ) 
       AND       
       ( inport NEQ outport )
       AND
       (
       ( (causality NEQ gain_causality) AND (outport = 2) )
       OR
       ( (causality = gain_causality) AND (outport = 1) )
       )
LET lin(comp_type,gain_causality, gain, causality, outport, 
         input, same_causality, inport)
        = input/gain;

%% This version in not reliable. I rellly need to pass component names
%% as cr arguments.

%DESCRIPTION    two port component: GY
% Linear Constitutive Relationship for GY

FOR ALL comp_type,  gain, input, causality, gain_causality, other_causality, 
        outport, inport
SUCH THAT 
        (causality NEQ other_causality) 
        AND
        ( inport NEQ outport )
        AND
        (
        ( (causality NEQ gain_causality) AND (outport = 2) )
        OR
        ( (causality NEQ gain_causality) AND (outport = 1) )
        )
LET lin(comp_type,gain_causality, gain, other_causality, outport, 
        input, causality, inport)
         = input/gain;

FOR ALL comp_type,  gain, input, causality, gain_causality, other_causality, 
        outport, inport
SUCH THAT 
        (causality NEQ other_causality) 
        AND
        ( inport NEQ outport )
        AND
        (
        ( (causality = gain_causality) AND (outport = 2) )
        OR
        ( (causality = gain_causality) AND (outport = 1) )
        )
LET lin(comp_type,gain_causality, gain, other_causality, outport, 
        input, causality, inport)
         = gain*input;

%DESCRIPTION    three port component: FMR

% Linear Constitutive Relationship for FMR - unicausal case
% Flow modulation multiplies effort on port 1 (or divides flow)

% The 4 possibilities follow...
FOR ALL comp_type,  gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality=in_causality) AND (out_causality=flow)
LET lin(comp_type,gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input*gain*mod_input;

FOR ALL comp_type,  gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality=in_causality) AND (out_causality=effort)
LET lin(comp_type,gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input*gain/mod_input;

FOR ALL comp_type,  gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=flow)
LET lin(comp_type,gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input*mod_input/gain;

FOR ALL comp_type,  gain_causality, gain, out_causality, input, in_causality,
        mod_input
SUCH THAT (gain_causality NEQ in_causality) AND (out_causality=effort)
LET lin(comp_type,gain_causality, gain, out_causality, 1, 
                input, in_causality, 1,
                mod_input, flow, 2)
         = input/(gain*mod_input);

% Linear Constitutive Relationship for FMR - bicausal case
% Deduces the flow on port 2.

% The 2 possibilities follow...
FOR ALL comp_type,  gain,  e_input, f_input
LET lin(comp_type,effort, gain, flow, 2, 
                e_input, effort, 1,
                f_input, flow, 1)
         = (f_input/e_input)/gain;

%EMTF component - modulation only
% Linear Constitutive Relationship for EMTF
FOR ALL comp_type,  gain_causality, gain, causality, outport, input, same_causality, inport
SUCH THAT 
       ( (causality = gain_causality) AND (outport = 2) )
       OR
       ( (causality NEQ gain_causality) AND (outport = 1) )
LET lin(comp_type,gain_causality, causality, outport, 
          input, same_causality, inport,
	  gain, effort, 3)
        = gain*input;

FOR ALL comp_type,  gain_causality, gain, causality, outport, 
        input, same_causality, inport
SUCH THAT 
       ( (causality NEQ gain_causality) AND (outport = 2) )
       OR
       ( (causality = gain_causality) AND (outport = 1) )
LET lin(comp_type,gain_causality, causality, outport, 
         input, same_causality, inport,
	  gain, effort, 3)
        = input/gain;

%EMTF component - modulation and gain
% Linear Constitutive Relationship for EMTF
FOR ALL comp_type,  gain_causality, gain, causality, outport, input,
same_causality, inport, modulation
SUCH THAT 
       ( (causality = gain_causality) AND (outport = 2) )
       OR
       ( (causality NEQ gain_causality) AND (outport = 1) )
LET lin(comp_type,gain_causality, gain, causality, outport, 
          input, same_causality, inport,
	  modulation, effort, 3)
        = gain*modulation*input;

FOR ALL comp_type,  gain_causality, gain, causality, outport, 
        input, same_causality, inport, modulation
SUCH THAT 
       ( (causality NEQ gain_causality) AND (outport = 2) )
       OR
       ( (causality = gain_causality) AND (outport = 1) )
LET lin(comp_type,gain_causality, gain, causality, outport, 
         input, same_causality, inport,
	  modulation, effort, 3)
        = input/(gain*modulation);

END;;


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]