Index: mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt +++ mttroot/mtt/lib/examples/ABG/SimpleGasTurbineABG/SimpleGasTurbineABG_numpar.txt @@ -4,10 +4,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.1 2000/12/28 16:55:29 peterg +# %% To RCS +# %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #Dummies alpha = 1; c_v = 1; @@ -50,12 +53,12 @@ %Equate pressures p_4 = p_1; p_2 = p_3; %Compute ss temperatures (isentropic) -t_2 = t_1*(p_2/p_1)^alpha; -t_4 = t_3*(p_4/p_3)^alpha; +t_2 = t_1*pow((p_2/p_1),alpha); +t_4 = t_3*pow((p_4/p_3),alpha); %Find the steady-state work output w_0 = c_p*(t_3-t_4) - c_p*(t_2-t_1); %Unit mass flow @@ -63,12 +66,12 @@ %Corresponding shaft speed omega_0 = mdot/k; %Compute the corresponding load resistance (to absorb that work) -r_l = w_0/(omega_0)^2; +r_l = w_0/pow((omega_0),2); %Compute shaft inertia to give unit time constant (j_s*r_l) j_s = r_l; %Find angular momentum to give shaft speed omega_0 mom_0 = omega_0*j_s; Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_input.txt @@ -4,10 +4,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.3 2003/06/06 06:38:02 gawthrop +## Made compatible with current MTT. +## ## Revision 1.2 2000/12/28 18:52:24 peterg ## Updated for new formats ## ## Revision 1.1 2000/12/28 17:09:55 peterg ## To RCS @@ -31,11 +34,11 @@ ## Solve for ca - a quadratic. a = k_3*e_3; #ca^2 b = k_1*e_1 + f_s; #ca^1 c = -c_0*f_s; -c_a = (-b + sqrt(b^2 - 4*a*c))/(2*a); +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); ## solve for c_b c_b = c_a*k_1*e_1/(f_s+k_2*e_2); @@ -46,11 +49,11 @@ #Thermal state x3 = c_p*t_s*v_r; #Steady-state input q needed to achieve steady-state t_s -q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*x1^2); +q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); ## The two inputs at steady-state u1 = f_s; u2 = q_s; Index: mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt +++ mttroot/mtt/lib/examples/Chemical/Reactor/Reactor_state.txt @@ -4,10 +4,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.3 2003/06/06 06:38:31 gawthrop +## Made compatible with current MTT. +## ## Revision 1.2 2000/12/28 18:52:25 peterg ## Updated for new formats ## ## Revision 1.1 2000/12/28 17:09:55 peterg ## To RCS @@ -31,11 +34,11 @@ ## Solve for ca - a quadratic. a = k_3*e_3; #ca^2 b = k_1*e_1 + f_s; #ca^1 c = -c_0*f_s; -c_a = (-b + sqrt(b^2 - 4*a*c))/(2*a); +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); ## solve for c_b c_b = c_a*k_1*e_1/(f_s+k_2*e_2); @@ -46,11 +49,11 @@ #Thermal state x3 = c_p*t_s*v_r; #Steady-state state q needed to achieve steady-state t_s -q_s = -((t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*x1^2); +q_s = -((t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); ## The two inputs at steady-state u1 = f_s; u2 = q_s; Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_input.txt @@ -4,10 +4,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 2003/06/06 06:38:44 gawthrop +## Made compatible with current MTT. +## ## Revision 1.1 2000/12/28 17:12:57 peterg ## To RCS ## ############################################################### @@ -28,11 +31,11 @@ ## Solve for ca - a quadratic. a = k_3*e_3; #ca^2 b = k_1*e_1 + f_s; #ca^1 c = -c_0*f_s; -c_a = (-b + sqrt(b^2 - 4*a*c))/(2*a); +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); ## solve for c_b c_b = c_a*k_1*e_1/(f_s+k_2*e_2); @@ -43,10 +46,10 @@ #Thermal state #x3 = c_p*t_s*v_r; #Steady-state input q needed to achieve steady-state t_s -q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*x1^2); +q_s = -( (t_0-t_s)*c_p*f_s + e_1*h_1*k_1*x1 + e_2*h_2*k_2*x2 + e_3*h_3*k_3*pow(x1,2)); # Set the inputs ## Removed by MTT on Thu Jun 5 14:13:24 BST 2003: mttu(1) = q_s + 0.1*q_s*(t>0.01); # q (ReactorTF) reactortf__t = q_s + 0.1*q_s*(t>0.01); # q (ReactorTF) Index: mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTF/ReactorTF_state.txt @@ -4,10 +4,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 2003/06/06 06:39:05 gawthrop +## Made compatible with current MTT. +## ## Revision 1.1 2000/12/28 17:12:57 peterg ## To RCS ## ############################################################### @@ -28,11 +31,11 @@ ## Solve for ca - a quadratic. a = k_3*e_3; #ca^2 b = k_1*e_1 + f_s; #ca^1 c = -c_0*f_s; -c_a = (-b + sqrt(b^2 - 4*a*c))/(2*a); +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); ## solve for c_b c_b = c_a*k_1*e_1/(f_s+k_2*e_2); Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_input.txt @@ -4,10 +4,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 2003/06/06 06:39:20 gawthrop +## Made compatible with current MTT. +## ## Revision 1.1 2000/12/28 17:19:08 peterg ## To RCS ## ############################################################### @@ -28,11 +31,11 @@ ## Solve for ca - a quadratic. a = k_3*e_3; #ca^2 b = k_1*e_1 + f_s; #ca^1 c = -c_0*f_s; -c_a = (-b + sqrt(b^2 - 4*a*c))/(2*a); +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); ## solve for c_b c_b = c_a*k_1*e_1/(f_s+k_2*e_2); Index: mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt ================================================================== --- mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt +++ mttroot/mtt/lib/examples/Chemical/ReactorTQ/ReactorTQ_state.txt @@ -4,10 +4,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.2 2003/06/06 06:39:39 gawthrop +## Made compatible with current MTT. +## ## Revision 1.1 2000/12/28 17:19:08 peterg ## To RCS ## ############################################################### @@ -28,11 +31,11 @@ ## Solve for ca - a quadratic. a = k_3*e_3; #ca^2 b = k_1*e_1 + f_s; #ca^1 c = -c_0*f_s; -c_a = (-b + sqrt(b^2 - 4*a*c))/(2*a); +c_a = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a); ## solve for c_b c_b = c_a*k_1*e_1/(f_s+k_2*e_2); Index: mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt +++ mttroot/mtt/lib/examples/Control/PPP/Linear/PPPCantileverBeam/PPPCantileverBeam_numpar.txt @@ -5,10 +5,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.1 2000/12/28 17:27:26 peterg +# %% To RCS +# %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Parameters N = 16; BeamLength = 0.58; @@ -15,15 +18,15 @@ BeamWidth = 0.05; BeamThickness = 0.005; Youngs = 1e6; Density = 1e5; Area = BeamWidth*BeamThickness; -AreaMoment = (BeamThickness*BeamWidth^2)/12; +AreaMoment = (BeamThickness*pow(BeamWidth,2))/12; EI= 58.6957 # from Reza rhoA= 0.7989 # from Reza dz = BeamLength/N; # Incremental length dm = rhoA*dz; # Incremental mass dk = EI/dz; # Incremental stiffness dr = 1e-2; # Damping Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/CantileverBeam/CantileverBeam_numpar.txt @@ -5,10 +5,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.1 2000/12/28 17:58:27 peterg +# %% To RCS +# %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Parameters N = 21; BeamLength = 0.58; @@ -15,21 +18,21 @@ BeamWidth = 0.05; BeamThickness = 0.005; Youngs = 68.94e9; Density = 2712.8; Area = BeamWidth*BeamThickness; -AreaMoment = (BeamWidth*BeamThickness^3)/12; +AreaMoment = (BeamWidth*pow(BeamThickness,3))/12; EI = Youngs*AreaMoment; rhoA = Density*Area; dz = BeamLength/N; # Incremental length dm = rhoA*dz; # Incremental mass dk = EI/dz; # Incremental stiffness dr = 0; # Damping -K = sqrt(EI/rhoA)/BeamLength^2; # Normalising factor +K = sqrt(EI/rhoA)/pow(BeamLength,2); # Normalising factor # EI= 58.6957 # from Reza # rhoA= 0.7989 # from Reza Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/Beams/PinnedBeam/PinnedBeam_numpar.txt @@ -5,10 +5,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.2 2003/06/11 16:03:06 gawthrop +# %% Updated examples for latest MTT. +# %% # %% Revision 1.1 2000/12/28 17:59:05 peterg # %% To RCS # %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -20,15 +23,15 @@ BeamWidth = 0.05; BeamThickness = 0.003; Youngs = 68.94e9; Density = 2712.8; Area = BeamWidth*BeamThickness; -AreaMoment = (BeamWidth*BeamThickness^3)/12; +AreaMoment = (BeamWidth*pow(BeamThickness,3))/12; EI = Youngs*AreaMoment; rhoA = Density*Area; ## Segments dz = BeamLength/Lumps; # Incremental length dm = rhoA*dz; # Incremental mass dk = EI/dz; # Incremental stiffness dr = 0; # Damping Index: mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt ================================================================== --- mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt +++ mttroot/mtt/lib/examples/Mechanical/Mechanical-1D/NonlinearMSD/NonlinearMSD_input.txt @@ -4,9 +4,8 @@ ## System NonlinearMSD, representation input, language txt; ## File NonlinearMSD_input.txt; ## Generated by MTT on Thu Mar 7 10:50:46 GMT 2002; ## First term is the equilibrium input; last term is the perturbation input. -## Removed by MTT on Tue Jun 10 16:50:53 BST 2003: NonlinearMSD_yu = k*(l^2)*cos(eta/2)*2*(sin(eta/2)-sin(alpha/2)) + 1e-2; -nonlinearmsd__yu = k*(l^2)*cos(eta/2)*2*(sin(eta/2)-sin(alpha/2)) + 1e-2; +nonlinearmsd__yu = k*(pow(l,2))*cos(eta/2)*2*(sin(eta/2)-sin(alpha/2)) + 1e-2; Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_numpar.txt @@ -4,10 +4,13 @@ # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% Version control history # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # %% $Id$ # %% $Log$ +# %% Revision 1.1 2000/12/28 18:08:28 peterg +# %% To RCS +# %% # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% # Parameters c_p = 1005.0; c_v = 718.0; @@ -32,12 +35,12 @@ %Equate pressures p_4 = p_1; p_2 = p_3; %Compute ss temperatures (isentropic) -t_2 = t_1*(p_2/p_1)^alpha; -t_4 = t_3*(p_4/p_3)^alpha; +t_2 = t_1*pow((p_2/p_1),alpha); +t_4 = t_3*pow((p_4/p_3),alpha); %Find the steady-state work output w_0 = c_p*(t_3-t_4) - c_p*(t_2-t_1); %Unit mass flow @@ -45,12 +48,12 @@ %Corresponding shaft speed omega_0 = mdot/k; %Compute the corresponding load resistance (to absorb that work) -r_l = w_0/(omega_0)^2; +r_l = w_0/pow((omega_0),2); %Compute shaft inertia to give unit time constant (j_s*r_l) j_s = r_l; %Find angular momentum to give shaft speed omega_0 mom_0 = omega_0*j_s; Index: mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r ================================================================== --- mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r +++ mttroot/mtt/lib/examples/Thermal/GasTurbines/SimpleGasTurbine/SimpleGasTurbine_sspar.r @@ -4,10 +4,13 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % $Id$ % % $Log$ +% % Revision 1.1 2000/12/28 18:08:28 peterg +% % To RCS +% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Find stored mass to give combustion chamber pressure p_3 (at % temperature t_3 m_c := (p_3*v_c)/(t_3*r); @@ -15,18 +18,18 @@ %Equate pressures p_4 := p_1; p_2 := p_3; %Compute ss temperatures (isentropic) -t_2 := t_1*(p_2/p_1)^alpha; -t_4 := t_3*(p_4/p_3)^alpha; +t_2 := t_1*pow((p_2/p_1),alpha); +t_4 := t_3*pow((p_4/p_3),alpha); %Find the steady-state work output w_0 := c_p*(t_3-t_4) - c_p*(t_2-t_1); %Compute the corresponding load resistance (to absorb that work) -r_l := w_0/(omega_0)^2; +r_l := w_0/pow((omega_0),2); %Unit mass flow mdot := 1; %Corresponding shaft speed