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.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):
|
>
>
>
>
|
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
|
# 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);
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
|
<
>
>
|
<
<
|
<
|
<
<
<
<
>
|
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';
% THIS IS A NASTY BUG WORKROUND FOR OCTAVE
abg2cbg('RC','RC' ,'', [], infofile);
port_bonds = [];
[cbonds,status] = abg2cbg(system_name, '', '', port_bonds,infofile);
EOF
cat mtt_info.txt
cp $1_$1_cbg.m $1_cbg.m
|