Index: mttroot/mtt/lib/comp/simple/AE_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/AE_eqn.m +++ mttroot/mtt/lib/comp/simple/AE_eqn.m @@ -5,10 +5,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.4 1996/09/10 10:10:41 peter +% %% Now uses eqaution.m to format the equation. +% %% % %% Revision 1.3 1996/08/30 19:03:10 peter % %% Added argument check. % %% Added extra name argument. % %% % %% Revision 1.2 1996/08/30 13:23:11 peter @@ -54,15 +57,15 @@ outport = 1; inport = 2; end -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("AE",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); Index: mttroot/mtt/lib/comp/simple/AF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/AF_eqn.m +++ mttroot/mtt/lib/comp/simple/AF_eqn.m @@ -13,10 +13,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.3 1996/09/12 19:29:35 peter +% %% Use new equation method. +% %% % %% Revision 1.2 1996/09/11 13:35:14 peter % %% New equation.m method used. % %% % %% Revision 1.1 1996/08/30 18:38:57 peter % %% Initial revision @@ -59,15 +62,15 @@ outport = 1; inport = 2; end -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("AF",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); Index: mttroot/mtt/lib/comp/simple/C_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/C_eqn.m +++ mttroot/mtt/lib/comp/simple/C_eqn.m @@ -13,10 +13,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 1997/04/09 13:00:28 peterg +% %% *** empty log message *** +% %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright (c) P.J. Gawthrop, 1996. @@ -25,14 +28,14 @@ eqnfile = 'stdout'; end; % Unicausal version CorI = 1; -structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, ... +structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, \ CorI, eqnfile); Index: mttroot/mtt/lib/comp/simple/EMTF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/EMTF_eqn.m +++ mttroot/mtt/lib/comp/simple/EMTF_eqn.m @@ -5,10 +5,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 2000/12/28 11:45:48 peterg +% %% *** empty log message *** +% %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if nargin<8 @@ -41,11 +44,11 @@ inbond = bond_number([2 3]); outport = 1; inport = [2;3]; end; -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("EMTF",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); % Flow outcause = -1; @@ -60,11 +63,11 @@ inbond = bond_number([2 3]); outport = 1; inport = [2;3]; end; -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("EMTF",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); % Modulation: flow on port 3 is always zero fprintf(eqnfile, '%s := 0;\n', ... Index: mttroot/mtt/lib/comp/simple/FMR_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/FMR_eqn.m +++ mttroot/mtt/lib/comp/simple/FMR_eqn.m @@ -13,10 +13,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.3 1996/09/12 19:30:31 peter +% %% Updated to use new eqaution.m +% %% % %% Revision 1.2 1996/08/30 18:35:43 peter % %% New name argument added. % %% % %% Revision 1.1 1996/08/30 16:38:25 peter % %% Initial revision @@ -72,11 +75,11 @@ outcause = -1; else % Effort out outcause = 1; end; incause = [-outcause; -1]; % Flow input on port 2 - eqn = equation(name,cr,args,outnumber,outcause,outport, ... + eqn = equation("FMR",name,cr,args,outnumber,outcause,outport, ... bond_number,incause,1:ports); fprintf(eqnfile, '%s',eqn); else % Modulation is output outport = 2; @@ -83,11 +86,11 @@ outcause = -1; outnumber = bond_number(2); innumber = bond_number(1)*[1;1]; incause = [1; -1]; % Effort and flow on port 1 inports = [1; 1]; - eqn = equation(name,cr,args,outnumber,outcause,outport, ... + eqn = equation("FMR",name,cr,args,outnumber,outcause,outport, ... innumber,incause,inports); fprintf(eqnfile, '%s',eqn); end; end; Index: mttroot/mtt/lib/comp/simple/GY_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/GY_eqn.m +++ mttroot/mtt/lib/comp/simple/GY_eqn.m @@ -13,10 +13,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.1 2000/12/28 11:51:06 peterg +% %% Initial revision +% %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Copyright (c) P.J. Gawthrop, 1996. @@ -48,11 +51,11 @@ inport = 2; outcause = 1; incause = -1; end; -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("GY",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); % Flow-effort if f_1==-1 @@ -69,9 +72,9 @@ inport = 2; outcause = -1; incause = 1; end; -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("GY",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); Index: mttroot/mtt/lib/comp/simple/R_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/R_eqn.m +++ mttroot/mtt/lib/comp/simple/R_eqn.m @@ -13,10 +13,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.4 1996/09/12 19:28:11 peter +% %% Added defaults (with no constitutive relationship) +% %% % %% Revision 1.3 1996/09/12 16:40:45 peter % %% Now does a default (when no constitutive relationship) with a unit % %% constitutive relationship on each port. % %% % %% Revision 1.2 1996/09/12 13:12:04 peter @@ -50,11 +53,11 @@ incause = bonds(outport,1); inport = outport; inbond = outnumber; end; - eqn = equation(name,cr,args,outnumber,outcause,outport, ... + eqn = equation("R",name,cr,args,outnumber,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); end; Index: mttroot/mtt/lib/comp/simple/TF_eqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/TF_eqn.m +++ mttroot/mtt/lib/comp/simple/TF_eqn.m @@ -4,10 +4,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.2 1996/09/10 10:41:37 peter +% %% Now used equation.m to write the equations. +% %% % %% Revision 1.1 1996/08/19 09:05:04 peter % %% Initial revision % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -41,11 +44,11 @@ inbond = bond_number(2); outport = 1; inport = 2; end; -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("TF",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); % Flow outcause = -1; @@ -60,11 +63,11 @@ inbond = bond_number(2); outport = 1; inport = 2; end; -eqn = equation(name,cr,args,outbond,outcause,outport, ... +eqn = equation("TF",name,cr,args,outbond,outcause,outport, ... inbond,incause,inport); fprintf(eqnfile, '%s',eqn); Index: mttroot/mtt/lib/comp/simple/cieqn.m ================================================================== --- mttroot/mtt/lib/comp/simple/cieqn.m +++ mttroot/mtt/lib/comp/simple/cieqn.m @@ -14,10 +14,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.3 1998/06/29 13:05:08 peterg +% %% Changed cieqn so that sign ignored. +% %% % %% Revision 1.2 1997/12/04 13:48:00 peterg % %% Added sign info to take account of direction of bonds. % %% % %% Revision 1.1 1997/04/09 10:18:26 peterg % %% Initial revision @@ -28,15 +31,22 @@ % Copyright (c) P.J. Gawthrop, 1996. if nargin<8 eqnfile = 'stdout'; end; + +if (CorI==1) + comp_type = "C"; +else + comp_type = "I"; +endif CorIorISW = CorI; if CorIorISW==0 % ISW CorI = -1; end; + % Find the number of ports [ports,junk] = size(bonds); % Right-hand side causality @@ -64,11 +74,11 @@ % Print equation of form xdot = input - with sign fprintf(eqnfile, 'MTTdX(%1.0f,1) := %s%s;\n', state, sign, ... varname(name,LHS_number,-LHS_cause)); % Print equation of form output = CR (state) - eqn = equation(name,cr,args,LHS_number,LHS_cause,outport, ... + eqn = equation(comp_type,name,cr,args,LHS_number,LHS_cause,outport, ... bond_number,state_cause,1:ports); fprintf(eqnfile, '%s',eqn); structure(1) = state; else % Derivative causality nonstate = structure(2)+1; @@ -81,11 +91,11 @@ % Print equation of form MTTz(i) = z_i fprintf(eqnfile, 'MTTz(%1.0f,1) := %s;\n', nonstate, ... varname(name,LHS_number, state_cause)); % Print equation of form z_i = CR(input) - eqn = equation(name,cr,args,LHS_number,state_cause, outport, ... + eqn = equation(comp_type,name,cr,args,LHS_number,state_cause, outport, ... bond_number,RHS_cause,1:ports); fprintf(eqnfile, '%s',eqn); structure(2) = nonstate; end; end;