Index: mttroot/mtt/bin/trans/struc2input_txt2txt ================================================================== --- mttroot/mtt/bin/trans/struc2input_txt2txt +++ mttroot/mtt/bin/trans/struc2input_txt2txt @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.13 2000/03/03 11:33:19 peterg +## *** empty log message *** +## ## Revision 1.12 1998/08/10 14:29:05 peterg ## Removed -s (switches) stuff ## ## Revision 1.11 1998/08/10 14:23:58 peterg ## Added -ss option @@ -63,10 +66,12 @@ echo "$1 is an invalid argument - ignoring" ;; esac shift done +# Default input +default='1.0' #Create the input file complete with headers. echo '# -*-octave-*- Put Emacs into octave-mode' > $1_input.txt echo "# Input specification ($1_input.txt)" >> $1_input.txt echo "# Generated by MTT at `date`" >> $1_input.txt @@ -87,30 +92,28 @@ } if($1=="input") { i++; if (length(u[i])==0) u[i]="0.0;"; - print "u(" i ") =\t", u[i], " \# " $4 " (" $3 ")" + # print "u(" i ") =\t", u[i], " \# " $4 " (" $3 ")" + printf("%s =\t%s # MTT initial value from steady state\n", $4, u[i]); } }' >> $1_input.txt else #Write out the defaults -- unit inputs -echo Creating $1_input.txt - defaults +echo Creating $1_input.txt - default to $default awk '{ if ($1=="input") { - if ($2==1) - printf("mttu(%s) = 1.0; \t\# %s (%s)\n", $2,$3,$4) - else - printf("mttu(%s) = 0.0; \t\# %s (%s)\n", $2,$3,$4) + printf("%s = \t%s; # MTT initial value\n", $4, default) } -}' Nu=$Nu <$1_struc.txt >> $1_input.txt +}' Nu=$Nu default=$default <$1_struc.txt >> $1_input.txt fi #Set some switches - echo >> $1_input.txt - echo "# Set the switches" >> $1_input.txt - strip_comments<$1_switch.txt |\ - awk '{if (length($1)>0) print tolower($1) "= (t>=0);"}' >> $1_input.txt +# echo >> $1_input.txt +# echo "# Set the switches" >> $1_input.txt +# strip_comments<$1_switch.txt |\ +# awk '{if (length($1)>0) print tolower($1) "= (t>=0);"}' >> $1_input.txt