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.13 2000/10/11 08:52:46 peterg
## Creates csex (cse with dxe only) rep.
##
## Revision 1.12 2000/10/10 21:00:58 peterg
## New code genration
##
## Revision 1.11 1998/11/26 09:18:55 peterg
## Incluse subs.r
##
## Revision 1.10 1998/11/18 13:50:29 peterg
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
+
+
+
|
echo "Creating $1_csex.r"
echo "Creating $1_cseo.r"
# Remove the old log file
rm -f dae2cse_r.log
# Remove some files
rm -f $1_cse.r? $1_cseo.r?
# Use reduce to accomplish the transformation
$SYMBOLIC >dae2cse_r.log << EOF
%Read the formatting function
in "$MTTPATH/trans/reduce_matrix.r";
OFF Echo;
|
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
|
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
+
+
-
-
-
+
+
+
+
|
write "MATRIX MTTE(", MTTNx, ",", MTTNx, ")$";
SHUT "$1_cse.r1";
OUT "$1_csex.r1";
write "MATRIX MTTEdx(", MTTNx, ",", 1, ")$";
SHUT "$1_csex.r1";
IF MTTNy>0 THEN
BEGIN
OUT "$1_cseo.r1";
write "MATRIX MTTY(", MTTNy, ",", MTTNx, ")$";
SHUT "$1_cseo.r1";
OUT "$1_cseo.r1";
write "MATRIX MTTY(", MTTNy, ",", MTTNx, ")$";
SHUT "$1_cseo.r1";
END;
%%Create the _cse.r file
OUT "$1_cse.r2";
write "%File: $1_cse.r";
in ("$1_cse_write.r");
write "in ""$1_cseo.r"";";
write "END;";
|
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
|
+
+
+
+
+
-
-
-
+
+
+
|
OUT "$1_csex.r2";
write "%File: $1_cse.r";
in ("$1_csex_write.r");
write "END;";
SHUT "$1_csex.r2";
%Write out the output equations
IF MTTNy>0 THEN
BEGIN
OUT "$1_cseo.r2";
write "%File: $1_cseo.r";
in ("$1_cseo_write.r");
write "END;";
SHUT "$1_cseo.r2";
END;
quit;
EOF
touch $1_cseo.r1
touch $1_cseo.r2
cat $1_cse.r1 $1_cse.r2 > $1_cse.r
cat $1_csex.r1 $1_csex.r2 > $1_csex.r
cat $1_cseo.r1 $1_cseo.r2 > $1_cseo.r
cat $1_cse.r1 $1_cse.r2 > $1_cse.r
cat $1_csex.r1 $1_csex.r2 > $1_csex.r
cat $1_cseo.r1 $1_cseo.r2 > $1_cseo.r
if [ "$solve" = "1" ]; then
echo "Setting MTTNyz=0 in $1_def.r and removing other $1_def files"
awk '{
if ($1=="MTTNyz")
print "MTTNyz := 0;"
else print $0
|