Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/conical.cr @@ -1,9 +1,9 @@ %% CR for conical tank example OPERATOR conical; %% State input. -FOR ALL rho,g,V_0,V LET - conical(rho,g,V_0,effort,1,V,state,1) = rho*g*(12*(V+V_0)/pi)^(1/3); +FOR ALL COMP, rho,g,V_0,V LET + conical(COMP, rho,g,V_0,effort,1,V,state,1) = rho*g*(12*(V+V_0)/pi)^(1/3); END;; Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/discharge.cr @@ -1,13 +1,13 @@ %% CR for pipe discharge OPERATOR discharge; %% Flow input -FOR ALL alpha,beta,F LET - discharge(alpha,beta,effort,1,F,flow,1) = beta*F^alpha; +FOR ALL COMP, alpha,beta,F LET + discharge(COMP, alpha,beta,effort,1,F,flow,1) = beta*F^alpha; %% Effort input -FOR ALL alpha,beta,P LET - discharge(alpha,beta,flow,1,P,effort,1) = (P/beta)^(1/alpha); +FOR ALL COMP, alpha,beta,P LET + discharge(COMP, alpha,beta,flow,1,P,effort,1) = (P/beta)^(1/alpha); END;; Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/idNonlinearTanks_rep.txt @@ -5,10 +5,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.1 2001/04/05 12:00:18 gawthrop +## Identification example +## ## Revision 1.1 2000/12/28 11:58:07 peterg ## Put under RCS ## ############################################################### @@ -15,12 +18,12 @@ mtt idNonlinearTanks abg tex # The system description mtt idNonlinearTanks cbg ps # The causal bond graph mtt idNonlinearTanks struc tex # The system structure mtt idNonlinearTanks sympar tex # The system parameters ## Uncomment the following lines or add others -## mtt idNonlinearTanks dae tex # The system dae -## mtt idNonlinearTanks ode tex # The system ode +##mtt idNonlinearTanks dae tex # The system dae + mtt idNonlinearTanks ode tex # The system ode ## mtt idNonlinearTanks sspar tex # Steady-state parameters ## mtt idNonlinearTanks ss tex # Steady state ## mtt idNonlinearTanks dm tex # Descriptor matrices (of linearised system) ## mtt idNonlinearTanks sm tex # State matrices (of linearised system) ## mtt idNonlinearTanks tf tex # Transfer function (of linearised system) @@ -28,9 +31,9 @@ ## mtt idNonlinearTanks simpar tex # Simulation parameters ## mtt idNonlinearTanks numpar tex # Numerical simulation parameters ## mtt idNonlinearTanks state tex # Simulation initial state ## mtt idNonlinearTanks input tex # Simulation input ## mtt idNonlinearTanks logic tex # Logic control - mtt -oct -s sidNonlinearTanks odeso ps # Simulation output - mtt -oct -i euler idNonlinearTanks ippp ps +## mtt -oct -s sidNonlinearTanks odeso ps # Simulation output + mtt -i euler idNonlinearTanks ident ps mtt idNonlinearTanks rep txt # This file Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sconical.cr @@ -2,20 +2,20 @@ in "conical.cr"; OPERATOR sconical; %% The actual port (1) -FOR ALL rho,g,V_0,V_0s,V,sV LET - sconical(rho,g,V_0,V_0s,effort,1, +FOR ALL COMP, rho,g,V_0,V_0s,V,sV LET + sconical(COMP, rho,g,V_0,V_0s,effort,1, V,state,1, sV,state,2) - = conical(rho,g,V_0,effort,1,V,state,1); + = conical(COMP, rho,g,V_0,effort,1,V,state,1); %% The sensitivity port (2) -FOR ALL rho,g,V_0,V_0s,V,sV LET - sconical(rho,g,V_0,V_0s,effort,2, +FOR ALL COMP, rho,g,V_0,V_0s,V,sV LET + sconical(COMP, rho,g,V_0,V_0s,effort,2, V,state,1, sV,state,2) - = df(conical(rho,g,V_0,effort,1,V,state,1),V) * sV - + df(conical(rho,g,V_0,effort,1,V,state,1),V_0)* V_0s; + = df(conical(COMP, rho,g,V_0,effort,1,V,state,1),V) * sV + + df(conical(COMP, rho,g,V_0,effort,1,V,state,1),V_0)* V_0s; END;; Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sdischarge.cr @@ -4,28 +4,28 @@ %% CR for non-linear pipe discharge %% Just do for flow input causality. in "discharge.cr"; -PROCEDURE l_discharge(alpha,beta,P); +PROCEDURE l_discharge(COMP, alpha,beta,P); BEGIN - result := sub({x=P},df(discharge(alpha,beta,flow,1,x,effort,1), x)); + result := sub({x=P},df(discharge(COMP, alpha,beta,flow,1,x,effort,1), x)); return result; END; OPERATOR sdischarge; %% The actual port (1) -- Pressure input -FOR ALL alpha,beta,alpha_s,beta_s,P,sP LET - sdischarge(alpha,beta,alpha_s,beta_s,flow,1, +FOR ALL COMP, alpha,beta,alpha_s,beta_s,P,sP LET + sdischarge(COMP, alpha,beta,alpha_s,beta_s,flow,1, P,effort,1, sP,effort,2) - = discharge(alpha,beta,flow,1,P,effort,1); + = discharge(COMP, alpha,beta,flow,1,P,effort,1); %% The sensitivity port (2) -- Pressure input -FOR ALL alpha,beta,alpha_s,beta_s,P,sP LET - sdischarge(alpha,beta,alpha_s,beta_s,flow,2, +FOR ALL COMP, alpha,beta,alpha_s,beta_s,P,sP LET + sdischarge(COMP, alpha,beta,alpha_s,beta_s,flow,2, P,effort,1, sP,effort,2) - = l_discharge(alpha,beta,P) * sP - + df(discharge(alpha,beta,flow,1,P,effort,1), alpha)* alpha_s - + df(discharge(alpha,beta,flow,1,P,effort,1), beta) * beta_s; + = l_discharge(COMP, alpha,beta,P) * sP + + df(discharge(COMP, alpha,beta,flow,1,P,effort,1), alpha)* alpha_s + + df(discharge(COMP, alpha,beta,flow,1,P,effort,1), beta) * beta_s; END;; Index: mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt +++ mttroot/mtt/lib/examples/Identification/idNonlinearTanks/sidNonlinearTanks_numpar.txt @@ -5,25 +5,28 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.1 2001/04/05 12:00:18 gawthrop +# %% Identification example +# %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ## Parameters ## States -v_1 = 0.5; # Tank 1 -v_2 = 0.25; # Tank 2 +v_1 = 2.0; # Tank 1 +v_2 = 1.0; # Tank 2 ## Tank parameters g = 1; #Gravity rho = 1; # sC,sNonlinearTanks -alpha = 1.5; +alpha = 1.0; ## Pipe parameters -beta = 1; +beta = 2.0; ## Sensitivity. v_1s = 0; # Tank 1 v_2s = 0; # Tank 2