9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
+
+
+
+
|
# Acausal bond graph to causal bond graph: mfile format
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2 1996/08/05 11:25:00 peter
## Removed bonds argument from abg2cbg.
## Removed call to $1_abg.
##
## 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):
|
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
|
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
-
+
+
-
+
-
-
-
+
-
-
+
-
-
-
-
+
|
# 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);
% THIS IS A NASTY BUG WORKROUND FOR OCTAVE
abg2cbg('RC','RC' ,'', [], infofile);
%Write the function m-file for the causal bond graph
filename = '$1_cbg.m';
c = '%';
port_bonds = [];
fprintf(filename, 'function [cbonds,status] = $1_cbg\n');
fprintf(filename, '%s [cbonds,status] = $1_cbg\n', c);
[cbonds,status] = abg2cbg(system_name, '', '', port_bonds,infofile);
fprintf(filename, '%s Causal bond graph created by MTT on %s \n\n', ...
c, date);
mat2mfile(cbonds, 'cbonds', filename);
mat2mfile(status, 'status', filename);
EOF
cat mtt_info.txt
cp $1_$1_cbg.m $1_cbg.m
|