Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.13 2000/11/09 17:19:52 peterg +## Geraint's pow() mods +## ## Revision 1.12 2000/11/09 16:09:46 peterg ## Declare dummy variables (mtt_s1 etc) ## ## Revision 1.11 2000/11/09 15:29:35 peterg ## lower-case declarations @@ -98,11 +101,19 @@ inputs=yes; parameters=yes; output=mtty args=$eqnargs ;; - input) + dm) + states=no; + inputs=no; + parameters=yes; + output='mtta,mttb,mttc,mttd,mtte' + args=mttpar + zeromatrices='a b c d e'; + ;; + input) states=yes; inputs=no; parameters=yes; output=mttu args=$inputeqnargs @@ -153,13 +164,14 @@ sm) states=no; inputs=no; parameters=yes; output='mtta,mttb,mttc,mttd' - args=mttpar + args=mttpar; + zeromatrices='a b c d'; ;; - smxa) + smxa) states=no; inputs=no; parameters=yes; output='mtta' args=$eqnargs @@ -239,13 +251,40 @@ if [ "$rep" = "simpar" ]; then output=${output}${map} # Output is simpar_map in this case fi +function zero_matrices(){ +## Set matrices to zero +echo +echo '## Set matrices to zero' +for name in $zeromatrices; do + case $name in + a) + N=$Nx; M=$Nx + ;; + b) + N=$Nx; M=$Nu + ;; + c) + N=$Ny; M=$Nx + ;; + d) + N=$Ny; M=$Nu + ;; + e) + N=$Nx; M=$Nx + ;; + *) + + esac + echo " mtt$name = zeros($N,$M);" +done +} function declare_dummies(){ # Get the dummies -dummies="mtt_s" +dummies="mtt_tmp" rm -f mtt_dummies for dummy in $dummies; do awk '{ if (match($1,dummy)==1) print $1 }' dummy=$dummy < ${fun_name}.m >> mtt_dummies @@ -324,10 +363,12 @@ fi if [ "$declaredummies" = "yes" ]; then declare_dummies fi + +zero_matrices; } # Argument specific stuff function get_arg_specific_stuff ()