Changeset 176 for branches/newlanguage/sample

Ignore:
Timestamp:
Mar 4, 2007, 1:56:54 AM (16 years ago)
Message:

Fix some new language syntax.

Location:
branches/newlanguage/sample
Files:
7 edited

Unmodified
Removed
• branches/newlanguage/sample/miscellaneous/sample_arrays.mso

 r125 EQUATIONS for i in [1 : Dimension] diff(Var1(1,i)) = Var2(1,i)/"s"; diff(Var1(1,i)) = Var2(1,i)/'s'; end diff(Var1(2:Dimension,:)) * "s" = Scalar*Var2(2:Dimension,:); diff(Var1(2:Dimension,:)) * 's' = Scalar*Var2(2:Dimension,:); exp(Scalar)*Var2 = sin(time * "180*grad/s"); exp(Scalar)*Var2 = sin(time * '180*grad/s'); end
• branches/newlanguage/sample/miscellaneous/sample_arrays2.mso

 r83 EQUATIONS diff(Var1(1,1))*"s" = Var2(1,2); diff(Var1(1,1))*'s' = Var2(1,2); for i in [2 : Dimension-1] diff(Var1(1,i))*"s" = Var2(1,i-1)+Var2(1,i+1); diff(Var1(1,i))*'s' = Var2(1,i-1)+Var2(1,i+1); end diff(Var1(1,Dimension))*"s" = Var2(1,Dimension); diff(Var1(2:Dimension,:))*"s" = Scalar*Var2(2:Dimension,:); diff(Var1(1,Dimension))*'s' = Var2(1,Dimension); diff(Var1(2:Dimension,:))*'s' = Scalar*Var2(2:Dimension,:); exp(Scalar)*Var2 = sin(time/"s"); exp(Scalar)*Var2 = sin(time*'rad/s'); end OPTIONS time = [0:0.1:2*3.1415]; TimeStep = 0.1; TimeEnd = 2*3.1415; end
• branches/newlanguage/sample/miscellaneous/sample_bc.mso

 r83 EQUATIONS "Balanço no Prato 0" diff(H0)*"s" = -V/(R+1); diff(x1(1))*"s" = V/H0 * (x1(1)-y1(1) + R * ((x1(2) - x1(1))/(R+1))); diff(H0)*'s' = -V/(R+1); diff(x1(1))*'s' = V/H0 * (x1(1)-y1(1) + R * ((x1(2) - x1(1))/(R+1))); "Balanço demais pratos" diff(x1(2:Np))*"s" = V/Hi * (y1(1:Np-1) - y1(2:Np) + (R * ( x1(3:Np+1) - x1(2:Np) ) / (R+1))); diff(x1(2:Np))*'s' = V/Hi * (y1(1:Np-1) - y1(2:Np) + (R * ( x1(3:Np+1) - x1(2:Np) ) / (R+1))); "Balanço último prato" diff(x1(Np+1))*"s" = V * ( y1(Np) - x1(Np+1) )/Hi; diff(x1(Np+1))*'s' = V * ( y1(Np) - x1(Np+1) )/Hi; x1  = 1 - x2; OPTIONS time = [0:0.01:0.1, 0.2:0.1:2.1]; integration = "index0"; #original, index0 or index 1 relativeAccuracy = 1e-6; absoluteAccuracy = 1e-8; #time = [0:0.01:0.1, 0.2:0.1:2.1]; TimeStep = 0.01; TimeEnd = 2.1; #integration = "index0"; #original, index0 or index 1 RelativeAccuracy = 1e-6; AbsoluteAccuracy = 1e-8; DAESolver = "dasslc"; # "mebdf" end
• branches/newlanguage/sample/miscellaneous/sample_calc_object.mso

 r83 Model CalcBasic PARAMETERS ext NoComps as Integer; outer NoComps as Integer; VARIABLES T    as temperature; z(NoComps) as fraction; r1 as Real(Unit="K*K"); r2 as Real(Unit="atm*K"); r1 as Real(Unit='K*K'); r2 as Real(Unit='atm*K'); r3 as Real; end Model Calc as CalcBasic PARAMETERS ext     obj as CalcObject; outer obj as Plugin; EQUATIONS FlowSheet CalcTest PARAMETERS obj     as CalcObject(File = "calcsample"); obj     as Plugin(File = "calcsample"); NoComps as Integer(Default = 5); SPECIFY #calc1.T = 100 * "K"; #calc1.P = 100 * "Pa"; #calc1.T = 100 * 'K'; #calc1.P = 100 * 'Pa'; calc1.z(1:NoComps-1) = 1/NoComps; calc1.r1 = 20000 * "K*K"; calc1.r2 = 10000 * "Pa*K"; calc1.r1 = 20000 * 'K*K'; calc1.r2 = 10000 * 'Pa*K'; calc1.r3 = 1; #calc2.T = 100 * "K"; #calc2.P = 100 * "Pa"; #calc2.T = 100 * 'K'; #calc2.P = 100 * 'Pa'; calc2.z(1:NoComps-1) = 1/NoComps; calc2.r1 = 20000 * "K*K"; calc2.r2 = 10000 * "Pa*K"; calc2.r1 = 20000 * 'K*K'; calc2.r2 = 10000 * 'Pa*K'; calc2.r3 = 1; OPTIONS relativeAccuracy = 1e-6; RelativeAccuracy = 1e-6; #mode = "steady"; end SPECIFY #calc2.T = 100 * "K"; #calc2.P = 100 * "Pa"; #calc2.T = 100 * 'K'; #calc2.P = 100 * 'Pa'; calc2.z(1:NoComps-1) = 1/NoComps; calc2.r1 = 20000 * "K*K"; calc2.r2 = 10000 * "Pa*K"; calc2.r1 = 20000 * 'K*K'; calc2.r2 = 10000 * 'Pa*K'; calc2.r3 = 1; OPTIONS relativeAccuracy = 1e-6; mode = "steady"; RelativeAccuracy = 1e-6; Dynamic = false; end
