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.6 1998/02/24 10:14:56 peterg +## Now defaults to the steady-state values +## ## Revision 1.5 1998/02/04 12:26:47 peterg ## Simplified output format ## ## Revision 1.4 1998/02/04 11:45:05 peterg ## Less verbose comments. @@ -49,27 +52,33 @@ echo Creating $1_input.txt #Create the input file complete with headers. echo "# Numerical parameter file ($1_input.txt)" > $1_input.txt echo "# Generated by MTT at `date`" >> $1_input.txt -cat $MTTPATH/trans/rcs_header.txt >> $1_input.txt +cat $MTTPATH/trans/rcs_header.sh >> $1_input.txt #Write out the defaults -- inputs to steady-state values - echo "# Set the inputs" >> $1_input.txt -cat $1_ss.r $1_struc.txt | sed 's/\$//' |\ -awk '{ - if(match($1,"MTTu")) { - j++ - u[j]=$3; - } - - if($1=="input") { - i++; - print "u(" i ") =\t", u[i], "; \# " $4 " (" $3 ")" - } -}' >> $1_input.txt - +#echo "# Set the inputs" >> $1_input.txt +#cat $1_ss.r $1_struc.txt | sed 's/\$//' |\ +#awk '{ +# if(match($1,"MTTu")) { +# j++ +# u[j]=$3; +# } +# +# if($1=="input") { +# i++; +# print "u(" i ") =\t", u[i], "+ 1.0; \# " $4 " (" $3 ")" +# } +#}' >> $1_input.txt + +#Write out the defaults -- unit inputs +echo "# Set the inputs" >> $1_input.txt + +awk '{ + if ($1=="input") printf("MTTu%s = 1.0; \t\# %s (%s)\n", $2,$3,$4) +}' Nu=$Nu <$1_struc.txt >> $1_input.txt #Set some switches if [ "$switches" = "yes" ]; then echo >> $1_input.txt echo "# Set the switches" >> $1_input.txt