19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
+
+
+
+
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.21 1998/07/03 18:58:58 peterg
% %% Put arg alias stuff within function alias_args
% %% Called recursively to handle arithmetic expressions
% %%
% %% Revision 1.20 1998/07/03 14:39:09 peterg
% %% Added info messages a bit busy now!
% %%
% %% Revision 1.19 1998/04/12 11:58:19 peterg
% %% Rename port components by changing name_r to [name_r
% %%
% %% Revision 1.18 1998/04/11 18:59:16 peterg
|
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
|
% Set up the first dummy bond number - needed for repetative components
next_bond = max(max(abs(components)))+1;
% Set up the counters for the labelled SS. These are, by definition,
% encountered first and so the counters will not be messed up by subsystems.
local_u_index = 0;
local_y_index = 0;
if (length(system_args)==0)
mtt_info(sprintf("No arguments given so no argument aliasing done for system %s(%s)",\
system_name,system_type),infofile);
else
eval([ "alias = ", alias_name ";"]);
end;
if (length(system_cr)==0)
mtt_info(sprintf("No cr given so no cr aliasing done for system %s(%s)",\
system_name,system_type),infofile);
else
eval([ "alias = ", alias_name ";"]);
end;
for i = 1:n_components
comp = nozeros(components(i,:));
bond_list = abs(comp);
direction = sign(comp)'*[1 1];
% Convert from arrow orientated to component orientated causality
comp_bonds = bonds(bond_list,:).*direction;
disp('---- Component ---');
% Get the component details
eval([ '[comp_type,comp_name,cr,args,repetitions] = ', cmp_name, '(i)' ...
]);
% Alias the args list
% Alias the args list -- if not at top level
eval([ "alias = ", alias_name ";"]);
message = sprintf("\tfor component %s (%s) within %s",comp_name,comp_type,full_name);
args = alias_args(args,alias,";",message);
message = sprintf("\tfor component %s (%s) within %s",\
comp_name,comp_type,full_name);
if (length(system_args)>0)
args = alias_args(args,alias,";",message)
end;
if (length(system_cr)>0)
cr = alias_args(cr,alias,";",message)
end;
% Substitute positional ($1 etc) arguments
cr = subs_arg(cr,system_cr, ...
'lin',full_name,comp_type,comp_name);
args = subs_arg(args,system_args, ...
'1',full_name,comp_type,comp_name);
|