Overview
Comment:Added -ss option
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: a43f4952d23b207b669a1824a007614eebac258b2b8895996c67b3bbc73731c8
User & Date: gawthrop@users.sourceforge.net on 1998-08-10 14:23:58
Other Links: branch diff | manifest | tags
Context
1998-08-10
14:29:05
Removed -s (switches) stuff check-in: 75312bdbbd user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:23:58
Added -ss option check-in: a43f4952d2 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:57:33
Removed debugging lines check-in: de052a8ff6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/struc2input_txt2txt from [b3aca80cc4] to [04d1f02f2b].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26







+
+
+







# Copyright (c) P.J.Gawthrop 1997

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10  1998/07/27 11:10:38  peterg
## Put in octave-mode line for Emacs
##
## Revision 1.9  1998/07/25 20:10:37  peterg
## lower case mttu
##
## Revision 1.8  1998/07/25 09:42:09  peterg
## Just sets finrst input to 1 - rest to zero
##
## Revision 1.7  1998/07/25 08:05:41  peterg
47
48
49
50
51
52
53


54
55
56
57
58
59
60
61
62
63
64
65
66
67

68



69
70
71
72
73
74
75








76
77
78
79
80






81
82
83



84
85

86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
103
104
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64


65
66
67
68
69
70
71
72
73
74
75







76
77
78
79
80
81
82
83





84
85
86
87
88
89



90
91
92
93

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114







+
+






-
-






+

+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+

-
+









+










# By default, don't look for BG switches

switches=no
while [ -n "`echo $1 | grep '-'`" ]; do
  case $1 in
	-s )
		switches=yes ;;
	-ss )
		steadystate_computation=yes ;;
	*)
		echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done

# Inform user
echo Creating $1_input.txt

#Create the input file complete with headers.
echo '# -*-octave-*- Put Emacs into octave-mode' > $1_input.txt
echo "# Numerical parameter file ($1_input.txt)" >> $1_input.txt
echo "# Generated by MTT at `date`" >> $1_input.txt
cat $MTTPATH/trans/rcs_header.sh  >> $1_input.txt
echo "# Set the inputs"  >> $1_input.txt

if [ -n "$steadystate_computation" ]; then 
# Compute inputs from ss.r file
# Inform user
#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;
echo Creating $1_input.txt - compute from steady-state information

cat $1_ss.r  $1_struc.txt | sed 's/\$//' |\
awk '{
  if(match($1,"MTTu")>0) {
    j++
    split($0,a,"=");
    u[j]=a[2];
#  }
#    
#  if($1=="input") {
#    i++; 
#    print  "u(" i ") =\t", u[i], "+ 1.0; \# " $4 " (" $3 ")"
  }
    
  if($1=="input") {
    i++; 
    if (length(u[i])==0) u[i]="0.0;";
    print  "u(" i ") =\t", u[i], " \# " $4 " (" $3 ")"
#  }
#}'  >> $1_input.txt

  }
}'  >> $1_input.txt
else
#Write out the defaults -- unit inputs
echo "# Set the inputs"  >> $1_input.txt
echo Creating $1_input.txt - defaults

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)
  }
}' Nu=$Nu  <$1_struc.txt >> $1_input.txt
fi

#Set some switches
if [ "$switches" = "yes" ]; then
  echo  >> $1_input.txt
  echo "# Set the switches"  >> $1_input.txt
  awk '{print  tolower($1) "= (t>=0);"}'< $1_switch.txt   >> $1_input.txt
fi




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