Overview
Comment:New smxa and smxax reps
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a542fd304801eb9f9d14702c0c57048bcedb0fcc0e4671f1fa41e2ce4243cd7a
User & Date: gawthrop@users.sourceforge.net on 2000-04-07 19:10:24
Other Links: branch diff | manifest | tags
Context
2000-04-07
19:10:57
*** empty log message *** check-in: 82eb6c5f5a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
19:10:24
New smxa and smxax reps check-in: a542fd3048 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
19:10:01
Extra Nxx version check-in: 7021067391 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [e2bc57de18] to [e10ebb6c21].

1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16



17
18
19
20
21
22
23
#! /bin/sh

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

# Bourne shell script: mtt

# P.J.Gawthrop Oct 1989, Dec 1989, 1990, 1991, Oct 1993, Dec 1993, Jan 1994, Dec 95, Nov 1996.
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997,1998,1999


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



## Revision 1.235  2000/04/06 10:52:53  peterg
## Replace $PWD with `pwd` for sh compatibility
##
## Revision 1.234  2000/04/04 16:14:08  peterg
## Sorted mtt help
##
## Revision 1.233  2000/03/16 10:16:11  peterg










>






>
>
>







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
#! /bin/sh

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

# Bourne shell script: mtt

# P.J.Gawthrop Oct 1989, Dec 1989, 1990, 1991, Oct 1993, Dec 1993, Jan 1994, Dec 95, Nov 1996.
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997,1998,1999
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.236  2000/04/06 10:55:36  peterg
## Removed debug lines
##
## Revision 1.235  2000/04/06 10:52:53  peterg
## Replace $PWD with `pwd` for sh compatibility
##
## Revision 1.234  2000/04/04 16:14:08  peterg
## Sorted mtt help
##
## Revision 1.233  2000/03/16 10:16:11  peterg
1919
1920
1921
1922
1923
1924
1925

1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937

1938
1939




1940
1941
1942
1943
1944
1945
1946
$1_dae.c: $1_def.r $1_dae.r  $1_sympar.r
	dae_r2c $1; c_tidy $1_dae.c
$1_dae.tex:	$1_dae.r $1_simp.r
	dae_r2tex $1; latex_tidy $1_dae.tex

#SUMMARY cse	constrained-state equations (r)
#SUMMARY cse*	constrained-state equations (m)

#SUMMARY cse	constrained-state equations (tex)
#SUMMARY cse*	constrained-state equations (view)
#SUMMARY cse	constrained-state equations (ps)
#Constrained-state equations
$1_cse.r: $1_dae.r $1_def.r $1_sympar.r $1_subs.r 
	dae2cse_r $Solve $1; tidy $1_cse.r $1_subs.r

#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r  $1_subs.r 
#	cse_r2m $1; matlab_tidy $1_cse.m
$1_cse.m: $1_def.m $1_cse.r $1_sympars.txt
	mtt_r2m $1 cse;  matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; 


$1_cse.tex: $1_cse.r  $1_sympar.r $1_simp.r
	cse_r2tex $1; latex_tidy $1_cse.tex





#SUMMARY scse	sensitivity constrained-state equations (r)
#SUMMARY scse	sensitivity constrained-state equations (tex)
#SUMMARY scse	sensitivity constrained-state equations (ps)

$1_scse.r: $1_cse.r $1_def.r 
	cse2scse_r  $1 "$4"; tidy $1_scse.r







>











|
>


>
>
>
>







1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
$1_dae.c: $1_def.r $1_dae.r  $1_sympar.r
	dae_r2c $1; c_tidy $1_dae.c
$1_dae.tex:	$1_dae.r $1_simp.r
	dae_r2tex $1; latex_tidy $1_dae.tex

#SUMMARY cse	constrained-state equations (r)
#SUMMARY cse*	constrained-state equations (m)
#SUMMARY cse*	constrained-state equations (oct)
#SUMMARY cse	constrained-state equations (tex)
#SUMMARY cse*	constrained-state equations (view)
#SUMMARY cse	constrained-state equations (ps)
#Constrained-state equations
$1_cse.r: $1_dae.r $1_def.r $1_sympar.r $1_subs.r 
	dae2cse_r $Solve $1; tidy $1_cse.r $1_subs.r

#$1_cse.m: $1_def.r $1_cse.r $1_sympar.r  $1_subs.r 
#	cse_r2m $1; matlab_tidy $1_cse.m
$1_cse.m: $1_def.m $1_cse.r $1_sympars.txt
	mtt_r2m $1 cse;  matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; 
$1_cseo.m: $1_cse.m
	touch $1_cseo.m
$1_cse.tex: $1_cse.r  $1_sympar.r $1_simp.r
	cse_r2tex $1; latex_tidy $1_cse.tex

## Implicit oct rules
$1_%.oct: $1_def.r $1_%.p $1_sympars.txt
	mtt_p2oct $1 $2

