Index: mttroot/mtt/bin/trans/lbl2args_txt2out ================================================================== --- mttroot/mtt/bin/trans/lbl2args_txt2out +++ mttroot/mtt/bin/trans/lbl2args_txt2out @@ -8,19 +8,23 @@ ############################################################### ## 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,"\\$")==1){ + if (match($2,"\\$[0-9]")==1) ## Test if its a argument alias + { i = substr($2,2); arg[i] = $3 N++ } } Index: mttroot/mtt/bin/trans/m/subs_arg.m ================================================================== --- mttroot/mtt/bin/trans/m/subs_arg.m +++ mttroot/mtt/bin/trans/m/subs_arg.m @@ -15,10 +15,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% 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. @@ -47,12 +50,19 @@ 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); - i=0; + ## 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 Index: mttroot/mtt/doc/mtt.texi ================================================================== --- mttroot/mtt/doc/mtt.texi +++ mttroot/mtt/doc/mtt.texi @@ -14,10 +14,13 @@ @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 @@ -263,11 +266,11 @@ @titlepage @title MTT: Model Transformation Tools @subtitle December 2000 -@subtitle For version 4.8. +@subtitle For version 4.9. @author Peter Gawthrop @page @vskip 0pt plus 1filll Copyright @copyright{} 1996,1997,1998,1999,2000 Peter J. Gawthrop @@ -508,10 +511,11 @@ Aliases * Port aliases:: * Parameter aliases:: +* CR aliases:: * Component aliases:: Old-style labels (lbl) * SS component labels (old-style):: @@ -2627,10 +2631,18 @@ 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 @@ -3188,12 +3200,15 @@ 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. If -wish to create one to edit yourself, type +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 @@ -3228,10 +3243,11 @@ @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:: @@ -3463,10 +3479,11 @@ @end itemize @menu * Port aliases:: * Parameter aliases:: +* CR aliases:: * Component aliases:: @end menu @node Port aliases, Parameter aliases, Aliases, Aliases @@ -3524,11 +3541,11 @@ 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, Component aliases, Port aliases, Aliases +@node Parameter aliases, CR aliases, Port aliases, Aliases @comment node-name, next, previous, up @subsubsection Parameter aliases @cindex parameter aliases @pindex parameter aliases @@ -3548,11 +3565,30 @@ 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 Component aliases, , Parameter aliases, Aliases +@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 @@ -4161,10 +4197,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% 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 Index: mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/CT/CT_lbl.txt @@ -8,19 +8,22 @@ %Port aliases %ALIAS in|out Thermal %CR aliases %ALIAS $1 effort,c_t -%ALIAS $1 lin +%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 Index: mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt ================================================================== --- mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt +++ mttroot/mtt/lib/comp/compound/Thermal/RT/RT_lbl.txt @@ -9,20 +9,23 @@ %ALIAS in ThermalIn %ALIAS out ThermalOut %ALIAS $1 flow,r -%ALIAS $1 lin +%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 Index: mttroot/mtt/lib/control/PPP/ppp_optimise.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_optimise.m +++ mttroot/mtt/lib/control/PPP/ppp_optimise.m @@ -26,10 +26,13 @@ ############################################################### ## 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 @@ -110,10 +113,15 @@ ## 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);