Differences From Artifact [32e6945c14]:

To Artifact [06b7d781ea]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15



16
17
18
19
20
21
22
#! /bin/sh

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

# Bourne shell script: abg2cbg_m
#
# Acausal bond graph to causal bond graph: mfile format

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$



###############################################################

# The causal BG is described by four matrices
# (the same structure as the acausal BG except that Causality is 1 ot -1):
#   junctions: describes the junctions -
#     Column 1   Index of component (see components)
#     Column 2.. Indices of bonds on junction (see jbonds)













|

>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /bin/sh

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

# Bourne shell script: abg2cbg_m
#
# Acausal bond graph to causal bond graph: mfile format

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  1996/08/04 17:45:11  peter
## Initial revision
##
###############################################################

# The causal BG is described by four matrices
# (the same structure as the acausal BG except that Causality is 1 ot -1):
#   junctions: describes the junctions -
#     Column 1   Index of component (see components)
#     Column 2.. Indices of bonds on junction (see jbonds)
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

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

  infofile= '$infofile';

  %Convert from acausal to causal bond graph in m-file form.
  [bonds,components] = $1_abg;
  system_name = '$1';

  [cbonds,status] = abg2cbg(system_name,bonds,infofile);


  %Write the function m-file for the causal bond graph
  filename = '$1_cbg.m';
  c = '%';
  fprintf(filename, 'function [cbonds,status] = $1_cbg\n');
  fprintf(filename, '%s [cbonds,status] = $1_cbg\n', c);







<

<
|







84
85
86
87
88
89
90

91

92
93
94
95
96
97
98
99

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

  infofile= '$infofile';

  %Convert from acausal to causal bond graph in m-file form.

  system_name = '$1';

  [cbonds,status] = abg2cbg(system_name,infofile);


  %Write the function m-file for the causal bond graph
  filename = '$1_cbg.m';
  c = '%';
  fprintf(filename, 'function [cbonds,status] = $1_cbg\n');
  fprintf(filename, '%s [cbonds,status] = $1_cbg\n', c);

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