#SUMMARY scse	sensitivity constrained-state equations (r)
#SUMMARY scse	sensitivity constrained-state equations (tex)
#SUMMARY scse	sensitivity constrained-state equations (ps)

$1_scse.r: $1_cse.r $1_def.r 
	cse2scse_r  $1 "$4"; tidy $1_scse.r
2031
2032
2033
2034
2035
2036
2037




2038
2039
2040
2041
2042
2043
2044
	mtt_m2p $1_odeo.m
$1_cse.p : $1_def.r $1_cse.m
	mtt_m2p $1_cse.m
$1_cseo.p : $1_def.r $1_cseo.m
	mtt_m2p $1_cseo.m
$1_smx.p : $1_def.r $1_smx.m
	mtt_m2p $1_smx.m




$1_switchopen.p : $1_def.r $1_switchopen.m
	mtt_m2p $1_switchopen.m

ifeq ($integration_method,implicit)
$1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smx.p\
		$1_simpar.p $1_numpar.p $1_state.p $1_input.p \
		$1_cse.p $1_cseo.p  $1_switchopen.p







>
>
>
>







2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
	mtt_m2p $1_odeo.m
$1_cse.p : $1_def.r $1_cse.m
	mtt_m2p $1_cse.m
$1_cseo.p : $1_def.r $1_cseo.m
	mtt_m2p $1_cseo.m
$1_smx.p : $1_def.r $1_smx.m
	mtt_m2p $1_smx.m
$1_smxa.p : $1_def.r $1_smxa.m
	mtt_m2p $1_smxa.m
$1_smxax.p : $1_def.r $1_smxax.m
	mtt_m2p $1_smxax.m
$1_switchopen.p : $1_def.r $1_switchopen.m
	mtt_m2p $1_switchopen.m

ifeq ($integration_method,implicit)
$1_ode2odes.p : $1_ode2odes.m $1_def.r $1_smx.p\
		$1_simpar.p $1_numpar.p $1_state.p $1_input.p \
		$1_cse.p $1_cseo.p  $1_switchopen.p
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
#SUMMARY smx	state matrices with variable state x (m)
#SUMMARY smxx	Sparse computation of Ax (m)
#SUMMARY smxtx	Sparse computation of ATx (m)
$1_smx.r: $1_def.r $1_def.m $1_ode.r $1_subs.r
		ode2smx_lang $1 r; tidy $1_smx.r
$1_smx.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r
		cse2smx_lang $1 m;
$1_smxx.m: $1_smx.m
		touch $1_smxx.m
$1_smxtx.m: $1_smx.m
		touch $1_smxtx.m

#SUMMARY smc	controller form state matrices etc. - siso only (r)
#SUMMARY smc	controller form state matrices etc. - siso only (tex)
#SUMMARY smc*	controller form state matrices etc. - siso only (m)
#SUMMARY smc*	controller form state matrices etc. - siso only (view)
#SUMMARY smc	controller form state matrices etc. - siso only (ps)
#Linearised system: controller form state matrices etc.







|
|
|
|







2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
#SUMMARY smx	state matrices with variable state x (m)
#SUMMARY smxx	Sparse computation of Ax (m)
#SUMMARY smxtx	Sparse computation of ATx (m)
$1_smx.r: $1_def.r $1_def.m $1_ode.r $1_subs.r
		ode2smx_lang $1 r; tidy $1_smx.r
$1_smx.m: $1_def.r $1_def.m $1_cse.r $1_sympars.txt $1_subs.r
		cse2smx_lang $1 m;
$1_smxa.m: $1_smx.m
		touch $1_smxa.m
$1_smxax.m: $1_smx.m
		touch $1_smxax.m

#SUMMARY smc	controller form state matrices etc. - siso only (r)
#SUMMARY smc	controller form state matrices etc. - siso only (tex)
#SUMMARY smc*	controller form state matrices etc. - siso only (m)
#SUMMARY smc*	controller form state matrices etc. - siso only (view)
#SUMMARY smc	controller form state matrices etc. - siso only (ps)
#Linearised system: controller form state matrices etc.

Modified mttroot/mtt/bin/trans/mtt_m2p from [a16cb755ff] to [d349c65c30].

11
12
13
14
15
16
17



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

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



## Revision 1.38  2000/04/07 13:24:41  peterg
## Modified for smxa and smxax
##
## Revision 1.37  2000/04/07 08:17:37  peterg
## Added mttpar to the arg list of cse and cseo
##
## Revision 1.36  1999/11/29 06:49:26  peterg







>
>
>







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.39  2000/04/07 13:38:13  peterg
## New mtt_getsize to replace bc
##
## Revision 1.38  2000/04/07 13:24:41  peterg
## Modified for smxa and smxax
##
## Revision 1.37  2000/04/07 08:17:37  peterg
## Added mttpar to the arg list of cse and cseo
##
## Revision 1.36  1999/11/29 06:49:26  peterg
383
384
385
386
387
388
389

