1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1 1996/08/05 12:22:16 peter
## Initial revision
##
###############################################################
# Raw bond graph to structured acausal bond graph: mfile format
# The structured BG is described by four matrices:
|
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2 1996/08/24 14:33:07 peter
## Error handling included.
##
## Revision 1.1 1996/08/05 12:22:16 peter
## Initial revision
##
###############################################################
# Raw bond graph to structured acausal bond graph: mfile format
# The structured BG is described by four matrices:
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
rm -f rbg2abg_m.log
rm -f $1_abg.m
#Inform user
echo Creating $1_abg.m
# Use matrix manipulation to accomplish the transformation
$MATRIX > rbg2abg_m.log 2>mtt_err << EOF
infofile = 'mtt_info.txt';
%Convert from the fig version of the bonds to a structured version
[rbonds,rstrokes,rcomponents,rports,n_ports] = $1_rbg;
[bonds,components] = rbg2abg(rbonds,rstrokes,rcomponents,rports,infofile);
%Write the function m-file for the causal bond graph
|
|
|
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
rm -f rbg2abg_m.log
rm -f $1_abg.m
#Inform user
echo Creating $1_abg.m
# Use matrix manipulation to accomplish the transformation
$MATRIX > rbg2abg_m.log 2>mtt_error << EOF
infofile = 'mtt_info.txt';
%Convert from the fig version of the bonds to a structured version
[rbonds,rstrokes,rcomponents,rports,n_ports] = $1_rbg;
[bonds,components] = rbg2abg(rbonds,rstrokes,rcomponents,rports,infofile);
%Write the function m-file for the causal bond graph
|