Differences From Artifact [713fa3d927]:

To Artifact [2f139cc4dc]:


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.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







>
>
>
>
>
>
>
>
>
>
>
>
>







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
# Copyright (c) P.J.Gawthrop, 1991, 1994, 1996

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.12.2.1  2002/06/05 11:14:51  geraint
## ae.r now generated using def2write_r like cse?.r
## fix_c.r called at ese2rdae stage so that pow gets fixed in ae.r.
##
## These changes produce the desired result (optimised algebraic equations) but
## have highlighted a problem; when optimisation fails, Reduce does not write
## a result. For complicated systems, this can lead to missing assignments in
## the resultant code.
##
## Revision 1.12  2001/07/23 23:31:17  gawthrop
## Added -cr option to load CRs first - avoids alg. loops with R
## implementation of mutiports.
##
## 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
96
97
98
99
100
101
102




103
104
105
106
107
108
109
  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";
                exit ;;







>
>
>
>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
  case $1 in
	-I )
                info=info;;
	-cr )
                load_cr=yes;
                blurb2=' using cr and subs first';
                ;;
      -fixcc )
		include=`echo 'in "'$MTT_LIB'/reduce/fix_c.r";'`
		blurb3='fixing c and cc code';
		;;
	-partition )
                partition=yes;
                blurb='with partitioning';
		;;
	*)
		echo "$1 is an invalid argument - ignoring";
                exit ;;
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

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";

% Elementary system equations
in "$esename";




OFF Echo;
OFF Nat;

%Create the output file
OUT "$daename";








|



















>
>
>







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

if [ -n "${load_cr}" ]; then
    load_cr_comm="in \"${crname}\";"
    load_subs_comm="in \"${subsname}\";"
fi

# Inform user
echo Creating $daename $blurb $blurb2 $blurb3

# 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";

% Elementary system equations
in "$esename";

% Fix c code if required
$include

OFF Echo;
OFF Nat;

%Create the output file
OUT "$daename";


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