Overview
Comment:Removed redundant final column
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 9509f928eb290ca3d44e36ed1e0e3b71a669cbebada2603446d34fa41f4e5634
User & Date: gawthrop@users.sourceforge.net on 2003-03-13 15:10:26
Other Links: branch diff | manifest | tags
Context
2003-03-13
15:19:04
Now uses __ to delimit subsystems in names. check-in: 2cf0c97f97 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
15:10:26
Removed redundant final column check-in: 9509f928eb user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:56:45
Equation generatation for sorted equations check-in: 74b9225cb0 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/m/cbg2ese.m from [ee9337ddf4] to [e931fd8820].

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.46  2002/08/20 15:51:17  gawthrop
  ## ## Update to work with ident DIY rep
  ## ##
  ## ## Revision 1.45  2002/05/22 09:15:03  gawthrop
  ## ## Non-repetitive components no longer use _1 in names
  ## ##
  ## ## Revision 1.44  2001/11/11 18:12:30  geraint







>
>
>







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.47  2003/02/28 09:12:17  gawthrop
  ## ## Two more columns in _stuc.txt: causality and subsystem name
  ## ##
  ## ## Revision 1.46  2002/08/20 15:51:17  gawthrop
  ## ## Update to work with ident DIY rep
  ## ##
  ## ## Revision 1.45  2002/05/22 09:15:03  gawthrop
  ## ## Non-repetitive components no longer use _1 in names
  ## ##
  ## ## Revision 1.44  2001/11/11 18:12:30  geraint
176
177
178
179
180
181
182


183
184
185
186
187
188
189
  ## ##
  ## #############################################################
  
  ## disp("cbg2ese");
  ## system_name, system_type, full_name, repetition
  
  pc = "%";


  unit_error = "Component %s connects inconsistent ports with units %s and %s"  
  unit_info = "Component %s connects ports with units %s and %s"  

  ## Set up the names corresponding to the structure matrix.
  structure_name = [
		    "state        ",
		    "nonstate     ",







>
>







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
  ## ##
  ## #############################################################
  
  ## disp("cbg2ese");
  ## system_name, system_type, full_name, repetition
  
  pc = "%";
  sub_delim = "__";		# Subsystem delimiter
  
  unit_error = "Component %s connects inconsistent ports with units %s and %s"  
  unit_info = "Component %s connects ports with units %s and %s"  

  ## Set up the names corresponding to the structure matrix.
  structure_name = [
		    "state        ",
		    "nonstate     ",
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
  
  ## 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)];
    else
      full_name_repetition = [full_name_repetition, \
			      "_", system_name];
    endif
    
  end;
  
  
  
  cbg_name = [full_name, "_cbg"];







|



|



|







203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
  
  ## 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, sub_delim, system_name];

    if (repetition>1)
      full_name_repetition = [full_name_repetition, \
			      sub_delim, system_name, sub_delim, \
			      num2str(repetition)];
    else
      full_name_repetition = [full_name_repetition, \
			      sub_delim, system_name];
    endif
    
  end;
  
  
  
  cbg_name = [full_name, "_cbg"];
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407

	    ## 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);
	    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);
	    







|
|


|
|







393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412

	    ## 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%s_%d", ...
				       full_name_repetition, sub_delim, \
				       comp_name, k);
	    else
	      name_comp_name = sprintf("%s%s%s", ...
				       full_name_repetition, sub_delim, \
				       comp_name);
	    endif
	    
	    
	    printf("\n\t%s Equations linking up subsystem %s (%s)\n\n",\
		   pc, comp_name, subsystem.type);
	    
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
 	      which_indices = getindex(structure_change,1);
 	      which_indices = which_indices(:,2)';
 	      for which_index=which_indices
 	    	value = structure(which_index);
	    	value_change=value-old_structure(which_index);
	    	for k=1:value_change
		  fprintf(structure_file, ...
			  "%s\t%i\t%s\t%s_%s\t%i\t%s\t%s\n", ...
			  structure_name(which_index,:), value-k+1, ...
			  comp_name, full_name_repetition, comp_name, \
			  repetition, cause2name(-comp_bonds(1)), full_name_repetition );
	    	endfor;
 	      endfor;
 	    endif;
	  endif
	endfor
	fflush (structure_file);








|

|
|







533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
 	      which_indices = getindex(structure_change,1);
 	      which_indices = which_indices(:,2)';
 	      for which_index=which_indices
 	    	value = structure(which_index);
	    	value_change=value-old_structure(which_index);
	    	for k=1:value_change
		  fprintf(structure_file, ...
			  "%s\t%i\t%s\t%s%s%s\t%i\t%s\n", ...
			  structure_name(which_index,:), value-k+1, ...
			  comp_name, full_name_repetition, sub_delim, comp_name, \
			  repetition, cause2name(-comp_bonds(1)));
	    	endfor;
 	      endfor;
 	    endif;
	  endif
	endfor
	fflush (structure_file);


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]