Overview
Comment:Can now use c representations of crs when using -c option
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 810776c9bc660771799746dafa29920124ce3877bfc56d2eca52b742af89de69
User & Date: gawthrop@users.sourceforge.net on 2001-03-29 19:24:14
Other Links: branch diff | manifest | tags
Context
2001-03-30
15:13:58
Rationalised simulation modes to each return mtt_data check-in: e245176674 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-03-29
19:24:14
Can now use c representations of crs when using -c option check-in: 810776c9bc user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2001-03-28
01:50:40
Fix for ambiguous Matrix instantiation (Octave 2.0.16). check-in: ca18b01ca5 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [d6ad3f1271] to [a5eb38478d].

11
12
13
14
15
16
17




18
19
20
21
22
23
24
# Copyright (C) 2000 by Peter J. Gawthrop

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




## Revision 1.295  2001/03/23 11:21:29  gawthrop
## Show -pdf oprion in help list
##
## Revision 1.294  2001/03/19 02:28:52  geraint
## Branch merge: merging-ode2odes-exe back to MAIN.
##
## Revision 1.293.2.8  2001/03/19 01:35:31  geraint







>
>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.296  2001/03/27 01:07:34  geraint
## Improved determination of Octave version for ode2odes.exe creation.
## Removed FORCE check_update of .txts.
##
## Revision 1.295  2001/03/23 11:21:29  gawthrop
## Show -pdf oprion in help list
##
## Revision 1.294  2001/03/19 02:28:52  geraint
## Branch merge: merging-ode2odes-exe back to MAIN.
##
## Revision 1.293.2.8  2001/03/19 01:35:31  geraint
1377
1378
1379
1380
1381
1382
1383

1384
1385
1386
1387
1388
1389
1390
  rm -f *_ode.oct *_odeo.oct
  rm -f *_cseo.cc *_input.cc *_simpar.cc *_smxax.cc
  rm -f *_csex.cc *_numpar.cc *_smxa.cc *_state.cc 
  rm -f *_ode.cc *_odeo.cc
  rm -f *_logic.m *_logic.cc *_logic.oct
  rm -f *_state.m *_state.cc *_state.oct
  rm -f *_ode2odes.* *.dat2

  rm -fR *_rep MTT_work
  exit
fi

# Clean up named system
if [ "$2" = "Clean" ] && [ "$3" = "" ]; then
  echo 'Removing all generated files for system ' $1







>







1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
  rm -f *_ode.oct *_odeo.oct
  rm -f *_cseo.cc *_input.cc *_simpar.cc *_smxax.cc
  rm -f *_csex.cc *_numpar.cc *_smxa.cc *_state.cc 
  rm -f *_ode.cc *_odeo.cc
  rm -f *_logic.m *_logic.cc *_logic.oct
  rm -f *_state.m *_state.cc *_state.oct
  rm -f *_ode2odes.* *.dat2
  rm -f *_modpar.txt *_modpar.r
  rm -fR *_rep MTT_work
  exit
fi

# Clean up named system
if [ "$2" = "Clean" ] && [ "$3" = "" ]; then
  echo 'Removing all generated files for system ' $1
1411
1412
1413
1414
1415
1416
1417

1418
1419
1420
1421
1422
1423
1424
  rm -f $1_ode.oct $1_odeo.oct
  rm -f $1_cseo.cc $1_input.cc $1_simpar.cc $1_smxax.cc
  rm -f $1_csex.cc $1_numpar.cc $1_smxa.cc $1_state.cc 
  rm -f $1_ode.cc $1_odeo.cc
  rm -f $1_logic.m $1_logic.cc $1_logic.oct 
  rm -f $1_state.m $1_state.cc $1_state.oct
  rm -f $1_ode2odes.* $1.dat2

  rm -fR $1_rep MTT_work
  exit
fi

if [ "$2" = "rep" ]; then
     documenttype=article
      # See if we are making a book -- ie representation rep on a directory







>







1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
  rm -f $1_ode.oct $1_odeo.oct
  rm -f $1_cseo.cc $1_input.cc $1_simpar.cc $1_smxax.cc
  rm -f $1_csex.cc $1_numpar.cc $1_smxa.cc $1_state.cc 
  rm -f $1_ode.cc $1_odeo.cc
  rm -f $1_logic.m $1_logic.cc $1_logic.oct 
  rm -f $1_state.m $1_state.cc $1_state.oct
  rm -f $1_ode2odes.* $1.dat2
  rm -f $1_modpar.txt $1_modpar.r
  rm -fR $1_rep MTT_work
  exit
fi

if [ "$2" = "rep" ]; then
     documenttype=article
      # See if we are making a book -- ie representation rep on a directory
