Differences From Artifact [ca9a1d761d]:

To Artifact [f9d0cf4b05]:


9
10
11
12
13
14
15



16
17
18
19
20
21
22
# Acausal bond graph to causal bond graph: mfile format

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



## Revision 1.9  1999/11/10 00:47:08  peterg
## Replaced ifs by a table of cr/arg information
##
## Revision 1.8  1999/11/09 22:32:41  peterg
## Under RCS ready for using arrays to contaain defaults.
##
## Revision 1.7  1998/07/04 10:37:21  peterg







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Acausal bond graph to causal bond graph: mfile format

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10  2000/01/26 10:11:10  peterg
## Added I component
##
## Revision 1.9  1999/11/10 00:47:08  peterg
## Replaced ifs by a table of cr/arg information
##
## Revision 1.8  1999/11/09 22:32:41  peterg
## Under RCS ready for using arrays to contaain defaults.
##
## Revision 1.7  1998/07/04 10:37:21  peterg
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135




136
137



138
139
140
141
142
143
144
#echo 'Non-unique names (if any):'
#diff $1_unique_raw_list  $1_raw_list | grep '>' | sed 's/>/	/'

#Write out the outline lbl file
grep -v  '\[[0-9]*\]'  $1_unique_raw_list | \
awk --field-separator ':' '
 BEGIN {

 }
 { 
  Component = $1;
  ##Aliases
  if (Component == "SS") {
    port_alias[++j] = $2;
  }
  else {
    alias[++i] = $2;
    if (length(sensitivity)>0) {
      s_arg = sprintf("%ss",$2);
      alias[++i] = s_arg;
      s_arg = sprintf(";%s",s_arg);
      Component = substr(Component,2);
    }
 }



    ## Table of components
    cr["SS"] = "SS";  arg["SS"] = "external,external";

    cr["Se"] = "SS";  arg["Se"] = "external";
    cr["Sf"] = "SS";  arg["Sf"] = "external";

    cr["De"] = "SS";  arg["De"] = "external";
    cr["Df"] = "SS";  arg["Df"] = "external";

    cr["R"] = "lin";  arg["R"]  = sprintf("flow,%s%s", $2, s_arg);
    cr["C"] = "lin";  arg["C"]  = sprintf("effort,%s%s", $2, s_arg);
    cr["I"] = "lin";  arg["I"]  = sprintf("flow,%s%s", $2, s_arg);




    cr["TF"] = "lin";  arg["TF"]  = sprintf("flow,%s%s", $2, s_arg);
    cr["GY"] = "lin";  arg["GY"]  = sprintf("flow,%s%s", $2, s_arg);




  ## Heading
  if (Component !~ OldComponent) print "\n% Component type", Component

  ## Component
    print  "\t" $2 "\t" cr[Component] "\t\t" arg[Component];
    OldComponent=Component;







>

















<
<



|
|







>
>
>
>


>
>
>







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#echo 'Non-unique names (if any):'
#diff $1_unique_raw_list  $1_raw_list | grep '>' | sed 's/>/	/'

#Write out the outline lbl file
grep -v  '\[[0-9]*\]'  $1_unique_raw_list | \
awk --field-separator ':' '
 BEGIN {
    OldComponent="None";
 }
 { 
  Component = $1;
  ##Aliases
  if (Component == "SS") {
    port_alias[++j] = $2;
  }
  else {
    alias[++i] = $2;
    if (length(sensitivity)>0) {
      s_arg = sprintf("%ss",$2);
      alias[++i] = s_arg;
      s_arg = sprintf(";%s",s_arg);
      Component = substr(Component,2);
    }
 }



    ## Table of components
    cr["SS"] = "SS";  arg["SS"] = "external,external";

    cr["Se"] = "SS";  arg["Se"] = sprintf("external%s", s_arg);
    cr["Sf"] = "SS";  arg["Sf"] = sprintf("external%s", s_arg);

    cr["De"] = "SS";  arg["De"] = "external";
    cr["Df"] = "SS";  arg["Df"] = "external";

    cr["R"] = "lin";  arg["R"]  = sprintf("flow,%s%s", $2, s_arg);
    cr["C"] = "lin";  arg["C"]  = sprintf("effort,%s%s", $2, s_arg);
    cr["I"] = "lin";  arg["I"]  = sprintf("flow,%s%s", $2, s_arg);

    cr["CS"] = "lin";  arg["CS"]  = sprintf("effort,%s;x_0%s", $2, s_arg);
    cr["IS"] = "lin";  arg["IS"]  = sprintf("flow,%s;x_0%s", $2, s_arg);

    cr["TF"] = "lin";  arg["TF"]  = sprintf("flow,%s%s", $2, s_arg);
    cr["GY"] = "lin";  arg["GY"]  = sprintf("flow,%s%s", $2, s_arg);

    cr["AE"] = "lin";  arg["AE"]  = sprintf("%s%s", $2, s_arg);
    cr["AF"] = "lin";  arg["AF"]  = sprintf("%s%s", $2, s_arg);

  ## Heading
  if (Component !~ OldComponent) print "\n% Component type", Component

  ## Component
    print  "\t" $2 "\t" cr[Component] "\t\t" arg[Component];
    OldComponent=Component;

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