Differences From Artifact [3f77bd1eca]:

To Artifact [d479e4b728]:


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.14  2000/12/28 12:16:13  peterg
## *** empty log message ***
##
## Revision 1.13  1998/07/27 20:30:12  peterg
## *** empty log message ***
##
## Revision 1.12  1998/07/10 08:43:46  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.15  2001/07/23 23:24:02  gawthrop
## Now only writes to type.sh and cbg.m when causality is complete
##
## Revision 1.14  2000/12/28 12:16:13  peterg
## *** empty log message ***
##
## Revision 1.13  1998/07/27 20:30:12  peterg
## *** empty log message ***
##
## Revision 1.12  1998/07/10 08:43:46  peterg
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162





163


164
165
166
167
168
169
170
171
172
173
mtt_header $1 type sh > $typefile

# Use matrix manipulation to accomplish the transformation
$MATRIX << EOF  >abg2cbg_m.log  #2>mtt_error.txt

  infofilenum  = fopen("$infofile",'w');
  errorfilenum = fopen("$errorfile",'w');
  typefilenum  = fopen("$typefile",'a');

  %Convert from acausal to causal bond graph in m-file form.
  system_name='$1';

  port_bonds = [];
  port_direction = [];
  port_status = [];
  [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ...
      $derivative,typefilenum, infofilenum, errorfilenum);






EOF



if [ "$info" = "info" ]; then
  cat $infofile
fi

# cp $1_$1_cbg.m $1_cbg.m 2>> mtt_error.txt 

# Print errors, if any.
mtt_error mtt_error.txt








|










>
>
>
>
>

>
>










148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
mtt_header $1 type sh > $typefile

# Use matrix manipulation to accomplish the transformation
$MATRIX << EOF  >abg2cbg_m.log  #2>mtt_error.txt

  infofilenum  = fopen("$infofile",'w');
  errorfilenum = fopen("$errorfile",'w');
  typefilenum  = fopen("$typefile",'w');

  %Convert from acausal to causal bond graph in m-file form.
  system_name='$1';

  port_bonds = [];
  port_direction = [];
  port_status = [];
  [cbonds,status] = abg2cbg(system_name, '', '', port_bonds, port_direction, port_status, ...
      $derivative,typefilenum, infofilenum, errorfilenum);

    ## close the files
    fclose(infofilenum);
    fclose(errorfilenum);
    fclose(typefilenum);

EOF



if [ "$info" = "info" ]; then
  cat $infofile
fi

# cp $1_$1_cbg.m $1_cbg.m 2>> mtt_error.txt 

# Print errors, if any.
mtt_error mtt_error.txt


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