Differences From Artifact [dc29d634d7]:

To Artifact [e0d5a3b948]:


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.167  1998/07/24 17:10:34  peterg
## *** empty log message ***
##
## Revision 1.166  1998/07/22 08:37:30  peterg
## Implicit integration now the default - for octave anyway.
##
## Revision 1.165  1998/07/19 16:00:22  peterg







>
>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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 ***
##
## Revision 1.166  1998/07/22 08:37:30  peterg
## Implicit integration now the default - for octave anyway.
##
## Revision 1.165  1998/07/19 16:00:22  peterg
1316
1317
1318
1319
1320
1321
1322




1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
#SUMMARY simpar	simulation information (txt)
$1_simpar.txt:
	echo Creating $1_simpar.txt
	( \
	echo "# Simulation parameters for system $1 ($1_simpar.txt)"; \
	echo "# Generated by MTT on" `date`.; \
	cat $MTTPATH/trans/rcs_header.sh; \




	echo 'LAST=10.0;'; \
	echo 'DT=0.1;'; \
	echo 'STEPFACTOR=1;'; \
	echo 'METHOD="Implicit;"'; \
        )> $1_simpar.txt

#SUMMARY simpar	simulation information (m)
$1_simpar.m: $1_simpar.txt
	echo Creating $1_simpar.m
	sed 's/txt/m/'<$1_simpar.txt >$1_simpar.m








>
>
>
>



|







1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
#SUMMARY simpar	simulation information (txt)
$1_simpar.txt:
	echo Creating $1_simpar.txt
	( \
	echo "# Simulation parameters for system $1 ($1_simpar.txt)"; \
	echo "# Generated by MTT on" `date`.; \
	cat $MTTPATH/trans/rcs_header.sh; \
	echo "global ..."; \
	echo "mtt_no_global ..."; \
	echo "mtt_no_global;"; \
        echo ;\
	echo 'LAST=10.0;'; \
	echo 'DT=0.1;'; \
	echo 'STEPFACTOR=1;'; \
	echo 'METHOD="Implicit";'; \
        )> $1_simpar.txt

#SUMMARY simpar	simulation information (m)
$1_simpar.m: $1_simpar.txt
	echo Creating $1_simpar.m
	sed 's/txt/m/'<$1_simpar.txt >$1_simpar.m

1350
1351
1352
1353
1354
1355
1356
1357

1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
	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: $1_struc.txt 

	struc2state_txt2txt $1

#ifeq ($switches,0)
#$1_input.txt: 
#	mtt $mtt_switches $1 struc txt; 
#	mtt $mtt_switches $1 ss r; 
#	struc2input_txt2txt $1
#endif
#ifeq ($switches,1)
#$1_input.txt: 
#	mtt $mtt_switches -q -u $1 struc txt; 
#	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
	input_txt2m $1

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








|
>



















|







1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
	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

#ifeq ($switches,0)
#$1_input.txt: 
#	mtt $mtt_switches $1 struc txt; 
#	mtt $mtt_switches $1 ss r; 
#	struc2input_txt2txt $1
#endif
#ifeq ($switches,1)
#$1_input.txt: 
#	mtt $mtt_switches -q -u $1 struc txt; 
#	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

1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
#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
	   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







|







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
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
$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 
	p2c $1_$2.p

#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







|







1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
$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
1843
1844
1845
1846
1847
1848
1849

1850

1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
	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.m: $1_ode.m $1_numpar.m  $1_def.m $1_input.m $1_state.m $1_simpar.m $1_smx.m

	 time ode2odes_m $1 
endif

ifeq ($computation,c)
$1_odes.m: $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; echo 'Done.'


$1_sms.m: $1_sms.c $1_sm.c $1_numpar.c $1_simpar.h\
         $1_sympar.c $1_sympar.h\
         $1_numpar.c $1_input.c dsvdcmp.c
	echo Creating $1_sms.m
	echo Creating $1_smso.m







>
|
>
|



|




|







1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
	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\
         $1_numpar.c $1_input.c dsvdcmp.c
	echo Creating $1_sms.m
	echo Creating $1_smso.m
1950
1951
1952
1953
1954
1955
1956
1957



1958

1959
1960
1961
1962
1963
1964
1965
1966

ifeq ($REPTYPE,txt)
#Generic conversion of txt files to tex files
$1_$2.tex: $1_$2.txt
	txt2tex $1 $2 txt
 endif

#Generic conversion of data files from m to dat format



$1_$2.dat: $1_$2.m

	m2dat $1_$2

#Generic conversion of data files from dat to (gplot) gdat format 
$1_$2.gdat: $1_$2.dat $1_args.m $1_struc.txt
	dat2gdat $1 $2 $4

#Generic conversion of Latex to latex document
mtt.sty:







|
>
>
>
|
>
|







1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981

ifeq ($REPTYPE,txt)
#Generic conversion of txt files to tex files
$1_$2.tex: $1_$2.txt
	txt2tex $1 $2 txt
 endif

#Conversion of dat2 files  to dat format
$1_odeso.dat: $1_odes.dat2
	echo Creating $1_odeso.dat
	dat22dat $1 odeso
$1_odes.dat: $1_odes.dat2
	echo Creating $1_odes.dat
	dat22dat $1 odes

#Generic conversion of data files from dat to (gplot) gdat format 
$1_$2.gdat: $1_$2.dat $1_args.m $1_struc.txt
	dat2gdat $1 $2 $4

#Generic conversion of Latex to latex document
mtt.sty:

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