1919
1920
1921
1922
1923
1924
1925








1926
1927
1928
1929
1930
1931
1932

$1_lbl.tex: $1_lbl.txt
	lbl_txt2tex $1

#SUMMARY alias  name aliases for each subsystem (txt)
$1_alias.txt: $1_lbl.txt
	lbl2alias_txt2txt $1









#SUMMARY alias  name aliases for each subsystem (m)
$1_alias.m: $1_alias.txt
	alias_txt2m $1

#SUMMARY cr	constitutive relationship for each subsystem (txt)
$1_cr.txt: $1_abg.m $1_sub.sh







>
>
>
>
>
>
>
>







1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946

$1_lbl.tex: $1_lbl.txt
	lbl_txt2tex $1

#SUMMARY alias  name aliases for each subsystem (txt)
$1_alias.txt: $1_lbl.txt
	lbl2alias_txt2txt $1

#SUMMARY modpar  name modulated parameters for each subsystem (txt)
$1_modpar.txt: $1_lbl.txt
	lbl2modpar_txt $1

#SUMMARY modpar  name modulated parameters for each subsystem (r)
$1_modpar.r: $1_modpar.txt $1_struc.txt
	modpar_txt2r $1

#SUMMARY alias  name aliases for each subsystem (m)
$1_alias.m: $1_alias.txt
	alias_txt2m $1

#SUMMARY cr	constitutive relationship for each subsystem (txt)
$1_cr.txt: $1_abg.m $1_sub.sh
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299

2300
2301
2302
2303
2304
2305
2306
#SUMMARY dae	differential-algebraic equations (r)
#SUMMARY dae*	differential-algebraic equations (m)
#SUMMARY dae	differential-algebraic equations (tex)
#SUMMARY dae*	differential-algebraic equations (view)
#SUMMARY dae	differential-algebraic equations (ps)
#Differential-algebraic equations

