Overview
Comment:Writes out algebraic equations (if any).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 3f82cb70abec810c62be608f0d7552c220bce04e1d3a6ad9aee4731cdcaa5950
User & Date: gawthrop@users.sourceforge.net on 1998-05-20 15:13:09
Other Links: branch diff | manifest | tags
Context
1998-05-20
15:23:26
Put MTTYz := MTTYz outsise the BEGIN/END check-in: f4974ae64b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:13:09
Writes out algebraic equations (if any). check-in: 3f82cb70ab user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1998-05-19
19:48:02
Read the simpar file now. check-in: 28a732ebdd user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/dae2cse_r from [caea15d16a] to [0b0b00053d].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+







# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3  1998/03/03 09:02:46  peterg
## Replaced MTTEyx*MTTEdX + MTTEyu*MTTdu; term
##
## Revision 1.2  1997/08/26 08:22:36  peterg
## Changed
## MTTY := MTTY + MTTEyx*MTTdX + MTTEyu*MTTdu;
## to
## MTTY := MTTY + MTTEyx*MTTEdX + MTTEyu*MTTdu;
##
## This sorts out the problem when dz appears in the output equation.
45
46
47
48
49
50
51

52

53
54
55
56
57
58
59
48
49
50
51
52
53
54
55

56
57
58
59
60
61
62
63







+
-
+








OFF Echo;
OFF Nat;
ON NERO;

in "$1_def.r";
MTTdxs := MTTdX;  %Save the symbolic form of dX

in "$1_sympar.r";
in "$1_subs.r";
in "$1_dae.r";


%Create F_x, F_y matrices - assumming equations are linear in dZ
IF MTTNz>0 THEN 
BEGIN
% Find MTTFx;
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
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







+
+


-
-
+
+







-






+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







  MTTdZ18 := 0;
  MTTdZ19 := 0;

MTTEdX := MTTdX; %Ie MTTEdX is MTTdX with the dz terms deleted ie EdX.
MTTdX := MTTdXs;  %Restore the symbolic dX



MTTY := MTTY + MTTEyx*MTTEdX;
%%% This causes the matrix mismatch
%%% MTTdXs and MTTdu need setting in _def.r file
MTTY := MTTY + MTTEyx*MTTEdX + MTTEyu*MTTdu;
%%%%%%MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX;
%%MTTY := MTTY +  MTTEyu*MTTdu;
MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX;





END; %%of MTTNz>0


IF MTTNz=0 THEN 
BEGIN
  MTTEdX := MTTdX;
  MTTE   := MTTI;
END;

%IF MTTNyz>0 THEN 
%BEGIN
%  %%%% Try and solve algebraic loops!!
%
%  %Create list of the relevant equations 
%  MTT_eqns := {};
%  FOR i := 1:MTTNyz DO
%    MTT_eqns := append(MTT_eqns,{MTTyz(i,1)});
%
%  %Create list of the relevant unknowns
%  MTT_unknowns := {};
%  FOR i := 1:MTTNyz DO
%    MTT_unknowns := append(MTT_unknowns,{MTTUi(i,1)});
%
%  %Solve the algebraic equations symbolically
%  MTT_sol := solve(MTT_eqns,MTT_unknowns);
%
%  %Substitute back into the equations
%  FOR i := 1:MTTNyz DO
%  BEGIN
%    MTT_sol_i := first(MTT_sol); MTT_sol := rest(MTT_sol);
%    set(lhs(MTT_sol_i),rhs(MTT_sol_i));
%  END;
%
%END; % IF MTTNyz>0

%%Create the _cse.r file
OUT "$1_cse.r";

IF MTTNx>0 THEN
BEGIN
  write "matrix MTTEdX(", MTTNx, ",1)";
END;
192
193
194
195
196
197
198







199
200
201
202
203
204
205
206
207
208
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246







+
+
+
+
+
+
+










  IF MTTNx>0 THEN IF MTTNy>0 THEN
  BEGIN
    write "matrix MTTEyx(", MTTNy, ",", MTTNx, ")";
  END;
  MTTEyx := MTTEyx;
%%%%%  MTTdU := MTTdU;
END;

IF MTTNyz>0 THEN
  BEGIN
  write "matrix MTTYz(", MTTNyz, ",1)";
   MTTYz := MTTYz;
  END;


write ";END;";

SHUT "$1_cse.r";
quit;

EOF

# Now invoke the standard error handling.
mtt_error_r dae2cse_r.log


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