12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.11 1996/12/07 18:20:11 peterg
% %% Replaces null argument by a default and tells user.
% %%
% %% Revision 1.10 1996/12/07 17:37:07 peterg
% %% Now handles numbered SS ports appearing at top level.
% %%
% %% Revision 1.9 1996/12/04 21:49:47 peterg
|
>
>
>
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.12 1997/04/15 09:17:26 peterg
% %% Added the structure file - contains details of states etc.
% %%
% %% Revision 1.11 1996/12/07 18:20:11 peterg
% %% Replaces null argument by a default and tells user.
% %%
% %% Revision 1.10 1996/12/07 17:37:07 peterg
% %% Now handles numbered SS ports appearing at top level.
% %%
% %% Revision 1.9 1996/12/04 21:49:47 peterg
|
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
eval(['structure = ', ...
eqn_name, ...
'(name_r,bond_list,comp_bonds, ...
direction,cr,args,structure,ese_file);' ]);
% If structure has changed, write info to structure file.
structure_change = structure-old_structure;
structure_changes = sum(structure_change);
if structure_changes>0
which_indices = getindex(structure_change,1);
which_indices = which_indices(:,2)';
for which_index=which_indices
value = structure(which_index);
fprintf(structure_file, ...
'%s\t%1.0f\t%s\t%s\t%1.0f\n', ...
structure_name(which_index,:), value, ...
comp_name, full_name, repetition);
end;
end;
end;
end;
end;
% Close the files
fclose(ese_file);
|
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
eval(['structure = ', ...
eqn_name, ...
'(name_r,bond_list,comp_bonds, ...
direction,cr,args,structure,ese_file);' ]);
% If structure has changed, write info to structure file.
structure_change = structure-old_structure;
% The following line is to avoid probs with multiport C or I
% it needs changing to handle multi ports correctly
structure_changes = sum(structure_change);
structure_change = structure_change>zeros(size(structure_change));
if structure_changes>0
which_indices = getindex(structure_change,1);
which_indices = which_indices(:,2)';
for which_index=which_indices
value = structure(which_index);
fprintf(structure_file, ...
'%s\t%1.0f\t%s\t%s\t%1.0f\n', ...
structure_name(which_index,:), value, ...
comp_name, full_name, repetition);
end;
end;
end;
end;
end;
% Close the files
fclose(ese_file);
|