${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r
ifneq ($partition,)
	echo Doing subsystems
	mtt_make_subsystems  ${sys} rdae r
endif

	ese2rdae_r ${Subsystem}; tidy ${Subsystem}_rdae.r

${sys}_dae.r: ${Subsystem}_rdae.r ${Subsystem}_def.r ${Subsystem}_subs.r ${Subsystem}_cr.r
ifneq ($partition,)
	echo Doing subsystems
	mtt_make_subsystems  ${sys} dae r
endif







|




>







2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
#SUMMARY dae	differential-algebraic equations (r)
#SUMMARY dae*	differential-algebraic equations (m)
#SUMMARY dae	differential-algebraic equations (tex)
#SUMMARY dae*	differential-algebraic equations (view)
#SUMMARY dae	differential-algebraic equations (ps)
#Differential-algebraic equations

${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r $1_modpar.r
ifneq ($partition,)
	echo Doing subsystems
	mtt_make_subsystems  ${sys} rdae r
endif
	mv $1_ese.r mtt_junk; cat $1_modpar.r mtt_junk > $1_ese.r # Add modulated parameters to start
	ese2rdae_r ${Subsystem}; tidy ${Subsystem}_rdae.r

${sys}_dae.r: ${Subsystem}_rdae.r ${Subsystem}_def.r ${Subsystem}_subs.r ${Subsystem}_cr.r
ifneq ($partition,)
	echo Doing subsystems
	mtt_make_subsystems  ${sys} dae r
endif
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
$1_odes.dat2: $1_ode2odes.m
	time octave_ode2odes $1
endif
endif

ifeq ($computation,c)
$1_ode2odes.out: $1_ode2odes.c
	echo Creating $1_odes.out
	$CC $1_ode2odes.c -lp2c -lm -o $1_ode2odes.out

$1_odes.dat2: $1_ode2odes.out
	echo Creating $1_odes.dat2 using c version
	    time ./$1_ode2odes.out>$1_odes.dat2
endif

ifeq ($computation,cc)







|
|







2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
$1_odes.dat2: $1_ode2odes.m
	time octave_ode2odes $1
endif
endif

ifeq ($computation,c)
$1_ode2odes.out: $1_ode2odes.c
	echo Creating $1_odes.out by compiling *.c 
	$CC *.c -lp2c -lm -o $1_ode2odes.out

$1_odes.dat2: $1_ode2odes.out
	echo Creating $1_odes.dat2 using c version
	    time ./$1_ode2odes.out>$1_odes.dat2
endif

ifeq ($computation,cc)

Modified mttroot/mtt/bin/trans/cbg2ese_m2r from [2644bc8431] to [93dc7c2cf2].

12
13
14
15
16
17
18




19
20
21
22
23
24
25

###############################################################
## Version control history
###############################################################
## $Id$
##
## $Log$




## Revision 1.27  2000/12/05 12:09:56  peterg
## Changed function name to name()
##
## Revision 1.26  2000/12/05 09:04:54  peterg
## *** empty log message ***
##
## Revision 1.25  2000/12/01 14:51:26  peterg







>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

###############################################################
## Version control history
###############################################################
## $Id$
##
## $Log$
## Revision 1.28  2001/02/05 17:19:52  gawthrop
## Now gives unique names to the states of multiports. Second name
## onwards labeled with port number
##
## Revision 1.27  2000/12/05 12:09:56  peterg
## Changed function name to name()
##
## Revision 1.26  2000/12/05 09:04:54  peterg
## *** empty log message ***
##
## Revision 1.25  2000/12/01 14:51:26  peterg
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
  cat $infofile
fi

if [ -z "$partition" ]; then
  ## Don't partition

  # Create the composite ese file
  cat $1_ese.r $1_*_ese.r  > $1_ese.tmp 2>> /dev/null

  mv $1_ese.tmp $1_ese.r

  # Zap the sub ese files
  rm -f $1_*_ese.r

  echo "END;" >> $1_ese.r







|







181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
  cat $infofile
fi

if [ -z "$partition" ]; then
  ## Don't partition

  # Create the composite ese file
  cat $1_ese.r $1_*_ese.r $1_modpar.r  > $1_ese.tmp 2>> /dev/null

  mv $1_ese.tmp $1_ese.r

  # Zap the sub ese files
  rm -f $1_*_ese.r

  echo "END;" >> $1_ese.r

Added mttroot/mtt/bin/trans/lbl2modpar_txt version [ccd703b3b8].













































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
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
37
38
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: lbl2modpar_txt2txt
# Creates the component modpares in text form

# Copyright (C) 2001 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $$Id$
## $Log$
###############################################################

# Inform user
echo Creating $1_modpar.txt

#Create the modpar file complete with headers.
echo "# Modpar file ($1_modpar.txt)" > $1_modpar.txt
echo "# Generated by MTT at `date`" >> $1_modpar.txt

#Write out the variables 
grep '[%|#]MODPAR' $1_lbl.txt |\
awk '{printf("%s\t%s\n", $2,$3)}' >> $1_modpar.txt

echo "# End of $1_modpar.txt" >> $1_modpar.txt








Modified mttroot/mtt/bin/trans/mtt_p2c from [c2dfb0f1c4] to [1df491847c].

12
13
14
15
16
17
18



19
20
21
22
23
24
25
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.9  2000/05/16 18:56:58  peterg
## Now realised that libp2c.a avoids many probs - so simplified it.
##
## Revision 1.8  2000/05/11 19:34:50  peterg
## *** empty log message ***
##
## Revision 1.7  1999/08/29 06:14:27  peterg







>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) P.J.Gawthrop 1998

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10  2000/09/15 09:01:41  peterg
## Updated internal comments
##
## Revision 1.9  2000/05/16 18:56:58  peterg
## Now realised that libp2c.a avoids many probs - so simplified it.
##
## Revision 1.8  2000/05/11 19:34:50  peterg
## *** empty log message ***
##
## Revision 1.7  1999/08/29 06:14:27  peterg
76
77
78
79
80
81
82

83
84
85
86
87
88
89

cat <<EOF  >$1_$2.c
/* C program  $1_$2.c */
/* Generated by MTT on $DATE */

/* Compile with gcc -lm -lp2c $1_$2.c -o $1_$2.out */
/* Note that p2c must be correctly installed so that p2c.h and libp2c.a are accessible */

EOF

#cat<<EOF >>$1_$2.c
#/* The following is the header file included here for completeness */
#EOF

#cat $MTTPATH/trans/c/p2c.h >> $1_$2.c







>







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

cat <<EOF  >$1_$2.c
/* C program  $1_$2.c */
/* Generated by MTT on $DATE */

/* Compile with gcc -lm -lp2c $1_$2.c -o $1_$2.out */
/* Note that p2c must be correctly installed so that p2c.h and libp2c.a are accessible */
#include "$1.h"
EOF

#cat<<EOF >>$1_$2.c
#/* The following is the header file included here for completeness */
#EOF

#cat $MTTPATH/trans/c/p2c.h >> $1_$2.c
101
102
103
104
105
106
107
108

cat mtt_junk.c |\
 grep -v PASCAL_MAIN >> $1_$2.c

if [ -n "$info" ]; then
    cat mtt_p2c.log
fi










|
>
105
106
107
108
109
110
111
112
113
cat mtt_junk.c |\
 grep -v PASCAL_MAIN >> $1_$2.c

if [ -n "$info" ]; then
    cat mtt_p2c.log
fi

# Remove the garbage
rm -f mtt_junk.c


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