Overview
Comment:Added a few deguging lines
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: d6adab3bc0b9f0abfa0e84366f137c7a647eb8d4b8411509bf19a7e6005182e7
User & Date: gawthrop@users.sourceforge.net on 1996-08-09 08:27:29
Other Links: branch diff | manifest | tags
Context
1996-08-09
08:29:04
Initial revision check-in: 939ff1e667 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
08:27:29
Added a few deguging lines check-in: d6adab3bc0 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
08:26:35
Cosmetic tidy up. check-in: e41e804685 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/abg2cbg.m from [e85e3a42b3] to [86c7f41797].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
% Acausal bond graph to causal bond graph: mfile format

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$



% %% Revision 1.4  1996/08/08 08:30:06  peter
% %% The cbg filename contains the system name - this makes things easier
% %% when setting up the m to fig translation and m to ese translation
% %%
% %% Revision 1.3  1996/08/05 18:53:21  peter
% %% Fixed bug passing causality from subsystems.
% %%







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% Acausal bond graph to causal bond graph: mfile format

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.5  1996/08/08 18:06:18  peter
% %% Unified file naming scheme
% %%
% %% Revision 1.4  1996/08/08 08:30:06  peter
% %% The cbg filename contains the system name - this makes things easier
% %% when setting up the m to fig translation and m to ese translation
% %%
% %% Revision 1.3  1996/08/05 18:53:21  peter
% %% Fixed bug passing causality from subsystems.
% %%
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
  end;
end;

% Set initial status
status = -ones(n_components,1);
total = 2*n_bonds;
done = sum(sum(abs(bonds)))/total*100;
% $$$ mtt_info(sprintf('Initial causality is %3.0f%s complete.', done, pc), infofile);

% Set the causality of the ports
old_done = inf;

while done~=old_done
  disp(sprintf('Causality is %3.0f%s complete.', done, pc));
  old_done = done;
  
  for i = 1:n_components







<

<







94
95
96
97
98
99
100

101

102
103
104
105
106
107
108
  end;
end;

% Set initial status
status = -ones(n_components,1);
total = 2*n_bonds;
done = sum(sum(abs(bonds)))/total*100;



old_done = inf;

while done~=old_done
  disp(sprintf('Causality is %3.0f%s complete.', done, pc));
  old_done = done;
  
  for i = 1:n_components
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132


133

134
135
136
137
138
139
140
    if strcmp(comp_type,'0')
      comp_type = 'zero';
    end;
    if strcmp(comp_type,'1')
      comp_type = 'one';
    end;
    
    % Component cuasality procedure name
    cause_name = [comp_type, '_cause'];
    
    % Invoke  the appropriate causality procedure
    if exist(cause_name)~=2 % Try a compound component
      disp('------------PUSH-----------------');
      [comp_bonds,s] = abg2cbg(name, comp_type, full_name, comp_bonds, ...
	  infofile);
      status(i)=max(abs(s));
      disp('------------POP-----------------');
    else % its a simple component


      eval([ '[comp_bonds,status(i)] = ', cause_name, '(comp_bonds);' ]);

    end;
    
    % Update the full bonds list
    % and convert from component orientated to arrow orientated causality
    bonds(bond_list,:) = comp_bonds.*direction; 
  end;








|










>
>

>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
    if strcmp(comp_type,'0')
      comp_type = 'zero';
    end;
    if strcmp(comp_type,'1')
      comp_type = 'one';
    end;
    
    % Component causality procedure name
    cause_name = [comp_type, '_cause'];
    
    % Invoke  the appropriate causality procedure
    if exist(cause_name)~=2 % Try a compound component
      disp('------------PUSH-----------------');
      [comp_bonds,s] = abg2cbg(name, comp_type, full_name, comp_bonds, ...
	  infofile);
      status(i)=max(abs(s));
      disp('------------POP-----------------');
    else % its a simple component
      disp(['---', name, ' (', cause_name, ') ---']);
      comp_bonds
      eval([ '[comp_bonds,status(i)] = ', cause_name, '(comp_bonds);' ]);
      comp_bonds
    end;
    
    % Update the full bonds list
    % and convert from component orientated to arrow orientated causality
    bonds(bond_list,:) = comp_bonds.*direction; 
  end;


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