390






391
392
393
394
395
396
397
          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])
          printf("\n")

          printf("\nBEGIN{%s}\n", Sys_rep)






       }
        doing_header = 0;
      }
      if (match($1,comment_regexp)>0){
        if (doing_header==1)
          comment[++j] = $0
        else







>

>
>
>
>
>
>







386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
          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])
          printf("\n")
          printf("VAR mmtti : INTEGER;");
          printf("\nBEGIN{%s}\n", Sys_rep)
          if (rep=="smxa"){
            printf("FOR mmtti:= 1 to %i DO\n\tmtta[mmtti] := 0;\n", Nx*Nx);
          }
          if (rep=="smxax"){
            printf("FOR mmtti:= 1 to %i DO\n\tmttax[mmtti] := 0;\n", Nx);
          }
       }
        doing_header = 0;
      }
      if (match($1,comment_regexp)>0){
        if (doing_header==1)
          comment[++j] = $0
        else

Modified mttroot/mtt/bin/trans/mtt_p2C from [af8e9bf1d7] to [c99f6d9453].

17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
begin="BEGIN{$sys_rep}"

# Inform user
echo "Creating $1_$2.pas"

# Find system constants
Nx=`mtt_getsize $1 x`

Nu=`mtt_getsize $1 u`
Ny=`mtt_getsize $1 y`

Npar=`wc -l $1_sympar.txt | awk '{print $1}'`


echo "PROCEDURE $1_$2;" > $1_$2.pas
echo "TYPE"             >>$1_$2.pas
echo "    StateVector  = ARRAY[1..$Nx] OF REAL;"        >>$1_$2.pas
echo "    StateMatrix  = ARRAY[1..$Nx,1..$Nx] OF REAL;" >>$1_$2.pas

echo "    InputVector  = ARRAY[1..$Nu] OF REAL;"        >>$1_$2.pas
echo "    OutputVector  = ARRAY[1..$Ny] OF REAL;"       >>$1_$2.pas
echo "    ParameterVector  = ARRAY[1..$Npar] OF REAL;"  >>$1_$2.pas


# Create the predefined vars
echo "VAR"     >>$1_$2.pas







>










>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
begin="BEGIN{$sys_rep}"

# Inform user
echo "Creating $1_$2.pas"

# Find system constants
Nx=`mtt_getsize $1 x`
Nxx=`mtt_getsize $1 xx`
Nu=`mtt_getsize $1 u`
Ny=`mtt_getsize $1 y`

Npar=`wc -l $1_sympar.txt | awk '{print $1}'`


echo "PROCEDURE $1_$2;" > $1_$2.pas
echo "TYPE"             >>$1_$2.pas
echo "    StateVector  = ARRAY[1..$Nx] OF REAL;"        >>$1_$2.pas
echo "    StateMatrix  = ARRAY[1..$Nx,1..$Nx] OF REAL;" >>$1_$2.pas
echo "    StateMatrixVector  = ARRAY[1..$Nxx] OF REAL;" >>$1_$2.pas
echo "    InputVector  = ARRAY[1..$Nu] OF REAL;"        >>$1_$2.pas
echo "    OutputVector  = ARRAY[1..$Ny] OF REAL;"       >>$1_$2.pas
echo "    ParameterVector  = ARRAY[1..$Npar] OF REAL;"  >>$1_$2.pas


# Create the predefined vars
echo "VAR"     >>$1_$2.pas

Modified mttroot/mtt/bin/trans/mtt_p2cc from [508c370e50] to [4b2506166d].

98
99
100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
#}' <$1_input.C |\
#sed 's/\[\([0-9]*\)\]/(\1)/g' >> $1_$2.cc

#Extract the rep code and  converting [] to () and deleting mtt variables etc
echo "/* Representation $2 information */" >> $1_$2.cc
awk '{
  if ($1=="}") writing=0;
  if ( (writing)&&(match($2,"mtt")==0) ) print $0;
  if (match($1,"{")==1) writing=1;
}' <$1_$2.C |\
sed 's/\[\([0-9]*\)\]/(\1)/g' >> $1_$2.cc


# Tail
cat >> $1_$2.cc <<EOF

EOF

case "$2" in







|


|
>







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#}' <$1_input.C |\
#sed 's/\[\([0-9]*\)\]/(\1)/g' >> $1_$2.cc

#Extract the rep code and  converting [] to () and deleting mtt variables etc
echo "/* Representation $2 information */" >> $1_$2.cc
awk '{
  if ($1=="}") writing=0;
  if ( (writing)&&(match($2,"mtt")!=1) ) print $0;
  if (match($1,"{")==1) writing=1;
}' <$1_$2.C |\
sed 's/\[\([0-9]*\)\]/(\1)/g' |\
sed 's/\[\(mmtti\)\]/(\1)/g' >> $1_$2.cc

# Tail
cat >> $1_$2.cc <<EOF

EOF

case "$2" in


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