Overview
Comment:Now does implicit integration with switches
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 5f43ad54eff5c716c20968b8150d21e78e8067bfab3f2fdd0410c4c021f6a726
User & Date: gawthrop@users.sourceforge.net on 1998-10-01 16:01:09
Other Links: branch diff | manifest | tags
Context
1998-10-01
16:02:01
Integration with switches handled separately fro Euler and Implicit. check-in: 7f5a5bd7d1 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:01:09
Now does implicit integration with switches check-in: 5f43ad54ef user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:46:34
Now generates _switcha.m as well -- needed for implicit integration check-in: 82f51e3de3 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_m2p from [78fbf331c7] to [4e9b48a2e4].

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 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.19  1998/09/29 15:37:18  peterg
## Declare mttINPUT
##
## Revision 1.18  1998/08/27 08:55:40  peterg
## Mods to integration methods
##
## Revision 1.17  1998/08/27 07:38:40  peterg
## About to change to new integration (Euler/Implicit only)
##
## Revision 1.16  1998/08/19 08:46:00  peterg
141
142
143
144
145
146
147
148






149
150
151
152
153
154
155
144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161
162
163







-
+
+
+
+
+
+







	echo "    mtty                        : OutputVector;"
	echo "    mttAA                       : StateMatrix;"
	echo "    MTTi,MTTj,MTTit,MTTjt,MTTiLast,mttSTEPFACTOR,mttWSTEPS,mttSTEPS,mttINPUT : INTEGER;"
	echo "    mttMETHOD : IntegrationMethod;"
	echo ""
        ;;
    switch)
	echo "PROCEDURE $Sys_rep(VAR mttxs : StateVector;"
	echo "PROCEDURE $Sys_rep(VAR mttx : StateVector);"
	echo "VAR"
	echo "    MTTi,MTTj :  INTEGER;"
	;;
    switcha)
	echo "PROCEDURE $Sys_rep(VAR mttAA : StateMatrix;"
	echo "                       mttx  : StateVector);"
	echo "VAR"
	echo "    MTTi,MTTj :  INTEGER;"
	;;
    *)	echo "PROCEDURE $Sys_rep;"
	echo "VAR"
	echo "    MTTi,MTTj :  INTEGER;"
242
243
244
245
246
247
248

249
250
251
252
253
254
255
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264







+







          printf("{%s %s_simpar.p}\n",inc,sys) 
          printf("{%s %s_numpar.p}\n",inc,sys)
          printf("{%s %s_state.p}\n",inc,sys)
          printf("{%s %s_input.p}\n",inc,sys)
          printf("{%s %s_ode.p}\n",inc,sys)
          printf("{%s %s_odeo.p}\n",inc,sys)
          printf("{%s %s_switch.p}\n\n",inc,sys)
          printf("{%s %s_switcha.p}\n\n",inc,sys)

          for (k=1;k<=j;k++) printf("%s\n", comment[k])
          printf("\n")
          printf("\nBEGIN{%s}\n", Sys_rep)
        }
        else{
          for (k=1;k<=j;k++) printf("%s\n", comment[k])
277
278
279
280
281
282
283

284
285
286
287
288
289
290
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300







+







          sub(/=/,":=",$0)
          printf("%s DO BEGIN\n", $0) 
          }
          else{
            sub(/=/,":=",$0)
            sub(/endif/,"END{IF}",$0)
            sub(/endfor/,"END{FOR}",$0)
            sub(/else/,"END ELSE BEGIN",$0)
            gsub(/\^/,"**",$0)
            gsub(/&&/," AND ",$0)
            gsub(/\|\|/," OR ",$0)
            printf("%s\n",$0)
          }
        }
      }
299
300
301
302
303
304
305
306
307







308
309
310
311
312
313
314
315
316
309
310
311
312
313
314
315


316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331







-
-
+
+
+
+
+
+
+









    }
    else
      if (rep=="ode2odes")
                printf("END{%s}.\n", Sys_rep)
      else
        printf("END{%s};\n", Sys_rep)
}' Sys=$Sys sys=$sys Sys_rep=$Sys_rep rep=$rep Nx=$Nx Nu=$Nu Ny=$Ny |\
sed 's/(\([ijk0-9,]*\))/\[\1\]/g'  |\
sed 's/(\(MTT[ijk0-9,]*\))/\[\1\]/g' \
sed 's/(\([ijk0-9,]*\))/\[\1\]/g'    |\
sed 's/(\(MTT[ijk0-9],[0-9]*\))/\[\1\]/g' |\
sed 's/(\([0-9]*,MTT[ijk0-9]\))/\[\1\]/g' |\
sed 's/(\(MTT[ijk0-9],MTT[ijk0-9]\))/\[\1\]/g' |\
sed 's/(\(MTT[ijk0-9,]*\))/\[\1\]/g'  |\
sed 's/switcha(mttAA,/switcha(/g'   |\
sed 's/switch(MTTx,/switch(/g'  \
>> $Filename

# p2c doesn't like mixed case filenames!
if [ "$Filename" != "$filename" ]; then
  echo Creating $filename
  cp -f $Filename $filename
fi



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