Overview
Comment:Added option of computing from ss values
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: f542bb2aead19d919f1ebe673d8e3f07fb3675a9e42076d176de8f9d6d615b27
User & Date: gawthrop@users.sourceforge.net on 1998-08-10 13:55:11
Other Links: branch diff | manifest | tags
Context
1998-08-10
13:57:33
Removed debugging lines check-in: de052a8ff6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:55:11
Added option of computing from ss values check-in: f542bb2aea user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:29:48
Added missing ports. check-in: 09c7a99d9b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/struc2state_txt2txt from [5828a5ecd3] to [134d12a4ea].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47






48
49
50
51

52
53

54
55
56
57
58

59




60
61
62
63
64





# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$



# %% Revision 1.5  1998/07/25 20:10:01  peterg
# %% Lower case mttx
# %%
# %% Revision 1.4  1998/07/25 09:42:37  peterg
# %% Now writes out an array
# %%
# %% Revision 1.3  1998/07/25 08:11:35  peterg
# %% No longer used the SS method - just sets zero states
# %%
# %% Revision 1.2  1998/07/21 16:54:15  peterg
# %% Changed erroneous header
# %%
# %% Revision 1.1  1998/06/27 15:06:40  peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



# Inform user
echo Creating $1_state.txt

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

#Write out the defaults -- states to steady-state values
echo "# Set the states"  >> $1_state.txt






#cat $1_ss.r  $1_struc.txt | sed 's/\$//' |\
#awk '{
#  if(match($1,"MTTx")) {
#    j++

#    x[j]=$3 $4 $5 $6 $7 $8 $9;
#  }

#    
#  if($1=="state") {
#    i++; 
#    print  "x(" i ") =\t", x[i], "; \# " $4 " (" $3 ")"
#  }

#}'  >> $1_state.txt





awk '{
  if ($1=="state") printf("mttx(%s) \t= 0.0; \t\# %s (%s)\n", $2,$3,$4)
}' <$1_struc.txt >> $1_state.txt











>
>
>



















|
|









>
>
>
>
>
>
|
|
|
|
>
|
<
>
|
|
|
|
<
>
|
>
>
>
>




|
>
>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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


# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.6  1998/07/27 20:32:11  peterg
# %% Octave mode forced
# %%
# %% Revision 1.5  1998/07/25 20:10:01  peterg
# %% Lower case mttx
# %%
# %% Revision 1.4  1998/07/25 09:42:37  peterg
# %% Now writes out an array
# %%
# %% Revision 1.3  1998/07/25 08:11:35  peterg
# %% No longer used the SS method - just sets zero states
# %%
# %% Revision 1.2  1998/07/21 16:54:15  peterg
# %% Changed erroneous header
# %%
# %% Revision 1.1  1998/06/27 15:06:40  peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



# Switches
steadystate_computation="$2"

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

#Write out the defaults -- states to steady-state values
echo "# Set the states"  >> $1_state.txt

if [ -n "$steadystate_computation" ]; then 
# Compute state from ss.r file
# Inform user
echo Creating $1_state.txt - compute from steady-state information

cat $1_ss.r  $1_struc.txt | sed 's/\$//' |\
awk '{
  if(match($1,"MTTx")>0) {
    j++
    split($0,a,"="); print j,$0,a[2]
    x[j]=a[2];

  }
    
  if($1=="state") {
    i++; 
    print  "x(" i ") =\t", x[i], " \# " $4 " (" $3 ")"

  }
}'  >> $1_state.txt
else
# Set states to zero
# Inform user
echo Creating $1_state.txt - default states to zero

awk '{
  if ($1=="state") printf("mttx(%s) \t= 0.0; \t\# %s (%s)\n", $2,$3,$4)
}' <$1_struc.txt >> $1_state.txt
    
fi



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