Overview
Comment:Sorted out sympar + switch variables - new sympars rep combines both
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 655b4b56e5ab3b310e15ba641b37e4a551774e959ee2a01a26cf5531cb662157
User & Date: gawthrop@users.sourceforge.net on 1998-07-25 19:16:22
Other Links: branch diff | manifest | tags
Context
1998-07-25
20:06:23
Does the mtt_update function check-in: 1a6786bd74 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
19:16:22
Sorted out sympar + switch variables - new sympars rep combines both check-in: 655b4b56e5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
18:50:53
Lower case names check-in: 0a340b14d4 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [e0d5a3b948] to [bfe00c5e86].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$



## Revision 1.168  1998/07/25 09:44:25  peterg
## Uses Pascal as step on the way to c code -- MUCH nicer!
## State and input now use the simple default - no steady states
##
## Revision 1.167  1998/07/24 17:10:34  peterg
## *** empty log message ***
##







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.169  1998/07/25 16:35:12  peterg
## Incorporated mtt_p2c (uses p2c)
##
## Revision 1.168  1998/07/25 09:44:25  peterg
## Uses Pascal as step on the way to c code -- MUCH nicer!
## State and input now use the simple default - no steady states
##
## Revision 1.167  1998/07/24 17:10:34  peterg
## *** empty log message ***
##
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
#SUMMARY cr	constitutive relationship for each subsystem (view)
$1_cr.tex: $1_cr.r
	txt2tex $1 cr r

#SUMMARY sympar	symbolic parameters (txt)
# Lbl to sympar conversion
ifeq ($switches,0)
$1_sympar.txt: $1_sub.sh
	lbl2sympar_txt2txt $1
 
	if [ "$level" = "0" ]; then \
	  mv $1_sympar.txt MTT_sympar.txt; \
	else \
	  cat $1_sympar.txt >> MTT_sympar.txt; \
	fi







|







1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
#SUMMARY cr	constitutive relationship for each subsystem (view)
$1_cr.tex: $1_cr.r
	txt2tex $1 cr r

#SUMMARY sympar	symbolic parameters (txt)
# Lbl to sympar conversion
ifeq ($switches,0)
$1_sympar.txt: $1_sub.sh 
	lbl2sympar_txt2txt $1
 
	if [ "$level" = "0" ]; then \
	  mv $1_sympar.txt MTT_sympar.txt; \
	else \
	  cat $1_sympar.txt >> MTT_sympar.txt; \
	fi
1272
1273
1274
1275
1276
1277
1278











1279
1280
1281
1282
1283
1284
1285
	sympar_txt2h $1

#SUMMARY sympar	symbolic parameters (tex)
# txt to tex (LaTeX) sympar conversion
$1_sympar.tex: $1_sympar.txt
	sympar_txt2tex $1












