File mttroot/mtt/bin/trans/struc2sspar_txt2r artifact 81e9931607 part of check-in be739f082c


#! /bin/sh

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

# Bourne shell script: struc2sspar_txt2txt
# Creates the deafault numerical parameters file for the system (txt)

# Copyright (c) P.J.Gawthrop 1998


# Inform user
echo Creating $1_sspar.r


#Write out the default ss values (0)
#Create the sspar file complete with headers.
echo "% Steady-state parameter file ($1_sspar.r)" > $1_sspar.r
echo "% Generated by MTT at `date`" >> $1_sspar.r
cat $MTTPATH/trans/rcs_header.m  >> $1_sspar.r

echo  >> $1_sspar.r

echo "% Steady-state states" >> $1_sspar.r
gawk '{
  if ($1=="state") 
    print "MTTX" $2 " := \t0; % " $4 " (" $3 ")"
}' \
 $1_struc.txt >> $1_sspar.r


echo "% Steady-state inputs" >> $1_sspar.r
gawk '{
  if ($1=="input") 
    print "MTTU" $2 " := \t0; % " $4 " (" $3 ")"
}' \
 $1_struc.txt >> $1_sspar.r


echo ";;END;" >> $1_sspar.r




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