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.51 2003/05/16 11:16:28 gawthrop
## ## Fixed bug with multiports
## ##
## ## Revision 1.50 2003/05/08 18:47:50 gawthrop
## ## Fixed __ bug when using * representations
## ##
## ## Revision 1.49 2003/03/13 15:19:04 gawthrop
## ## Now uses __ to delimit subsystems in names.
## ##
## ## Revision 1.48 2003/03/13 15:10:26 gawthrop
|
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
-
-
+
+
|
if exist(cbg_name)~=2 # Return if cbg file doesn't exist
disp([cbg_name, " does not exist"]);
return
end;
## Setup files
ese_name = [full_name_repetition, "_ese.r"];
ese_file = fopen(ese_name, "w") # open file (first time)
icd_file = fopen([full_name_repetition,"_icd.txt2"],"w")
ese_file = fopen(ese_name, "wt") # open file (first time)
icd_file = fopen([full_name_repetition,"_icd.txt2"],"wt")
fprintf(ese_file, "\n%s%s Equation file for system %s (file %s)\n", ...
pc, pc, full_name_repetition, ese_name);
fprintf(ese_file, "%s%s Generated by MTT\n\n", pc, pc);
## Evaluate the system function to get the bonds
eval(["CBG = ", cbg_name, ";"]);
|
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
-
+
|
disp("---PUSH---"); bond_list, comp_name, subsystem.type
structure = cbg2ese(comp_name, subsystem.type, subsystem.cr, subsystem.arg, ...
full_name, full_name_repetition, ...
k, structure, structure_file, infofilenum);
disp("---POP---");
ese_file = fopen(ese_name, "a") # open file (again)
ese_file = fopen(ese_name, "at") # open file (again)
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);
|