Comment: | Changed newline escape from backslash to ellipsis in m files |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a349b0c96b1104575b9c84b9557a9eae |
User & Date: | geraint@users.sourceforge.net on 2014-07-25 21:31:48 |
Other Links: | branch diff | manifest | tags |
2014-08-02
| ||
16:36:14 | Replaced continuation character in lib m files, except PPP and Control check-in: 67e34974df user: geraint@users.sourceforge.net tags: origin/master, trunk | |
2014-07-25
| ||
21:31:48 | Changed newline escape from backslash to ellipsis in m files check-in: a349b0c96b user: geraint@users.sourceforge.net tags: origin/master, trunk | |
2014-07-14
| ||
06:37:07 | Avoid continuation \ issues. check-in: 53581fb570 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Modified mttroot/mtt/bin/trans/m/abg2cbg.m from [d576ebb7c3] to [27f38055ab].
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + + + | ## [bonds,status] = abg2cbg(system_name, system_type, full_name, port_bonds, infofile) ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ ## ## Revision 1.53 2009/11/02 16:54:03 geraint ## ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char ## ## ## ## Revision 1.52 2004/09/07 18:22:53 geraint ## ## Issues a more helpful error message than the cryptic Octave stuff ## ## if there are unconnected ports. ## ## ## ## Revision 1.51 2004/02/20 20:42:40 geraint ## ## Initialize Flipped.cons with [] instead of "". ## ## |
︙ | |||
322 323 324 325 326 327 328 | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | - + - + | mtt_error (sprintf ("abg2cbg: port_bond_direction(%d) does not exist.", i)); exit(1); end if (sign(port.connections)!=port_bond_direction(i)) # Direction different? eval(["ABG.ports.",name,".connections = - port.connections;"]); # Flip direction at port Flipped.ports=[Flipped.ports;name]; # Remember which port has been flipped bond_index=abs(port.connections); # Index of bond on port |
︙ |
Modified mttroot/mtt/bin/trans/m/alias_args.m from [e741159462] to [52ee84b0ea].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | + + + | function args = alias_args(args,alias,delim,message,FileID,sys_name) ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.10 2012/10/15 19:16:03 geraint ## split is obsolete in Octave, replaced with strsplit ## ## Revision 1.9 2009/11/02 16:54:03 geraint ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char ## ## Revision 1.8 2001/06/13 16:07:15 gawthrop ## Fixed bug with three separators in a row eg )/( ## ## Revision 1.7 2001/06/13 14:50:15 gawthrop |
︙ | |||
43 44 45 46 47 48 49 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - + | Args = char(strsplit(args,delim)); args=""; [N,M]= size(Args); for i=1:N arg = deblank(Args(i,:)); arg_ = strrep(arg,",","__"); if isfield(alias,arg_) eval(["new_arg = alias.", arg_,";"]); |
︙ |
Modified mttroot/mtt/bin/trans/m/cbg2ese.m from [ea5247f84f] to [fbe5a968f6].
︙ | |||
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.54 2009/11/02 16:54:03 geraint ## ## Replaced deprecated functions from Octave 2.1 for Octave 3.0: is_struct -> isstruct, struct_contains -> isfield, struct_elements -> fieldnames, is_complex -> iscomplex, setstr -> char ## ## ## ## Revision 1.53 2005/03/21 11:09:47 gawthrop ## ## Now handles bicausal SS component - ## ## ie source-source or sensor-sensor ## ## ## ## Revision 1.52 2004/09/12 22:27:27 geraint ## ## Appended 't' to fopen mode string to open in text mode. ## ## |
︙ | |||
226 227 228 229 230 231 232 | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - - + + - + | 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) |
︙ | |||
289 290 291 292 293 294 295 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | - + - + | ## Set up the counters for the labelled SS. These are, by definition, ## encountered first and so the counters will not be messed up by subsystems. local_u_index = 0; local_y_index = 0; if (length(system_args)==0) |
︙ | |||
325 326 327 328 329 330 331 | 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | - + - + | direction = sign(comp)'*[1 1]; # Convert from arrow orientated to component orientated causality comp_bonds = CBG.bonds(bond_list,:).*direction; ## disp(["---- ", field, " ---"]); if AliasingArguments # Alias the args list if appropriate |
︙ | |||
414 415 416 417 418 419 420 | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + | ## 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%s%d", ... |
︙ | |||
560 561 562 563 564 565 566 | 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | - + | cause_name = cause2name(-comp_bonds(1,k)); else # Maybe multiport - but unicausal cause_name = cause2name(-comp_bonds(k,1)); endif fprintf(structure_file, ... "%s\t%i\t%s\t%s%s%s\t%i\t%s\n", ... structure_name(which_index,:), value-k+1, ... |
︙ |
Modified mttroot/mtt/bin/trans/m/ibg2abg.m from [ac24c78571] to [acf7448537].
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | ## -*-octave-*- |
︙ | |||
154 155 156 157 158 159 160 | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - + - + - + | endif endif eval(sprintf("comp.%s = bond;", bond_name)); endfor ## attach labels to unlabelled ports if (n_named_ports == 0) |
︙ |
Modified mttroot/mtt/bin/trans/m/mtt_alias.m from [8f9f502367] to [95ae877303].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | function [args] = mtt_alias (fullname,args,default); ## usage: [cr,args] = mtt_alias (fullname,cr,args) ## ## Aliasing code for mtt. ## Abstracted from cbg2ese for use in cbg2sese_m2r ## Copyright (C) 2003 by Peter J. Gawthrop filenum = -1; # No file number for messages [Name,name] = mtt_subname(fullname); # Split fullname if (length(args)==0) |
︙ |
Modified mttroot/mtt/bin/trans/m/mtt_component_eqn.m from [50cfed29c8] to [a190371a3c].
| 1 2 3 4 5 6 7 8 | - + |
|
︙ | |||
70 71 72 73 74 75 76 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - + | if port>N_ports error(sprintf("port (%i) > N_ports (%i)", port, N_ports)); else # Get name and find equation name = deblank(cbg.portlist(port,:)); if DEBUG disp("----> lower-level system") endif |
︙ | |||
98 99 100 101 102 103 104 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + | ## A useful composite name name_port_cause = sprintf("%s_%i_%s",name, port, cause); full_name_port_cause = mtt_fullname(Name,name_port_cause); ## If value is known, don't do anything. if findstr(sprintf(" %s ", full_name_port_cause), known)>0 |
︙ | |||
134 135 136 137 138 139 140 | 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + - + | bonds = cbg.bonds; ## List of component bond causality (component-orientated causality) comp_bonds = bonds(bond_list,:).*directions; # Component bonds ## What components are at the other ends of the in bonds? ## Effort |
︙ | |||
192 193 194 195 196 197 198 | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | - + - + - - - - + + + + | ## Find its equation if DEBUG disp("----> higher level system") endif |
︙ | |||
239 240 241 242 243 244 245 | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 | - + - - + + | RHS = Sensor_seqn ("external",new_Name); eqn = sprintf("%s := %s%s%s;", LHS, RHS, SD, port_name); if DEBUG disp("----> same-level subsystem") endif |
︙ | |||
272 273 274 275 276 277 278 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | - - + + | other_port = insigs(i,3); other_name = deblank(innames(i,:)); if DEBUG disp("----> same-level component") endif |
Modified mttroot/mtt/bin/trans/m/mtt_component_inputs.m from [654cc2c381] to [6889a2a85b].
| 1 2 3 4 5 6 7 8 | - + |
|
︙ |
Modified mttroot/mtt/bin/trans/m/mtt_stime.m from [57b5993ee0] to [588e121a7c].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + - + | for j=1:length(theta) args = sprintf("%s %g",args, theta(j)); endfor ## Run system and replace NaN by 1e30 -- easier to handle file_name = sprintf("%s_input.dat", system_name); if exist(file_name)==2 # Then use data from this file ... |
︙ |
Modified mttroot/mtt/bin/trans/m/printcr.m from [4fb181bd27] to [33c745664a].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | + + + - + | ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ ## ## Revision 1.2 2003/01/07 09:11:53 gawthrop ## ## Octavised ## ## ## ## Revision 1.1 1998/07/25 09:47:43 peterg ## ## Initial revision ## ## ## ############################################################### if nargin<7 eqnfile = "stdout"; endif ## Find the number of ports ports = length(RHS_cause); ## Print the CR if length(cr) == 0 # No CR given - use unity CR |
︙ |
Modified mttroot/mtt/bin/trans/m/rbg2abg.m from [c3c2325f5b] to [19a07974ce].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - - + + + + + |
|
︙ | |||
347 348 349 350 351 352 353 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 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 405 406 407 408 409 410 411 412 413 414 415 416 | - + - + - + - + - + - - + + - + | out_bonds++; port_name_i = "out"; endif elseif (unlabelled_ports==2) if port_direction>0 if (++in_bonds>1) |
︙ | |||
590 591 592 593 594 595 596 | 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | - + | [n_comp_ports,m_comp_ports] = size(port_list); subport_list=""; for p=1:n_comp_ports # Expand any vector ports [subport,n_sub] = split_port(port_list(p,:), ','); # Find the components # of the vector port if n_sub>1 |
︙ | |||
652 653 654 655 656 657 658 | 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 | - + | mtt_error(['Component ', comp_name, ' (', comp_type, ') has no labeled ports'], errorfile); endif ##Write out the signed bond list in the correct order unsorted_port_list [n_list,m_list] = size(unsorted_port_list); if n_list!=n_comp_bonds |
︙ |
Modified mttroot/mtt/bin/trans/m/rbg2ibg.m from [d1b6aaad6f] to [ec747e75b4].
1 2 | 1 2 3 4 5 6 7 8 9 10 11 | - - + + | ## -*-octave-*- |
︙ | |||
47 48 49 50 51 52 53 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + - + - + - + - + - + - + | arrow_end = rbonds(:,3:4); other_end_2 = rbonds(:,5:6); distance_1 = length2d(other_end_1 - arrow_end); distance_2 = length2d(other_end_2 - arrow_end); which_end = (distance_1 > distance_2) * [1, 1]; one = ones(size(which_end)); |
︙ | |||
119 120 121 122 123 124 125 | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | - + - + | stroke_end_2(i,:)]; ## Find the nearest bond end [index,distance] = adjbond(stroke(1,:),arrow_end,other_end); if (distance > (2 * stroke_length(i))) info = sprintf('Stroke at (%4.3f,%4.3f) is %4.3f away from the nearest bond\n', ... |
︙ | |||
148 149 150 151 152 153 154 | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | - + - + | causality ## Write data for i = 1:n_bonds [hc_type, hc_name] = eval([name, '_cmp(comp_near_bond(i,1))']); [tc_type, tc_name] = eval([name, '_cmp(comp_near_bond(i,2))']); ## components |
︙ |
Modified mttroot/mtt/bin/trans/m/subs_arg.m from [5ca842278f] to [9eca75053a].
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + + + | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% Revision 1.7 2001/07/03 22:59:10 gawthrop % %% Fixed problems with argument passing for CRs % %% % %% Revision 1.6 1998/07/27 09:53:44 peterg % %% No change % %% % %% Revision 1.5 1998/07/21 16:43:26 peterg % %% Now writes to an explicit fileID - otherwise we may run out of IDs. % %% % %% Revision 1.4 1996/12/10 16:04:11 peterg |
︙ | |||
76 77 78 79 80 81 82 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + | % Test for empty argument -- replace by default and tell user message = 'Argument %1.0f of component %s(%s) of system %s is undefined - \n replacing by %s'; if strcmp(arg_out,'') info = sprintf(message, ... i, comp_name, comp_type, full_name, default); arg_out = default; else |
Modified mttroot/mtt/bin/trans/m/write_ibg.m from [3ea7c08bfd] to [bff06207d1].
︙ | |||
9 10 11 12 13 14 15 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + - + - + - + - + - + - + | format_hp = " %s.bonds.bond%i.head.ports\t= \"%s\";\n"; format_tp = " %s.bonds.bond%i.tail.ports\t= \"%s\";\n"; format_ce = " %s.bonds.bond%i.causality.effort\t= \"%s\";\n"; format_cf = " %s.bonds.bond%i.causality.flow\t= \"%s\";\n"; fprintf(fid, "## -*-octave-*-\n\n"); fprintf(fid, "function [%s] = %s_ibg\n\n", system_name, system_name); |