Comment: | 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 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
cce4dc617c2b000c09ef64479b02fffb |
User & Date: | geraint@users.sourceforge.net on 2009-11-02 16:54:03 |
Other Links: | branch diff | manifest | tags |
2012-10-15
| ||
19:17:19 | split is obsolete in Octave, replaced with strsplit and strtok. Semi-colons removed during debugging for more verbose log file. check-in: 078d645a0b user: geraint@users.sourceforge.net tags: origin/master, trunk | |
2009-11-02
| ||
16:54:03 | 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 check-in: cce4dc617c user: geraint@users.sourceforge.net tags: origin/master, trunk | |
16:51:54 | Recognises MTTz, but mttdz is yet to be handled in output equations check-in: 31ea8af321 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Modified mttroot/mtt/bin/trans/dm2fr_m from [302b8e2528] to [905d7cb644].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + + + | # Copyright (c) P.J.Gawthrop, 1996. ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.15 2003/05/08 18:46:45 gawthrop ## Fixed range bug by using isfield in place of exists ## ## Revision 1.14 2000/05/20 15:35:18 peterg ## Parameterised version ## ## Revision 1.13 1998/09/03 09:12:32 peterg ## Removed debugging lines ## ## Revision 1.12 1998/09/02 12:02:14 peterg |
︙ | |||
88 89 90 91 92 93 94 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - + - + - + - + | # Simulation parameters simpar=$1_simpar; [nx,ny,nu,nz,nyz] = $1_def; %Defaults |
︙ |
Modified mttroot/mtt/bin/trans/m/abg2cbg.m from [b9b1f81aae] to [d576ebb7c3].
︙ | |||
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 33 | + + + + | ## [bonds,status] = abg2cbg(system_name, system_type, full_name, port_bonds, infofile) ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ ## ## 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 "". ## ## ## ## Revision 1.50 2003/03/13 15:18:39 gawthrop ## ## Now uses __ to delimit subsystems in names. ## ## ## ## Revision 1.49 2001/07/26 05:02:53 geraint |
︙ | |||
256 257 258 259 260 261 262 | 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | - - + + - + - + | status = []; return end; ## Evaluate the system function to get the bonds and number of ports ##eval(["[bonds,components,n_ports,N_ports]=", fun_name, ";"]); eval(["[ABG]=", fun_name, ";"]); |
︙ | |||
364 365 366 367 368 369 370 | 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | - + | total = 2*n_bonds; done = sum(sum(abs(ABG.bonds)))/total*100; fields=["ports";"subsystems"]; # Do for both ports and subsystems - ## ports first for i=1:2 field=deblank(fields(i,:)); |
︙ | |||
484 485 486 487 488 489 490 | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | - + | prefered = -prefered; end; ABG.bonds(ci_bond_index,1:2) = prefered*ci_direction'*[1 1] eval(["ABG.subsystems.",name,".status=0"]); #set status of the C or I endif endwhile # ( ci_index>0) eval(["ABG.",field," = ABG_field;"]); # Copy back to actual structure |
︙ |
Modified mttroot/mtt/bin/trans/m/alias_args.m from [33aaf8ec7f] to [c2ced77624].
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.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 ## Operator ^ now ok in args in abg and/or lbl ## ## Revision 1.6 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 ## |
︙ | |||
28 29 30 31 32 33 34 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | - + - + | ## This makes it substitute for bits of args separated by commas. ## ## Revision 1.1 1998/07/03 18:29:40 peterg ## Initial revision ## ############################################################### |
︙ |
Modified mttroot/mtt/bin/trans/m/cbg2ese.m from [855720c30a] to [ea5247f84f].
︙ | |||
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 36 | + + + + | ## Structure matrix [states,nonstates,inputs,outputs,zero_outputs] ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ ## ## 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. ## ## ## ## Revision 1.51 2003/05/16 11:16:28 gawthrop ## ## Fixed bug with multiports ## ## ## ## Revision 1.50 2003/05/08 18:47:50 gawthrop |
︙ | |||
306 307 308 309 310 311 312 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | - + - + - + | fields=["ports";"subsystems"]; # Do for both ports and subsystems - ## ports first lists=["portlist";"subsystemlist"]; for i=1:2 field=deblank(fields(i,:)); list=deblank(lists(i,:)); |
︙ | |||
436 437 438 439 440 441 442 | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | - + | # deblank(bond_flow_unit(port_bond_number,:)); # ## Extract the unit/domain stuff # this_port_name = subABG.portlist(port_number,:); # eval(sprintf("this_port = subABG.ports.%s;", \ # this_port_name)); |
︙ | |||
566 567 568 569 570 571 572 | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 | - - + + - + - + | endfor; endif; endif endfor fflush (structure_file); ## component interface definition |
Modified mttroot/mtt/bin/trans/m/cbg2fig.m from [7902a61185] to [7c46356009].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | + + + | ## Copyright (c) P.J.Gawthrop, 1996. ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## %% Version control history ## %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## %% $Id$ ## %% $Log$ ## %% Revision 1.17 2004/09/12 22:27:27 geraint ## %% Appended 't' to fopen mode string to open in text mode. ## %% ## %% Revision 1.16 2001/03/23 14:58:16 gawthrop ## %% Fixed cosmetic bugs -- component display ## %% ## %% Revision 1.15 2001/03/23 11:20:20 gawthrop ## %% Fixed bug with vector components --NB takes geometric info from _rbg.fig ## %% ## %% Revision 1.14 2000/09/14 12:07:15 peterg |
︙ | |||
104 105 106 107 108 109 110 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + | end; if nargin<9 comp_colour_o = 4; %Red end; ## Create a back slash '\' character. |
︙ | |||
150 151 152 153 154 155 156 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | - + | M_components = Columns; N_rcomponents = Rows; # Number of raw components [N_rports,junk] = size(port_list); [N_components, Columns] = size(CBG.subsystemlist); # Number of derived # components |
︙ |
Modified mttroot/mtt/bin/trans/m/ibg2abg.m from [5d61fecdc4] to [c68472150c].
︙ | |||
83 84 85 86 87 88 89 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + - + | #################################################### ## count number of vector bonds on each component ## #################################################### if (isfield(objects, "comp")) for [comp, comp_name] = objects.comp |
︙ | |||
334 335 336 337 338 339 340 | 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | - - + + | tail_str = sprintf("objects.%s.%s.bond%i", tail_comp_or_port, tail_name, i) head_bond = eval(head_str); tail_bond = eval(tail_str); ## check compatible sizes |
︙ | |||
413 414 415 416 417 418 419 | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | - + - + | ################################# ## map component data to cmp.m ## ################################# ## count number of components if (isfield(objects, "comp")) |
︙ | |||
479 480 481 482 483 484 485 | 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | - + | n_vector_bonds ########################################### ## Write connections matrix (components) ## ########################################### if (isfield(objects, "comp")) |
︙ |
Modified mttroot/mtt/bin/trans/m/mtt_alias.m from [750fa34e3e] to [8f9f502367].
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + | else Cbg = mtt_cbg(Name); # Structure for this subsystem endif ## Argument aliasing message = sprintf("\tfor component %s within %s",name,Name); |
︙ |
Modified mttroot/mtt/bin/trans/m/mtt_component_eqn.m from [78fbb4594b] to [50cfed29c8].
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 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 | - + - + | if length(known)<2 # Invalid known = " "; endif if length(Name)>0 cbg = mtt_cbg(Name); # Structure for this subsystem |
︙ | |||
161 162 163 164 165 166 167 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - - + + | outsig insigs innames endif ## Is the signal the output of a port? is_port_output = 0; # Default |
︙ |
Modified mttroot/mtt/bin/trans/m/rbg2abg.m from [88812e8fad] to [80cfe69023].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + + + | function [bonds,components,n_vector_bonds] = rbg2abg(name,rbonds,rstrokes,rcomponents,\ port_coord,port_name,\ infofile,errorfile) ## ############################################################### ## ## Version control history ## ############################################################### ## ## $Id$ ## ## $Log$ ## ## Revision 1.49 2004/07/22 13:18:02 geraint ## ## Minor typo in error message. ## ## ## ## Revision 1.48 2004/02/19 18:27:47 geraint ## ## [ 852694 ] octave 2.1.52 breaks rbg2abg ## ## ## ## Octave now prefers row vectors to column vectors. ## ## ## ## Revision 1.47 2002/08/27 16:09:01 geraint ## ## Added port_name to error message when multiple bonds are near a port. |
︙ | |||
375 376 377 378 379 380 381 | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | - - + + | ## port_name_i = deblank(port_name(port_name_index,:)); ## port_name_i = port_name_i(2:length(port_name_i)-1) # strip [] endif ## Replace by alias -- if any eval( ["alias = ", comp_type, '_alias';]); # Get aliases |
︙ | |||
567 568 569 570 571 572 573 | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 | - + | signed_bond_list = nozeros(components(i,:)); n_comp_bonds = length(signed_bond_list); direction = sign(signed_bond_list); ##Find the port list for this component if exist([comp_type, '_cause'])==0 eval(["ABG = ",comp_type, "_abg;"]); |
︙ |
Modified mttroot/mtt/bin/trans/m/str2ch.m from [367266a7c0] to [6886463212].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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 | + + + - + | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% Revision 1.3 1996/12/04 21:39:55 peterg % %% Changed to handle null string (octave returns lenghth of 1) % %% % %% Revision 1.1 1996/08/30 09:54:44 peter % %% Initial revision % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% implicit_str_to_num_ok = 1; astr = abs(str); if (n>0) & (n<=length(str)) & (strcmp(str,'')==0) |
︙ |
Modified mttroot/mtt/bin/trans/m/write_abg.m from [ec868dcca7] to [1dcbed067b].
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 write_abg(system_name,bonds,connections,n_vector_bonds); ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.11 2004/09/12 22:27:27 geraint ## Appended 't' to fopen mode string to open in text mode. ## ## Revision 1.10 2004/08/09 14:47:28 gawthrop ## Changed arg to args to avoid strange octave bug ## ## Revision 1.9 2001/04/15 21:15:41 geraint ## Added interface definition rep: _ICD.(txt|c|cc|m). ## ## Revision 1.8 1999/10/18 22:41:41 peterg |
︙ | |||
173 174 175 176 177 178 179 | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | - + - + | fprintf(fid,"\n"); endfor; fprintf(fid," ];\n"); fprintf(fid,"\n# Aliases \n"); fprintf(fid,"# A double underscore __ represents a comma \n"); eval(["alias = ", system_name, "_alias;"]); |
Modified mttroot/mtt/bin/trans/m/write_cbg.m from [bf1b05ce91] to [cabf88aa9f].
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 write_cbg(system_name,system_type,system,Flipped) ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.5 2004/09/12 22:27:27 geraint ## Appended 't' to fopen mode string to open in text mode. ## ## Revision 1.4 1998/08/26 12:26:17 peterg ## Replaced if N>0 by if (N>0)&&(M>0) # Flipped ports exist ## ## Revision 1.3 1998/08/25 20:05:33 peterg ## Write flipped port info ## ## Revision 1.2 1998/08/25 06:21:19 peterg |
︙ | |||
32 33 34 35 36 37 38 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + - + | fprintf(fid,"# Generated by MTT on %s",ctime(time)); fprintf(fid,"# The file is in Octave format\n"); fprintf(fid,"\n# Acausal bond graph structure\n"); fprintf(fid," [%s] = %s_abg;\n", system_name, system_type); fprintf(fid,"\n# Status information\n"); |
︙ |
Modified mttroot/mtt/bin/trans/m/write_ibg.m from [041b691f80] to [3ea7c08bfd].
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | ## -*-octave-*- function write_ibg(system_name,bonds); fid = fopen([system_name,"_ibg.m"], "wt"); |
︙ |
Modified mttroot/mtt/bin/trans/m/write_matrix.m from [16a127a42d] to [80adc0845c].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | + + + | function write_matrix(matrix,name,extn); % Writes the matrix function file % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% Revision 1.9 2006/09/27 13:55:08 geraint % %% Write complex numbers in polar form instead of real and imaginary parts. % %% % %% Revision 1.8 2004/09/12 22:27:27 geraint % %% Appended 't' to fopen mode string to open in text mode. % %% % %% Revision 1.7 2002/05/15 16:37:30 gawthrop % %% Added third argument (file extension) % %% % %% Revision 1.6 2000/12/27 16:06:17 peterg |
︙ | |||
48 49 50 51 52 53 54 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + | fprintf(filenum, 'data = [\n'); [N,M] = size(matrix); for row = 1:N for col = 1:M value = matrix(row,col); |
︙ |
Modified mttroot/mtt/bin/trans/octave_ode2odes from [9934b36f54] to [abe17462de].
︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | + + + | # Copyright (c) P.J.Gawthrop 1999 ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.6 2005/04/26 22:52:26 geraint ## The Octave load/save -ascii option is deprecated in favour of -text ## ## Revision 1.5 2002/05/07 10:13:48 gawthrop ## Files marked by update as out of sync ## ## Revision 1.4 2001/03/30 15:13:58 gawthrop ## Rationalised simulation modes to each return mtt_data ## ## Revision 1.3 2000/05/19 17:47:56 peterg |
︙ | |||
34 35 36 37 38 39 40 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | echo Creating $1_odes.dat2 $MATRIX <<EOF >octave_ode2odes.log 2>mtt_error.txt ## Set up the simulation parameters par = $1_numpar; x_0 = $1_state(par); simpar = $1_simpar mtt_data = $1_ode2odes(x_0,par,simpar); |