19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.17 1998/04/04 10:47:31 peterg
% %% Uses (coerced) components from _cbg file - _abg not now used here.
% %%
% %% Revision 1.16 1998/03/06 09:38:58 peterg
% %% Now writes correct structure file for multiport C & I
% %%
% %% Revision 1.15 1997/12/16 18:24:33 peterg
|
>
>
>
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.18 1998/04/11 18:59:16 peterg
% %% at_top_level now global - passed to SS components
% %%
% %% Revision 1.17 1998/04/04 10:47:31 peterg
% %% Uses (coerced) components from _cbg file - _abg not now used here.
% %%
% %% Revision 1.16 1998/03/06 09:38:58 peterg
% %% Now writes correct structure file for multiport C & I
% %%
% %% Revision 1.15 1997/12/16 18:24:33 peterg
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
end;
disp('---POP---');
else % its a simple component
fprintf(ese_file, '\n\t%s Equations for component %s (%s), repetition %d\n\n', ...
pc, comp_name, comp_type,k);
% Take port SS to be ordinary SS at top level
if at_top_level & strcmp(comp_type, 'SS')
effort_attribute = cr;
flow_attribute = args;
if strcmp(effort_attribute, 'MTT_port') % Its a numbered port
effort_attribute = 'external';
flow_attribute = 'external';
cr = effort_attribute;
args = flow_attribute;
end;
end;
% Save the current structure
old_structure = structure;
% Generate the simple component equations
eval(['structure = ', ...
eqn_name, ...
|
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
end;
disp('---POP---');
else % its a simple component
fprintf(ese_file, '\n\t%s Equations for component %s (%s), repetition %d\n\n', ...
pc, comp_name, comp_type,k);
% Is it a named port? (Name begins with [)
Named_Port = (comp_name(1)=='[');
if Named_Port %Add [ to start of name
name_r = ['[' name_r];
end;
# % Take port SS to be ordinary SS at top level
# if at_top_level & strcmp(comp_type, 'SS')
# effort_attribute = cr;
# flow_attribute = args;
# if strcmp(effort_attribute, 'MTT_port') % Its a numbered port
# effort_attribute = 'external';
# flow_attribute = 'external';
# cr = effort_attribute;
# args = flow_attribute;
# end;
# end;
% Save the current structure
old_structure = structure;
% Generate the simple component equations
eval(['structure = ', ...
eqn_name, ...
|