Overview
Comment: | Fixed problems with argument passing for CRs |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
e16dcf0ecb8f807be229475f3477e36d |
User & Date: | gawthrop@users.sourceforge.net on 2001-07-03 22:59:10 |
Other Links: | branch diff | manifest | tags |
Context
2001-07-03
| ||
23:40:57 | New sensitivity version of the RS component check-in: dfcf816546 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
22:59:10 | Fixed problems with argument passing for CRs check-in: e16dcf0ecb user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
2001-06-13
| ||
18:24:10 |
Made "lin" default in place of "none" Still needs arg and cr alias clashes to be sorted .... check-in: d689652e81 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Modified mttroot/mtt/bin/trans/lbl2args_txt2out from [ea489fc016] to [05b9541fdd].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #!/bin/sh # Writes argument list to standard output ready for use in calling lbl file ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ############################################################### # Copyright (C) 2001 by Peter J. Gawthrop if [ -f "$1_lbl.txt" ]; then grep '[#%]ALIAS' $1_lbl.txt |\ awk '{ | > > > | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #!/bin/sh # Writes argument list to standard output ready for use in calling lbl file ###################################### ##### Model Transformation Tools ##### ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.1 2001/06/11 15:06:58 gawthrop ## Now handles user-defined components ## ############################################################### # Copyright (C) 2001 by Peter J. Gawthrop if [ -f "$1_lbl.txt" ]; then grep '[#%]ALIAS' $1_lbl.txt |\ awk '{ if (match($2,"\\$[0-9]")==1) ## Test if its a argument alias { i = substr($2,2); arg[i] = $3 N++ } } END{ for (j=1;j<=N;j++){ |
︙ | ︙ |
Modified mttroot/mtt/bin/trans/m/subs_arg.m from [fbd7f5c78b] to [5ca842278f].
︙ | ︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% 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 % %% Changed file handling on mtt_info. % %% % %% Revision 1.3 1996/12/07 18:19:39 peterg | > > > | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% 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 % %% Changed file handling on mtt_info. % %% % %% Revision 1.3 1996/12/07 18:19:39 peterg |
︙ | ︙ | |||
45 46 47 48 49 50 51 52 | while args_count <= L ch = str2ch(args,args_count); if ch~=S % copy character args_out = [args_out, ch]; args_count = args_count+1; else % find argument number args_count = args_count+1; ch = str2ch(args,args_count); | > > > > > > > | | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | while args_count <= L ch = str2ch(args,args_count); if ch~=S % copy character args_out = [args_out, ch]; args_count = args_count+1; else % find argument number args_count = args_count+1; ch = str2ch(args,args_count); ## Modification for $p1 $a1 etc if !((ch>='0') & (ch<='9')) # It's not numerical - so loose it args_count = args_count+1; ch = str2ch(args,args_count); endif i=0; while (ch>='0') & (ch<='9') i = 10*i + abs(ch)-abs('0'); if args_count==L args_count = args_count+1; break end; args_count = args_count+1; |
︙ | ︙ |
Modified mttroot/mtt/doc/mtt.texi from [099a903f34] to [3c0a37e2cf].
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | @comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @comment Version control history @comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @comment $Id$ @comment $Log$ @comment Revision 1.66 2000/12/05 14:20:55 peterg @comment Added the c++ anf m CR info. @comment @comment Revision 1.65 2000/11/27 15:36:15 peterg @comment NOPAR --> NOTPAR @comment @comment Revision 1.64 2000/11/16 14:22:48 peterg | > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | @comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @comment Version control history @comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @comment $Id$ @comment $Log$ @comment Revision 1.1 2001/06/04 08:18:52 gawthrop @comment Putting documentation under CVS @comment @comment Revision 1.66 2000/12/05 14:20:55 peterg @comment Added the c++ anf m CR info. @comment @comment Revision 1.65 2000/11/27 15:36:15 peterg @comment NOPAR --> NOTPAR @comment @comment Revision 1.64 2000/11/16 14:22:48 peterg |
︙ | ︙ | |||
261 262 263 264 265 266 267 | original English. @end ifinfo @titlepage @title MTT: Model Transformation Tools @subtitle December 2000 | | | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | original English. @end ifinfo @titlepage @title MTT: Model Transformation Tools @subtitle December 2000 @subtitle For version 4.9. @author Peter Gawthrop @page @vskip 0pt plus 1filll Copyright @copyright{} 1996,1997,1998,1999,2000 Peter J. Gawthrop Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice |
︙ | ︙ | |||
506 507 508 509 510 511 512 513 514 515 516 517 518 519 | * Parameter passing:: * Old-style labels (lbl):: Aliases * Port aliases:: * Parameter aliases:: * Component aliases:: Old-style labels (lbl) * SS component labels (old-style):: * Other component labels (old-style):: * Parameter passing (old-style):: | > | 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | * Parameter passing:: * Old-style labels (lbl):: Aliases * Port aliases:: * Parameter aliases:: * CR aliases:: * Component aliases:: Old-style labels (lbl) * SS component labels (old-style):: * Other component labels (old-style):: * Parameter passing (old-style):: |
︙ | ︙ | |||
2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 | @end example @item type:label Both the type and the label of the component are given. The type must be a valid name (@pxref{Valid names}.The name provides a link to more information to be found in @xref{Labels (lbl)}. For example: @example R:r @end example @item type*n The name, together with the number @samp{n} of repetitions of the component, are given. This repetition only makes sense if the component has an even number of ports (@pxref{Port labels}); n copies of the component are concatenated with odd Named ports (@pxref{Port labels}) of the component being connected to the even Named ports of the previous | > > > > > > > > | 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 | @end example @item type:label Both the type and the label of the component are given. The type must be a valid name (@pxref{Valid names}.The name provides a link to more information to be found in @xref{Labels (lbl)}. For example: @example R:r @end example @item type:label:cr Not only are the type and the label of the component given, but also the component cr. The type must be a valid name (@pxref{Valid names}.The name provides a link to more information to be found in @xref{Labels (lbl)}. For example: @example R:r:flow,r @end example @item type*n The name, together with the number @samp{n} of repetitions of the component, are given. This repetition only makes sense if the component has an even number of ports (@pxref{Port labels}); n copies of the component are concatenated with odd Named ports (@pxref{Port labels}) of the component being connected to the even Named ports of the previous |
︙ | ︙ | |||
3186 3187 3188 3189 3190 3191 3192 | @end enumerate Not each component @pxref{components} needs a label, only those which are explicitly labeled on the Bond Graph @pxref{Acausal bond graph (abg)}. @strong{MTT} checks whether all components labelled on the bond graph have labels and vice versa. | | > > > | | 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 | @end enumerate Not each component @pxref{components} needs a label, only those which are explicitly labeled on the Bond Graph @pxref{Acausal bond graph (abg)}. @strong{MTT} checks whether all components labelled on the bond graph have labels and vice versa. If no lbl file exists, @strong{MTT} will create a valid one for you; including a default set of arguments and crs for both simplae and compound components. If wish to create one to edit yourself, type @example mtt system_name lbl txt @end example An example lbl file (for the RC system is): @example %% Label file for system RC (RC_lbl.txt) %SUMMARY RC |
︙ | ︙ | |||
3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 | [out] SS external,external @end example The old-style lbl files (@pxref{Old-style labels (lbl)}) are NO LONGER supported -- you are encouraged to convert them ASAP. @menu * SS component labels :: * Other component labels :: * Component names:: * Component constitutive relationship:: * Component arguments:: * Parameter declarations:: | > | 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 | [out] SS external,external @end example The old-style lbl files (@pxref{Old-style labels (lbl)}) are NO LONGER supported -- you are encouraged to convert them ASAP. @menu * SS component labels :: * Other component labels :: * Component names:: * Component constitutive relationship:: * Component arguments:: * Parameter declarations:: |
︙ | ︙ | |||
3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 | `/' @item Port aliases: neither of the above @end itemize @menu * Port aliases:: * Parameter aliases:: * Component aliases:: @end menu @node Port aliases, Parameter aliases, Aliases, Aliases @comment node-name, next, previous, up @subsubsection Port aliases | > | 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 | `/' @item Port aliases: neither of the above @end itemize @menu * Port aliases:: * Parameter aliases:: * CR aliases:: * Component aliases:: @end menu @node Port aliases, Parameter aliases, Aliases, Aliases @comment node-name, next, previous, up @subsubsection Port aliases |
︙ | ︙ | |||
3522 3523 3524 3525 3526 3527 3528 | %ALIAS shaft|power Power_Shaft @end example can appear in the bond graph containing that component with one bond labeled either [shaft] or [power] or [Power_Shaft], one unlabeled vector bond pointing in and one unlabeled vector bond pointing out. | | | 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 | %ALIAS shaft|power Power_Shaft @end example can appear in the bond graph containing that component with one bond labeled either [shaft] or [power] or [Power_Shaft], one unlabeled vector bond pointing in and one unlabeled vector bond pointing out. @node Parameter aliases, CR aliases, Port aliases, Aliases @comment node-name, next, previous, up @subsubsection Parameter aliases @cindex parameter aliases @pindex parameter aliases Parameter aliases are of the form @example |
︙ | ︙ | |||
3546 3547 3548 3549 3550 3551 3552 | %ALIAS $4 flow,k_p @end example Assigns four symbolic parameters to the corresponding strings These four parameters (@code{$1}--@code{$4}) can then be used for parameter passing(@pxref{Parameter passing}). | > > > > > > > > > > > > > > > > > > > | | 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 | %ALIAS $4 flow,k_p @end example Assigns four symbolic parameters to the corresponding strings These four parameters (@code{$1}--@code{$4}) can then be used for parameter passing(@pxref{Parameter passing}). @node CR aliases, Component aliases, Parameter aliases, Aliases @comment node-name, next, previous, up @subsubsection CR aliases @cindex CR aliases @pindex CR aliases CR aliases are of the form @example %ALIAS $an actual parameter @end example where n is an integer (unique within the label file). For example @example %ALIAS $a1 lin @end example assigns the symbolic parameter to be lin. This parameter @code{$1} can then be used for passing a diofferent cr to the component (@pxref{Parameter passing}). @node Component aliases, , CR aliases, Aliases @comment node-name, next, previous, up @subsubsection Component aliases @cindex component aliases @pindex component aliases Component aliases are of the form @example |
︙ | ︙ | |||
4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 | # Generated by MTT at Mon Jun 16 15:10:17 BST 1997 # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ # %% Revision 1.66 2000/12/05 14:20:55 peterg # %% Added the c++ anf m CR info. # %% # %% Revision 1.65 2000/11/27 15:36:15 peterg # %% NOPAR --> NOTPAR # %% # %% Revision 1.64 2000/11/16 14:22:48 peterg | > > > | 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 | # Generated by MTT at Mon Jun 16 15:10:17 BST 1997 # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ # %% Revision 1.1 2001/06/04 08:18:52 gawthrop # %% Putting documentation under CVS # %% # %% Revision 1.66 2000/12/05 14:20:55 peterg # %% Added the c++ anf m CR info. # %% # %% Revision 1.65 2000/11/27 15:36:15 peterg # %% NOPAR --> NOTPAR # %% # %% Revision 1.64 2000/11/16 14:22:48 peterg |
︙ | ︙ |
Modified mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt from [3efefc2254] to [acb5d015d8].
1 2 3 4 5 6 7 8 9 10 11 12 | %SUMMARY CT: One-port thermal C component with T/Sdot bond %DESCRIPTION CR and parameters as for a one-port C component %DESCRIPTION Internally pseudo %DESCRIPTION Example label file entry: %DESCRIPTION % Component type CT %DESCRIPTION c lin effort,c %Port aliases %ALIAS in|out Thermal %CR aliases %ALIAS $1 effort,c_t | | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | %SUMMARY CT: One-port thermal C component with T/Sdot bond %DESCRIPTION CR and parameters as for a one-port C component %DESCRIPTION Internally pseudo %DESCRIPTION Example label file entry: %DESCRIPTION % Component type CT %DESCRIPTION c lin effort,c %Port aliases %ALIAS in|out Thermal %CR aliases %ALIAS $1 effort,c_t %ALIAS $a1 lin %% Label file for system CT (CT_lbl.txt) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% Revision 1.6 2001/06/13 17:10:26 gawthrop % %% Alias for the cr (ie ALIAS $1 lin) % %% % %% Revision 1.5 2001/06/11 15:09:18 gawthrop % %% Removed spurious parameter % %% % %% Revision 1.4 1998/07/22 11:28:15 peterg % %% Out as port alias % %% % %% Revision 1.3 1998/07/22 11:27:41 peterg |
︙ | ︙ |
Modified mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt from [9625af270a] to [5fc8affad0].
1 2 3 4 5 6 7 8 9 10 11 12 13 | %SUMMARY RT: Two port thermal resistance with T/Sdot bonds %DESCRIPTION Port [in]: T/Sdot power in %DESCRIPTION Port [out]: T/Sdot power out %DESCRIPTION CR and parameters as for a one-port R component %DESCRIPTION Internally pseudo bond graph %DESCRIPTION Example label file entry: %DESCRIPTION % Component type RT %DESCRIPTION r lin flow,r %ALIAS in ThermalIn %ALIAS out ThermalOut %ALIAS $1 flow,r | | > > > | 1 2 3 4 5 6 7 8 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 | %SUMMARY RT: Two port thermal resistance with T/Sdot bonds %DESCRIPTION Port [in]: T/Sdot power in %DESCRIPTION Port [out]: T/Sdot power out %DESCRIPTION CR and parameters as for a one-port R component %DESCRIPTION Internally pseudo bond graph %DESCRIPTION Example label file entry: %DESCRIPTION % Component type RT %DESCRIPTION r lin flow,r %ALIAS in ThermalIn %ALIAS out ThermalOut %ALIAS $1 flow,r %ALIAS $a1 lin %% Label file for system RT (RT_lbl.txt) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ % %% Revision 1.6 2001/06/13 17:10:26 gawthrop % %% Alias for the cr (ie ALIAS $1 lin) % %% % %% Revision 1.5 2001/06/11 19:51:08 gawthrop % %% Zapped spurious $1 alias % %% % %% Revision 1.4 1998/07/22 11:31:42 peterg % %% New port names % %% % %% Revision 1.3 1998/07/21 16:26:05 peterg |
︙ | ︙ |
Modified mttroot/mtt/lib/control/PPP/ppp_optimise.m from [7c6d6441ee] to [1dce967d13].
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.4 2001/05/26 15:46:38 gawthrop ## Updated to account for new nonlinear ppp ## ## Revision 1.3 2001/04/05 11:50:12 gawthrop ## Tidied up documentation + verbose mode ## ## Revision 1.2 2001/04/04 08:36:25 gawthrop | > > > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ###################################### ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ ## Revision 1.5 2001/06/06 07:54:38 gawthrop ## Further fixes to make nonlinear PPP work ... ## ## Revision 1.4 2001/05/26 15:46:38 gawthrop ## Updated to account for new nonlinear ppp ## ## Revision 1.3 2001/04/05 11:50:12 gawthrop ## Tidied up documentation + verbose mode ## ## Revision 1.2 2001/04/04 08:36:25 gawthrop |
︙ | ︙ | |||
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | error(mess); endif ## Use the last part of the simulation to compare with data y = y(1+N_data-n_data:N_data,:); y_par = y_par(1+N_data-n_data:N_data,:); ##Evaluate error, cost derivative J and cost second derivative JJ error = 0; J = zeros(n_th,1); JJ = zeros(n_th,n_th); for i = 1:n_y E = y(:,i) - y_0(:,i); # Error in ith output | > > > > > | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | error(mess); endif ## Use the last part of the simulation to compare with data y = y(1+N_data-n_data:N_data,:); y_par = y_par(1+N_data-n_data:N_data,:); if extras.verbose # Diagnostics printf("y and y_0\n"); [y,y_0] endif ##Evaluate error, cost derivative J and cost second derivative JJ error = 0; J = zeros(n_th,1); JJ = zeros(n_th,n_th); for i = 1:n_y E = y(:,i) - y_0(:,i); # Error in ith output |
︙ | ︙ |