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
|
+
+
+
|
## Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
## ###############################################################
## ## Version control history
## ###############################################################
## ## $Id$
## ## $Log$
## ## Revision 1.44 2001/11/11 18:12:30 geraint
## ## Moved fflush(structure_file) out of loop.
## ##
## ## Revision 1.43 2001/11/11 08:32:00 geraint
## ## fflush (structure_file).
## ##
## ## Revision 1.42 2001/04/23 16:23:30 gawthrop
## ## Now stips ; from bottlom level argument list - allows aliasing of
## ## parts of a,b,c (eg a,b by using a,b;c
## ##
|
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
+
+
-
-
+
+
+
+
+
+
+
+
|
## Create the (full) system name
if at_top_level
full_name = system_name;
full_name_repetition = system_name;
system_type = system_name;
else
full_name = [full_name, "_", system_name];
if (repetition>1)
full_name_repetition = [full_name_repetition, ...
"_", system_name, "_", num2str(repetition)];
full_name_repetition = [full_name_repetition, \
"_", system_name, "_", \
num2str(repetition)];
else
full_name_repetition = [full_name_repetition, \
"_", system_name];
endif
end;
cbg_name = [full_name, "_cbg"];
if exist(cbg_name)~=2 # Return if cbg file doesn't exist
disp([cbg_name, " does not exist"]);
|
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
|
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
+
+
-
-
+
+
+
+
+
+
+
+
+
|
eval(["subABG = ",subsystem.type , "_abg;"]); # Get the information
## Link up the bonds for this compound component
fprintf(ese_file, ...
"\n\t%s Equations linking up subsystem %s (%s)\n\n", ...
pc, comp_name, subsystem.type);
if (k>1)
name_comp_name = sprintf("%s_%s_%d", ...
full_name_repetition, comp_name, k);
name_comp_name = sprintf("%s_%s_%d", ...
full_name_repetition, \
comp_name, k);
else
name_comp_name = sprintf("%s_%s", ...
full_name_repetition, \
comp_name);
endif
printf("\n\t%s Equations linking up subsystem %s (%s)\n\n",\
pc, comp_name, subsystem.type);
u_index = 0; y_index = 0; ## Count the inputs and outputs
for port_number=1:length(bond_list)
port_bond_number = bond_list(port_number);
|