• branches/newlanguage/sample/miscellaneous/sample_car.mso

 r83 OPTIONS time = [0:0.01:3]; integration = "index0"; # "original"; TimeStart = 0; TimeStep = 0.01; TimeEnd = 3; #integration = "index0"; # "original"; #DAESolver = "mebdf"; relativeAccuracy = 1e-5; absoluteAccuracy = 1e-5; indVarAccuracy = 1e-3; RelativeAccuracy = 1e-5; AbsoluteAccuracy = 1e-5; #indVarAccuracy = 1e-3; end
• branches/newlanguage/sample/miscellaneous/sample_cstr_simple.mso

 r83 k0 as frequency; Ea as energy_mol (Brief = "Energia de Ativação"); R  as energy_mol; R  as entr_mol; VARIABLES rA as reaction_mol; rB as reaction_mol; Cps as cp_mol; # (Unit="cal/mol/K"); Cps as cp_mol; # (Unit='cal/mol/K'); T0 as temperature; "Constante de Reação" k=k0*exp(Ea/R*(1/436.15 - 1*"K"/T)); k=k0*exp(Ea/R*(1/(436.15*'K') - 1/T)); "Taxas de Reação" "Calor de Reação" HR=-(80*250)*"cal/mol"; HR=-(80*250)*'cal/mol'; "Cp da mistura" Cps=(0.5*250)*3;# *"cal/mol/K"; Cps=(0.5*250)*3*'J/mol/K'; "Balanço de Energia" "Temperatura da corrente de alimentação" T0= (40 + 273.15 + time*200/1000/"s") * "K"; T0= (40 + 273.15 + time*200/1000/'s') * 'K'; SET Fin = 0.125997903*"m^3/h"; Fout = 0.125997903*"m^3/h"; CA0=9.3652352*"mol/m^3"; CB0=0*"mol/m^3"; Fin = 0.125997903*'m^3/h'; Fout = 0.125997903*'m^3/h'; CA0=9.3652352*'mol/m^3'; CB0=0*'mol/m^3'; FA0 = Fin*CA0; FB0 = Fin*CB0; Tw = (140+273)*"K"; k0=0.8*"1/h"; #constante para T=436.15 K Ea=28960*"cal/mol"; R=1.98*"cal/mol/K"; U = 0 *"cal/m^2/K/s";#isolado A = 1*"m^2"; Tw = (140+273)*'K'; k0=0.8*'1/h'; #constante para T=436.15 K Ea=28960*'cal/mol'; R=1.98*'cal/mol/K'; U = 0 *'cal/m^2/K/s';#isolado A = 1*'m^2'; INITIAL T = (140 + 273) * "K"; V = 0.9*6*"m^3"; CA = 2*"mol/m^3"; CB = 6*"mol/m^3"; T = (140 + 273) * 'K'; V = 0.9*6*'m^3'; CA = 2*'mol/m^3'; CB = 6*'mol/m^3'; OPTIONS time = [0:10:1200]; TimeStep = 10; TimeEnd = 1200; end
• branches/newlanguage/sample/stage_separators/sample_flash.mso

 r124 EQUATIONS fl.OutletL.F = 400*sqrt(fl.Level/"m") * "kmol/h"; fl.OutletL.F = 400*sqrt(fl.Level/'m') * 'kmol/h'; SPECIFY s1.Outlet.F = 496.3 * "kmol/h"; s1.Outlet.T = 338 * "K"; s1.Outlet.P = 507.1 * "kPa"; s1.Outlet.F = 496.3 * 'kmol/h'; s1.Outlet.T = 338 * 'K'; s1.Outlet.P = 507.1 * 'kPa'; #s1.Outlet.v = 0.1380; s1.Outlet.z = [0.2379,0.3082,0.09958,0.1373,0.08872,0.1283]; fl.OutletV.F = 68.5 * "kmol/h"; Q = 0 * "kJ/h"; fl.OutletV.F = 68.5 * 'kmol/h'; Q = 0 * 'kJ/h'; SET fl.V = 2000 * "m^3"; fl.Across = 1 * "m^2"; fl.V = 2000 * 'm^3'; fl.Across = 1 * 'm^2'; INITIAL fl.OutletL.T = 338 *"K"; fl.Level = 1 * "m"; fl.OutletL.T = 338 * 'K'; fl.Level = 1 * 'm'; fl.OutletL.z(1) = 0.1; TimeStep = 0.1; TimeEnd = 20; TimeUnit = "h"; TimeUnit = 'h'; end SPECIFY s1.Outlet.F = 496.3 * "kmol/h"; s1.Outlet.T = 338 * "K"; s1.Outlet.P = 507.1 * "kPa"; s1.Outlet.F = 496.3 * 'kmol/h'; s1.Outlet.T = 338 * 'K'; s1.Outlet.P = 507.1 * 'kPa'; #s1.Outlet.v = 0.1380; s1.Outlet.z = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; fl.OutletL.P = 2.5 * "atm"; fl.OutletL.P = 2.5 * 'atm'; #Q = 0 * "kJ/h"; fl.OutletL.T = 315.06 * "K"; #Q = 0 * 'kJ/h'; fl.OutletL.T = 315.06 * 'K'; OPTIONS
Note: See TracChangeset for help on using the changeset viewer.