10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10 2000/11/30 15:23:16 peterg
## Taken out all subsystem stuff - now done in mtt using
## mtt_make_subsystems
##
## Revision 1.9 2000/09/07 12:18:31 peterg
## Prettified layout of this file
##
|
>
>
>
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.11 2001/07/06 00:46:50 gawthrop
## Added -cr option -- forces cr to be loaded before the ese.r file
## This avoids causality problems when using multi-port Rs to represent
## arbitary equations
##
## Revision 1.10 2000/11/30 15:23:16 peterg
## Taken out all subsystem stuff - now done in mtt using
## mtt_make_subsystems
##
## Revision 1.9 2000/09/07 12:18:31 peterg
## Prettified layout of this file
##
|
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
while [ -n "`echo $1 | grep '^-'`" ]; do
case $1 in
-I )
info=info;;
-cr )
load_cr=yes;
blurb2=' using cr first';
;;
-partition )
partition=yes;
blurb='with partitioning';
;;
*)
echo "$1 is an invalid argument - ignoring";
|
|
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
while [ -n "`echo $1 | grep '^-'`" ]; do
case $1 in
-I )
info=info;;
-cr )
load_cr=yes;
blurb2=' using cr and subs first';
;;
-partition )
partition=yes;
blurb='with partitioning';
;;
*)
echo "$1 is an invalid argument - ignoring";
|
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
|
sysname=$topname;
else
sysname=$1_$2;
fi
defname=$topname"_def.r"
crname=$topname"_cr.r"
paramname=$topname"_params.r"
daename=$sysname"_rdae.r"
esename=$sysname"_ese.r"
logname=ese2rdae.log
if [ -n "${load_cr}" ]; then
load_cr_comm="in \"${crname}\";"
fi
# Inform user
echo Creating $daename $blurb $blurb2
# Remove the old log file
rm -f $logname
# Use symbolic algebra to accomplish the transformation
$SYMBOLIC >$logname << EOF
%Read in the the cr is -cr set
$load_cr_comm
%Read the formatting function
in "$MTTPATH/trans/reduce_matrix.r";
% Definitions
in "$defname";
|
>
>
|
>
|
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
|
sysname=$topname;
else
sysname=$1_$2;
fi
defname=$topname"_def.r"
crname=$topname"_cr.r"
subsname=$topname"_subs.r"
paramname=$topname"_params.r"
daename=$sysname"_rdae.r"
esename=$sysname"_ese.r"
logname=ese2rdae.log
if [ -n "${load_cr}" ]; then
load_cr_comm="in \"${crname}\";"
load_subs_comm="in \"${subsname}\";"
fi
# Inform user
echo Creating $daename $blurb $blurb2
# Remove the old log file
rm -f $logname
# Use symbolic algebra to accomplish the transformation
$SYMBOLIC >$logname << EOF
%Read in the cr and sub when -cr is set
$load_cr_comm
$load_subs_comm
%Read the formatting function
in "$MTTPATH/trans/reduce_matrix.r";
% Definitions
in "$defname";
|