Differences From Artifact [de5c0e19db]:

To Artifact [e73dff93c1]:


8
9
10
11
12
13
14



15
16
17
18
19
20
21
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24







+
+
+







# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.13  2000/11/09 17:19:52  peterg
## Geraint's pow() mods
##
## Revision 1.12  2000/11/09 16:09:46  peterg
## Declare dummy variables (mtt_s1 etc)
##
## Revision 1.11  2000/11/09 15:29:35  peterg
## lower-case declarations
##
## Revision 1.10  2000/11/07 17:20:51  peterg
96
97
98
99
100
101
102








103

104
105
106
107
108
109
110
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121







+
+
+
+
+
+
+
+
-
+







    cseo)
	states=yes;
        inputs=yes;
	parameters=yes;
        output=mtty
        args=$eqnargs
	;;
    dm)
	states=no;
	inputs=no;
	parameters=yes;
        output='mtta,mttb,mttc,mttd,mtte'
        args=mttpar
        zeromatrices='a b c d e';
	;;
    input)
   input)
	states=yes;
	inputs=no;
	parameters=yes;
        output=mttu
        args=$inputeqnargs
        declareinputs=yes
	;;
151
152
153
154
155
156
157
158


159
160

161
162
163
164
165
166
167
162
163
164
165
166
167
168

169
170
171

172
173
174
175
176
177
178
179







-
+
+

-
+







        output='mttsimpar'
	;;
    sm)
	states=no;
	inputs=no;
	parameters=yes;
        output='mtta,mttb,mttc,mttd'
        args=mttpar
        args=mttpar;
        zeromatrices='a b c d';
	;;
    smxa)
     smxa)
	states=no;
        inputs=no;
	parameters=yes;
        output='mtta'
        args=$eqnargs
	;;
    smxax)
237
238
239
240
241
242
243



























244
245
246

247
248
249
250
251
252
253
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284

285
286
287
288
289
290
291
292







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


-
+







	echo Language $language not supported - sorry; exit 1
esac

if [ "$rep" = "simpar" ]; then
   output=${output}${map}    # Output is simpar_map in this case
fi

function zero_matrices(){
## Set matrices to zero
echo
echo '## Set matrices to zero'
for name in $zeromatrices; do
    case $name in
	a)
	    N=$Nx; M=$Nx
	    ;;
	b)
	    N=$Nx; M=$Nu
	    ;;
	c)
	    N=$Ny; M=$Nx
	    ;;
	d)
	    N=$Ny; M=$Nu
	    ;;
	e)
	    N=$Nx; M=$Nx
	    ;;
	*)
	    
    esac
    echo "   mtt$name = zeros($N,$M);"
done
}
function declare_dummies(){
# Get the dummies
dummies="mtt_s"
dummies="mtt_tmp"
rm -f mtt_dummies
for dummy in $dummies; do
    awk '{
     if (match($1,dummy)==1) print $1
     }' dummy=$dummy < ${fun_name}.m >> mtt_dummies
done

322
323
324
325
326
327
328


329
330
331
332
333
334
335
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376







+
+







if [ "$declareinputs" = "yes" ]; then
  declare_vars input
fi

if [ "$declaredummies" = "yes" ]; then
  declare_dummies
fi

zero_matrices;

}

# Argument specific stuff
function get_arg_specific_stuff ()
{
    arg_name=${1:-""}

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