Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -6,16 +6,20 @@ # 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 @@ -1921,10 +1925,11 @@ $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 @@ -1932,13 +1937,18 @@ #$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) @@ -2033,10 +2043,14 @@ 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\ @@ -2170,14 +2184,14 @@ #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 +$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) Index: mttroot/mtt/bin/trans/mtt_m2p ================================================================== --- mttroot/mtt/bin/trans/mtt_m2p +++ mttroot/mtt/bin/trans/mtt_m2p @@ -13,10 +13,13 @@ ############################################################### ## 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 @@ -385,11 +388,18 @@ 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) Index: mttroot/mtt/bin/trans/mtt_p2C ================================================================== --- mttroot/mtt/bin/trans/mtt_p2C +++ mttroot/mtt/bin/trans/mtt_p2C @@ -19,10 +19,11 @@ # 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}'` @@ -29,10 +30,11 @@ 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 Index: mttroot/mtt/bin/trans/mtt_p2cc ================================================================== --- mttroot/mtt/bin/trans/mtt_p2cc +++ mttroot/mtt/bin/trans/mtt_p2cc @@ -100,14 +100,15 @@ #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 ( (writing)&&(match($2,"mtt")!=1) ) print $0; if (match($1,"{")==1) writing=1; }' <$1_$2.C |\ -sed 's/\[\([0-9]*\)\]/(\1)/g' >> $1_$2.cc +sed 's/\[\([0-9]*\)\]/(\1)/g' |\ +sed 's/\[\(mmtti\)\]/(\1)/g' >> $1_$2.cc # Tail cat >> $1_$2.cc <