#SUMMARY simp	simplification information (r)
$1_simp.r:
	echo Creating $1_simp.r
	( \
	echo "%% Reduce commands to simplify output for system $1 ($1_simp.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \







>
>
>
>
>
>
>
>
>
>
>







1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
	sympar_txt2h $1

#SUMMARY sympar	symbolic parameters (tex)
# txt to tex (LaTeX) sympar conversion
$1_sympar.tex: $1_sympar.txt
	sympar_txt2tex $1

#SUMMARY switch	Dynamic switch information (txt)
$1_switch.txt: $1_struc.txt
	struc2switch_txt $1
$1_switch.m: $1_switch.txt $1_sympars.txt
	switch_txt2m $1

#SUMMARY sympars sympar + dynamic switch information (txt)
$1_sympars.txt: $1_sympar.txt $1_switch.txt
	   echo Creating $1_sympars.txt
	   cat $1_sympar.txt $1_switch.txt > $1_sympars.txt

#SUMMARY simp	simplification information (r)
$1_simp.r:
	echo Creating $1_simp.r
	( \
	echo "%% Reduce commands to simplify output for system $1 ($1_simp.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo 'END;'; \
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361

1362
1363
1364
1365
1366
1367
1368

#SUMMARY numpar	numerical parameter declaration -- default (txt) 
$1_numpar.txt:
	mtt $mtt_switches -q -u $1 sympar txt; 
	sympar2numpar_txt2txt $1

#SUMMARY numpar	numerical parameter declaration (m) 
$1_numpar.m:  $1_numpar.txt $1_sympar.txt
	numpar_txt2m $1

#SUMMARY numpar	numerical parameter declaration (c) 
$1_numpar.c:  $1_numpar.txt $1_sympar.c
	txt2c $1 numpar

#SUMMARY input	numerical input declaration  -- default (txt)
$1_input.txt: $1_struc.txt 

	struc2input_txt2txt $1

#SUMMARY state	numerical state declaration  -- default (txt)
$1_state.txt: 
	mtt -q $1 struc txt
	struc2state_txt2txt $1








|







|
>







1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383

#SUMMARY numpar	numerical parameter declaration -- default (txt) 
$1_numpar.txt:
	mtt $mtt_switches -q -u $1 sympar txt; 
	sympar2numpar_txt2txt $1

#SUMMARY numpar	numerical parameter declaration (m) 
$1_numpar.m:  $1_numpar.txt $1_sympars.txt
	numpar_txt2m $1

#SUMMARY numpar	numerical parameter declaration (c) 
$1_numpar.c:  $1_numpar.txt $1_sympar.c
	txt2c $1 numpar

#SUMMARY input	numerical input declaration  -- default (txt)
$1_input.txt: 
	mtt -q $1 struc txt
	struc2input_txt2txt $1

#SUMMARY state	numerical state declaration  -- default (txt)
$1_state.txt: 
	mtt -q $1 struc txt
	struc2state_txt2txt $1

1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
#	mtt $mtt_switches $1 ss r; 
#	mtt $mtt_switches -q -u $1 switch txt; 	
#	struc2input_txt2txt -s $1
#endif


#SUMMARY input	numerical input declaration (m) 
$1_input.m:  $1_input.txt $1_sympar.txt $1_ss.r
	txt2m $1 input

#SUMMARY state	state declaration  -- default (txt)
#$1_state.txt: 
#	mtt $mtt_switches $1 struc txt; 
#	mtt $mtt_switches $1 ss r; 
#	struc2state_txt2txt $1

#SUMMARY state	state declaration (m) 
$1_state.m:  $1_state.txt $1_sympar.txt
	txt2m $1 state

#SUMMARY state	state declaration (c) 
#$1_state.c:  $1_state.txt $1_sympar.txt
#	txt2c $1 state

#SUMMARY input	numerical input declaration (c) 
ifeq ($switches,0)
$1_input.c:  $1_input.txt $1_sympar.c
	input_txt2c $1
endif

ifeq ($switches,1)
$1_switch.c: $1_struc.txt
	struc2switch_txt2c $1
$1_input.c:  $1_input.txt $1_sympar.c $1_switch.c
	input_txt2c -s $1
endif

#SUMMARY desc Verbal description of system (tex)
$1_desc.tex:
	makedesc $1

#SUMMARY odes ODE simulation header file (h)
$1_odes.h: 







|









|







|
|
|
|
|
|
|
|
|
|
|







1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
#	mtt $mtt_switches $1 ss r; 
#	mtt $mtt_switches -q -u $1 switch txt; 	
#	struc2input_txt2txt -s $1
#endif


#SUMMARY input	numerical input declaration (m) 
$1_input.m:  $1_input.txt $1_sympars.txt $1_ss.r
	txt2m $1 input

#SUMMARY state	state declaration  -- default (txt)
#$1_state.txt: 
#	mtt $mtt_switches $1 struc txt; 
#	mtt $mtt_switches $1 ss r; 
#	struc2state_txt2txt $1

#SUMMARY state	state declaration (m) 
$1_state.m:  $1_state.txt $1_sympars.txt
	txt2m $1 state

#SUMMARY state	state declaration (c) 
#$1_state.c:  $1_state.txt $1_sympar.txt
#	txt2c $1 state

#SUMMARY input	numerical input declaration (c) 
#ifeq ($switches,0)
#$1_input.c:  $1_input.txt $1_sympar.c
#	input_txt2c $1
#endif
#
#ifeq ($switches,1)
#$1_switch.c: $1_struc.txt
#	struc2switch_txt2c $1
#$1_input.c:  $1_input.txt $1_sympar.c $1_switch.c
#	input_txt2c -s $1
#endif

#SUMMARY desc Verbal description of system (tex)
$1_desc.tex:
	makedesc $1

#SUMMARY odes ODE simulation header file (h)
$1_odes.h: 
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
#SUMMARY ese	elementary system equations (r)
#SUMMARY def	definitions - system orders etc. (r)
#SUMMARY def	definitions - system orders etc. (m)
#SUMMARY struc	structure - list of inputs, outputs and states (txt)
#SUMMARY struc	structure - list of inputs, outputs and states (tex)
#SUMMARY struc	structure - list of inputs, outputs and states (view)
#Elementary system equations + definitions
$1_ese.r: $1_cbg.m $1_sympar.txt
	   cbg2ese_m2r $info_switch $1; ese_tidy $1
$1_def.r: $1_ese.r
	touch $1_def.r
$1_struc.txt: $1_ese.r
	touch $1_struc.txt
$1_struc.tex: $1_struc.txt
	struc_txt2tex $1







|







1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
#SUMMARY ese	elementary system equations (r)
#SUMMARY def	definitions - system orders etc. (r)
#SUMMARY def	definitions - system orders etc. (m)
#SUMMARY struc	structure - list of inputs, outputs and states (txt)
#SUMMARY struc	structure - list of inputs, outputs and states (tex)
#SUMMARY struc	structure - list of inputs, outputs and states (view)
#Elementary system equations + definitions
$1_ese.r: $1_cbg.m $1_sympar.txt 
	   cbg2ese_m2r $info_switch $1; ese_tidy $1
$1_def.r: $1_ese.r
	touch $1_def.r
$1_struc.txt: $1_ese.r
	touch $1_struc.txt
$1_struc.tex: $1_struc.txt
	struc_txt2tex $1
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626


1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
$1_odeo.m: $1_ode.m
	touch $1_odeo.m
#$1_ode.c: $1_def.r $1_ode.r $1_sympar.r $1_sympar.c
#	ode_r2c $1 
$1_ode.tex: $1_ode.r  $1_sympar.r $1_simp.r
	ode_r2tex $1; latex_tidy $1_ode.tex

$1_ode2odes.m : $1_def.r
	make_ode2odes $1

#Conversion of m to p to c
#SUMMARY ode	ordinary differential equations (c)
#SUMMARY ode	ordinary differential equations (p)
#SUMMARY state	state declaration (c) 
#SUMMARY state	state declaration (p) 
$1_simpar.p : $1_def.r $1_simpar.m
	mtt_m2p $1_simpar.m
$1_numpar.p : $1_def.r $1_numpar.m
	mtt_m2p $1_numpar.m
$1_state.p : $1_def.r $1_state.m
	mtt_m2p $1_state.m
$1_input.p : $1_def.r $1_input.m
	mtt_m2p $1_input.m
$1_ode.p : $1_def.r $1_ode.m
	mtt_m2p $1_ode.m
$1_odeo.p : $1_def.r $1_odeo.m
	mtt_m2p $1_odeo.m


$1_ode2odes.p : $1_def.r $1_simpar.p $1_numpar.p $1_state.p $1_input.p \
               $1_ode.p $1_odeo.p  $1_ode2odes.m mtt_write.p
	mtt_m2p $1_ode2odes.m

$1_ode2odes.c: $1_ode2odes.p 
	mtt_p2c $info_switch $1 ode2odes

#SUMMARY obs	observer equations for CGPC (r)
#SUMMARY obs	observer equations for CGPC (m)
#SUMMARY obs	observer equations for CGPC (tex)
#SUMMARY obs	observer equations for CGPC (view)
#SUMMARY obs	observer equations for CGPC (ps)
#Observer functions for GPC
$1_obs.r: $1_ode.r $1_def.r $1_obspar.r $1_subs.r
	ode2obs_r $1; tidy $1_obs.r
$1_obs.m: $1_def.r $1_sympar.txt $1_obs.r $1_obspar.r $1_numpar.m
	obs_r2m $1; matlab_tidy $1_obs.m
$1_obs.tex: $1_obs.r  $1_sympar.r $1_simp.r
	obs_r2tex $1; latex_tidy $1_obs.tex


#SUMMARY rfe	robot-form equations (r)
#SUMMARY rfe	robot-form equations (tex)







|



















>
>

|













|







1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
$1_odeo.m: $1_ode.m
	touch $1_odeo.m
#$1_ode.c: $1_def.r $1_ode.r $1_sympar.r $1_sympar.c
#	ode_r2c $1 
$1_ode.tex: $1_ode.r  $1_sympar.r $1_simp.r
	ode_r2tex $1; latex_tidy $1_ode.tex

$1_ode2odes.m : $1_def.r $1_sympars.txt
	make_ode2odes $1

#Conversion of m to p to c
#SUMMARY ode	ordinary differential equations (c)
#SUMMARY ode	ordinary differential equations (p)
#SUMMARY state	state declaration (c) 
#SUMMARY state	state declaration (p) 
$1_simpar.p : $1_def.r $1_simpar.m
	mtt_m2p $1_simpar.m
$1_numpar.p : $1_def.r $1_numpar.m
	mtt_m2p $1_numpar.m
$1_state.p : $1_def.r $1_state.m
	mtt_m2p $1_state.m
$1_input.p : $1_def.r $1_input.m
	mtt_m2p $1_input.m
$1_ode.p : $1_def.r $1_ode.m
	mtt_m2p $1_ode.m
$1_odeo.p : $1_def.r $1_odeo.m
	mtt_m2p $1_odeo.m
$1_switch.p : $1_def.r $1_switch.m
	mtt_m2p $1_switch.m
$1_ode2odes.p : $1_def.r $1_simpar.p $1_numpar.p $1_state.p $1_input.p \
               $1_ode.p $1_odeo.p  $1_switch.p $1_ode2odes.m mtt_write.p
	mtt_m2p $1_ode2odes.m

$1_ode2odes.c: $1_ode2odes.p 
	mtt_p2c $info_switch $1 ode2odes

#SUMMARY obs	observer equations for CGPC (r)
#SUMMARY obs	observer equations for CGPC (m)
#SUMMARY obs	observer equations for CGPC (tex)
#SUMMARY obs	observer equations for CGPC (view)
#SUMMARY obs	observer equations for CGPC (ps)
#Observer functions for GPC
$1_obs.r: $1_ode.r $1_def.r $1_obspar.r $1_subs.r
	ode2obs_r $1; tidy $1_obs.r
$1_obs.m: $1_def.r $1_sympars.txt $1_obs.r $1_obspar.r $1_numpar.m
	obs_r2m $1; matlab_tidy $1_obs.m
$1_obs.tex: $1_obs.r  $1_sympar.r $1_simp.r
	obs_r2tex $1; latex_tidy $1_obs.tex


#SUMMARY rfe	robot-form equations (r)
#SUMMARY rfe	robot-form equations (tex)
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
	touch $1_sro.m
$1_odes.c: $1_ode.c $1_def.r $1_sympar.r
	ode2odes_r2c $1 
$1_sms.c: $1_sm.c $1_def.r $1_sympar.r
	sm2sms_r2c $1

ifeq ($computation,octave)
$1_odes.dat2: $1_ode2odes.m $1_ode.m $1_numpar.m  \
             $1_def.m $1_input.m $1_state.m $1_simpar.m $1_smx.m
	echo Creating $1_odes.dat2
	octave -q $1_ode2odes.m> $1_odes.dat2 
endif

ifeq ($computation,c)
$1_odes.dat2: $1_ode2odes.c
	echo Creating $1_odes.m
	echo Creating $1_odeso.m
	echo 'Compiling ...'
	$CC $1_ode2odes.c  -lm
	echo 'Running  ...'; time ./a.out>$1_odes.dat2 ; echo 'Done.'


$1_sms.m: $1_sms.c $1_sm.c $1_numpar.c $1_simpar.h\
         $1_sympar.c $1_sympar.h\







|


|




|
<







1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884

1885
1886
1887
1888
1889
1890
1891
	touch $1_sro.m
$1_odes.c: $1_ode.c $1_def.r $1_sympar.r
	ode2odes_r2c $1 
$1_sms.c: $1_sm.c $1_def.r $1_sympar.r
	sm2sms_r2c $1

ifeq ($computation,octave)
$1_odes.dat2: $1_ode2odes.m $1_ode.m $1_numpar.m $1_switch.m  \
             $1_def.m $1_input.m $1_state.m $1_simpar.m $1_smx.m
	echo Creating $1_odes.dat2
	time $MATRIX -q $1_ode2odes.m> $1_odes.dat2 
endif

ifeq ($computation,c)
$1_odes.dat2: $1_ode2odes.c
	echo Creating $1_odes.dat2

	echo 'Compiling ...'
	$CC $1_ode2odes.c  -lm
	echo 'Running  ...'; time ./a.out>$1_odes.dat2 ; echo 'Done.'


$1_sms.m: $1_sms.c $1_sm.c $1_numpar.c $1_simpar.h\
         $1_sympar.c $1_sympar.h\


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