- Timestamp:
- Mar 4, 2007, 1:56:54 AM (17 years ago)
- Location:
- branches/newlanguage
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/newlanguage/eml/controllers/PIDIncr.mso
r74 r176 71 71 VARIABLES 72 72 73 dderivTerm as control_signal (Brief="Derivative term",Unit= "1/s", Default=0);74 dFilt as control_signal (Brief="Derivative term filtered", Default=0.5,Unit= "1/s");75 error as control_signal (Brief="Error definition for proportional term",Unit= "1/s");76 errorD as control_signal (Brief="Error definition for derivative term",Unit= "1/s");73 dderivTerm as control_signal (Brief="Derivative term",Unit='1/s', Default=0); 74 dFilt as control_signal (Brief="Derivative term filtered", Default=0.5,Unit='1/s'); 75 error as control_signal (Brief="Error definition for proportional term",Unit='1/s'); 76 errorD as control_signal (Brief="Error definition for derivative term",Unit='1/s'); 77 77 errorI as control_signal (Brief="Error definition for integral term"); 78 78 inputFilt as control_signal (Brief="Filtered input"); 79 dintTerm as control_signal (Brief="Integral term", Default=0,Unit= "1/s");80 doutp as control_signal (Brief="Sum of proportional, integral and derivative terms",Unit= "1/s");79 dintTerm as control_signal (Brief="Integral term", Default=0,Unit='1/s'); 80 doutp as control_signal (Brief="Sum of proportional, integral and derivative terms",Unit='1/s'); 81 81 outps as control_signal (Brief="Variable outp scaled between -1 and 1"); 82 82 outp as control_signal (Brief="Variable outp"); 83 dpropTerm as control_signal (Brief="Proportional term", Default=0,Unit= "1/s");83 dpropTerm as control_signal (Brief="Proportional term", Default=0,Unit='1/s'); 84 84 setPointFilt as control_signal (Brief="Filtered setPoint", Default=0); 85 85 … … 163 163 INITIAL 164 164 Ports.output = Parameters.bias; 165 diff(Internal.dFilt) = 0 *"1/s^2";166 diff(Internal.inputFilt)=0 *"1/s";167 diff(Internal.setPointFilt)=0 *"1/s";165 diff(Internal.dFilt) = 0/'s^2'; 166 diff(Internal.inputFilt)=0/'s'; 167 diff(Internal.setPointFilt)=0/'s'; 168 168 end 169 169 … … 200 200 201 201 "Sum of proportional, integral and derivative terms" 202 Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1 *"1/s" + Internal.dderivTerm)*"s");202 Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s'); 203 203 204 204 end … … 236 236 237 237 "Sum of proportional, integral and derivative terms" 238 Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1 *"1/s" + Internal.dderivTerm)*"s");238 Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s'); 239 239 240 240 end … … 298 298 299 299 "Sum of proportional, integral and derivative terms" 300 Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1 *"1/s" + Internal.dderivTerm)*"s");300 Internal.doutp = Options.action*(Parameters.gain*(Internal.dpropTerm + Internal.dintTerm)*(1/'s' + Internal.dderivTerm)*'s'); 301 301 302 302 if abs(Internal.outps)>1 and (Options.action*sign(Internal.outps)*Internal.errorI)>0 then -
branches/newlanguage/eml/controllers/PIDs.mso
r74 r176 159 159 INITIAL 160 160 Internal.intTerm = 0; 161 diff(Internal.dFilt) = 0 *"1/s";162 diff(Internal.inputFilt) = 0 *"1/s";163 diff(Internal.setPointFilt) = 0 *"1/s";161 diff(Internal.dFilt) = 0/'s'; 162 diff(Internal.inputFilt) = 0/'s'; 163 diff(Internal.setPointFilt) = 0/'s'; 164 164 end 165 165 -
branches/newlanguage/eml/controllers/iae.mso
r74 r176 36 36 VARIABLES 37 37 input as Real (Brief="input signal"); 38 output as Real (Brief="output signal", Unit= "s");38 output as Real (Brief="output signal", Unit='s'); 39 39 setPoint as Real (Brief="setpoint"); 40 40 absError as Real (Brief="absolute error"); … … 49 49 50 50 INITIAL 51 output=0* "s";51 output=0*'s'; 52 52 53 53 end -
branches/newlanguage/eml/controllers/ise.mso
r74 r176 35 35 VARIABLES 36 36 input as Real (Brief="input signal"); 37 output as Real (Brief="output signal", Unit= "s");37 output as Real (Brief="output signal", Unit='s'); 38 38 setPoint as Real (Brief="setpoint"); 39 39 sqError as Real (Brief="error^2"); … … 48 48 49 49 INITIAL 50 output=0* "s";50 output=0*'s'; 51 51 52 52 end -
branches/newlanguage/eml/controllers/lag_1.mso
r74 r176 34 34 PARAMETERS 35 35 gain as positive (Brief="model gain"); 36 tau as positive (Brief="model time constant", Unit= "s");36 tau as positive (Brief="model time constant", Unit='s'); 37 37 38 38 VARIABLES … … 46 46 47 47 INITIAL 48 diff(output)=0 *"1/s";48 diff(output)=0/'s'; 49 49 50 50 end -
branches/newlanguage/eml/controllers/lead_lag.mso
r74 r176 35 35 PARAMETERS 36 36 gain as positive (Brief="model gain"); 37 beta as positive (Brief="lead time constant", Unit= "s");38 alpha as positive (Brief="lag time constant", Unit= "s");37 beta as positive (Brief="lead time constant", Unit='s'); 38 alpha as positive (Brief="lag time constant", Unit='s'); 39 39 40 40 VARIABLES … … 52 52 53 53 INITIAL 54 diff(aux)= 0 * "1/s";54 diff(aux)= 0/'s'; 55 55 56 56 end -
branches/newlanguage/eml/heat_exchangers/DoublePipe.mso
r168 r176 30 30 PARAMETERS 31 31 32 outer PP as Plugin (Brief="External Physical Properties" );32 outer PP as Plugin (Brief="External Physical Properties", Type="PP"); 33 33 outer NComp as Integer (Brief="Number of Components"); 34 34 -
branches/newlanguage/eml/heat_exchangers/HeatExchangerSimplified.mso
r168 r176 29 29 30 30 PARAMETERS 31 outer PP as Plugin (Brief="External Physical Properties" );31 outer PP as Plugin (Brief="External Physical Properties", Type="PP"); 32 32 outer NComp as Integer (Brief="Number of Components"); 33 33 -
branches/newlanguage/eml/heat_exchangers/Mheatex.mso
r168 r176 43 43 PARAMETERS 44 44 45 outer PP as Plugin (Brief="Physical Properties" );45 outer PP as Plugin (Brief="Physical Properties", Type="PP"); 46 46 outer NComp as Integer (Brief="Number of Components"); 47 47 FlowDirection as Switcher(Brief="Flow Direction",Valid=["counter","cocurrent"],Default="cocurrent"); -
branches/newlanguage/eml/heat_exchangers/heater.mso
r168 r176 39 39 40 40 PARAMETERS 41 outer PP as Plugin (Brief="Physical Properties" );41 outer PP as Plugin (Brief="Physical Properties", Type="PP"); 42 42 outer NComp as Integer (Brief="Number of Components"); 43 43 Ninlet as Integer (Brief="Number of Inlet Streams",Lower=1); -
branches/newlanguage/eml/mixers_splitters/mixer.mso
r76 r176 35 35 using "stage_separators/flash"; 36 36 37 Model mixer as flash_ Steady37 Model mixer as flash_steady 38 38 PARAMETERS 39 extNComp as Integer (Brief = "Number of chemical components", Lower = 1);40 Ninlet as Integer (Brief = "Number of Inlet Streams", Lower = 1, Default = 2);39 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 40 Ninlet as Integer (Brief = "Number of Inlet Streams", Lower = 1, Default = 2); 41 41 42 42 VARIABLES 43 in Inlet_mixer(Ninlet) as stream ; #(Brief = "Inlet streams", Lower = 1);44 out Outlet as stream ; #(Brief = "Outlet stream", Default = 1, Lower = 1, Upper = 1);45 out Out_int as stream ; #(Brief = "Intermediate Outlet stream", Default = 1, Lower = 1, Upper = 1);43 in Inlet_mixer(Ninlet) as stream (Brief = "Inlet streams"); 44 out Outlet as stream (Brief = "Outlet stream"); 45 out Out_int as stream (Brief = "Intermediate Outlet stream"); 46 46 zeroQ as heat_rate (Brief="No Heat rate supplied"); 47 47 … … 82 82 Outlet.P = Inlet.P; 83 83 84 zeroQ = 0* "kW";84 zeroQ = 0*'kW'; 85 85 86 86 end -
branches/newlanguage/eml/mixers_splitters/sepComp.mso
r175 r176 54 54 PARAMETERS 55 55 56 outer PP as Plugin (Brief = "External Physical Properties" );56 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 57 57 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 58 58 NOutlet as Integer (Brief = "Number of Outlet Streams", Lower = 1); … … 119 119 PARAMETERS 120 120 121 outer PP as Plugin (Brief = "External Physical Properties" );121 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 122 122 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 123 123 mainComp as Integer (Brief = "Component specified", Default = 1, Lower = 1); -
branches/newlanguage/eml/pressure_changers/compressor.mso
r77 r176 28 28 using "pressure_changers/flux_machine_basic"; 29 29 30 Model centrifugal_compressor as flux_machine_basic_ TP30 Model centrifugal_compressor as flux_machine_basic_PH 31 31 32 32 PARAMETERS 33 ext PP as CalcObject (Brief = "External Physical Properties");34 extNComp as Integer (Brief = "Number of chemical components", Lower = 1);33 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 34 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 35 35 Effs as positive (Default = 0.72, Brief = "Isentropic efficiency", Lower = 0, Upper = 1); 36 R as positive (Default = 8.31451, Brief = "Constant of Gases", Unit= "kJ/kmol/K");36 R as positive (Default = 8.31451, Brief = "Constant of Gases", Unit= 'kJ/kmol/K'); 37 37 Mw(NComp) as molweight (Brief = "Molar Weight"); 38 38 … … 40 40 n as positive (Brief = "Politropic Coefficient"); 41 41 k as positive (Brief = "Isentropic Coefficient"); 42 Cp as cp_mol (Brief = "Heat Capacity", Unit = "kJ/(kmol*K)");43 Cv as cv_mol (Brief = "Heat Capacity", Unit = "kJ/(kmol*K)");44 Pdiff as press_delta (Brief = "Pressure Increase", Unit= "kPa");42 Cp as cp_mol (Brief = "Heat Capacity", Unit = 'kJ/(kmol*K)'); 43 Cv as cv_mol (Brief = "Heat Capacity", Unit = 'kJ/(kmol*K)'); 44 Pdiff as press_delta (Brief = "Pressure Increase", Unit='kPa'); 45 45 Pratio as positive (Brief = "Pressure Ratio"); 46 Wp as energy_mol (Brief = "Politropic Head", Unit = "kJ/kmol");47 Ws as energy_mol (Brief = "Isentropic Head", Unit = "kJ/kmol");46 Wp as energy_mol (Brief = "Politropic Head", Unit = 'kJ/kmol'); 47 Ws as energy_mol (Brief = "Isentropic Head", Unit = 'kJ/kmol'); 48 48 Tiso as temperature (Brief = "Isentropic Temperature"); 49 49 Effp as positive (Brief = "Politropic efficiency", Lower = 0, Upper = 1); 50 FPower as power (Brief = "Fluid Power", Unit= "kW");50 FPower as power (Brief = "Fluid Power", Unit='kW'); 51 51 Mwm as molweight (Brief = "Mixture Molar Weight"); 52 52 -
branches/newlanguage/eml/pressure_changers/flux_machine_basic.mso
r77 r176 35 35 end 36 36 37 Model flux_machine_basic_ TP37 Model flux_machine_basic_PH 38 38 VARIABLES 39 39 in Inlet as stream; 40 out Outlet as stream TP;40 out Outlet as streamPH; 41 41 42 42 end -
branches/newlanguage/eml/pressure_changers/pump.mso
r125 r176 33 33 34 34 PARAMETERS 35 outer PP as Plugin (Brief = "External Physical Properties" );35 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 36 36 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 37 37 Mw(NComp) as molweight (Brief = "Molar Weight"); 38 38 Eff as positive (Default = 0.72, Brief = "Pump Efficiency"); 39 39 Meff as positive (Default = 0.95, Brief = "Brake Efficiency"); 40 Beta as positive (Default = 0, Brief = "Volumetric Expansivity", Unit = "1/K");40 Beta as positive (Default = 0, Brief = "Volumetric Expansivity", Unit = '1/K'); 41 41 g as acceleration (Brief = "Gravity Acceleration", Default = 9.81); 42 42 N as vel_angular (Brief = "Rotation", Default = 100); … … 44 44 45 45 VARIABLES 46 rho as dens_mass (Brief = "Specific Mass", Unit= "kg/m^3");47 Cp as cp_mol (Brief = "Heat Capacity", Unit= "kJ/kmol/K");48 FPower as power (Brief = "Fluid Power", Unit= "kW");49 BPower as power (Brief = "Brake Power",Unit= "kW");50 EPower as power (Brief = "Eletrical Potency", Unit= "kW");51 Pdiff as press_delta (Brief = "Pressure Increase", Unit= "kPa");46 rho as dens_mass (Brief = "Specific Mass", Unit='kg/m^3'); 47 Cp as cp_mol (Brief = "Heat Capacity", Unit='kJ/kmol/K'); 48 FPower as power (Brief = "Fluid Power", Unit='kW'); 49 BPower as power (Brief = "Brake Power",Unit='kW'); 50 EPower as power (Brief = "Eletrical Potency", Unit='kW'); 51 Pdiff as press_delta (Brief = "Pressure Increase", Unit='kPa'); 52 52 Pratio as positive (Brief = "Pressure Ratio"); 53 Head as head (Brief = "Head Developed", Unit= "kJ/kmol");54 Head_is as head (Brief = "Isoentripic Head", Unit= "kJ/kmol");53 Head as head (Brief = "Head Developed", Unit='kJ/kmol'); 54 Head_is as head (Brief = "Isoentripic Head", Unit='kJ/kmol'); 55 55 Mwm as molweight (Brief = "Mixture Molar Weight"); 56 pvm as pressure (Brief = "Mixture Vapour Pressure", Unit = "kPa");56 pvm as pressure (Brief = "Mixture Vapour Pressure", Unit = 'kPa'); 57 57 NPSHa as length (Brief = "Available Net Positive Suction Head"); 58 NS as positive (Brief = "Specific Speed", Unit = "(rpm*(gal/min)^0.5)/(m^3/4)");58 NS as positive (Brief = "Specific Speed", Unit = '(rpm*(gal/min)^0.5)/(m^3/4)'); 59 59 Q as flow_vol (Brief = "Volumetric Flow Rate"); 60 vm as vol_mol (Brief = "Mixture Molar Volume", Unit = "m^3/kmol");60 vm as vol_mol (Brief = "Mixture Molar Volume", Unit = 'm^3/kmol'); 61 61 62 62 SET … … 147 147 Model pump 148 148 PARAMETERS 149 outer PP as Plugin;150 149 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 150 outer NComp as Integer; 151 151 152 152 VARIABLES -
branches/newlanguage/eml/pressure_changers/turbine.mso
r77 r176 34 34 35 35 PARAMETERS 36 extNComp as Integer (Brief = "Number of chemical components", Lower = 1);37 ext PP as CalcObject (Brief = "External Physical Properties");36 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 37 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 38 38 Mw(NComp) as molweight (Brief = "Molar Weight"); 39 39 Eff as positive (Default = 0.72, Brief = "Pump efficiency"); 40 40 Meff as positive (Default = 1.0, Brief = "Brake efficiency"); 41 Beta as positive (Default = 0, Brief = "Volumetric expansivity", Unit = "1/K");41 Beta as positive (Default = 0, Brief = "Volumetric expansivity", Unit = '1/K'); 42 42 43 43 … … 50 50 Pratio as positive (Brief = "Pressure Ratio"); 51 51 Mwm as molweight (Brief = "Mixture Molar Weight"); 52 rho as dens_mass (Brief = "Specific Mass", Unit= "kg/m^3");52 rho as dens_mass (Brief = "Specific Mass", Unit='kg/m^3'); 53 53 Cp as cp_mol (Brief = "Heat Capacity"); 54 54 -
branches/newlanguage/eml/pressure_changers/valve.mso
r109 r176 37 37 38 38 39 Model valve_basic as flux_machine_basic_ TP40 41 PARAMETERS 42 ext PP as CalcObject (Brief = "External Physical Properties", File = "vrpp");43 extNComp as Integer (Brief = "Number of chemical components", Lower = 1);39 Model valve_basic as flux_machine_basic_PH 40 41 PARAMETERS 42 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 43 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 44 44 rho60F as dens_mass; 45 45 46 46 VARIABLES 47 Pdiff as press_delta (Brief = "Pressure Increase", Unit = "kPa");47 Pdiff as press_delta (Brief = "Pressure Increase", Unit = 'kPa'); 48 48 Qv as flow_vol (Brief = "Volumetric Flow"); 49 49 fc as positive (Brief = "Opening Function"); 50 cv as positive (Brief = "Valve Coefficient", Unit = "m^3/h/kPa^0.5");50 cv as positive (Brief = "Valve Coefficient", Unit = 'm^3/h/kPa^0.5'); 51 51 Gf as positive (Brief = "Specific Gravity"); 52 52 rho as dens_mass; 53 vm as vol_mol (Brief = "Mixture Molar Volume", Unit = "m^3/kmol");53 vm as vol_mol (Brief = "Mixture Molar Volume", Unit = 'm^3/kmol'); 54 54 55 55 SET 56 rho60F = 999.2 * "kg/m^3";56 rho60F = 999.2 * 'kg/m^3'; 57 57 58 58 EQUATIONS … … 74 74 else 75 75 "Valve Equation - Closed" 76 Qv = 0 * "m^3/h";76 Qv = 0 * 'm^3/h'; 77 77 end 78 78 … … 178 178 Model valve 179 179 PARAMETERS 180 ext PP as CalcObject;181 extNComp as Integer;180 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 181 outer NComp as Integer; 182 182 183 183 VARIABLES 184 184 in Inlet as stream; 185 out Outlet as stream _therm;185 out Outlet as streamPH; 186 186 x as fraction (Brief="Plug Position"); 187 187 rho as dens_mass (Brief="Fluid Density", Default=1e3); … … 190 190 PARAMETERS 191 191 rho_ref as dens_mass (Brief="Reference Density", Default=1e4); 192 k as Real (Brief="Valve Constant", Unit= "gal/min/psi^0.5");192 k as Real (Brief="Valve Constant", Unit='gal/min/psi^0.5'); 193 193 194 194 EQUATIONS … … 200 200 Inlet.h = Outlet.h; 201 201 202 "Vapourisation Fraction"203 Outlet.v = Inlet.v;202 # "Vapourisation Fraction" 203 # Outlet.v = Inlet.v; 204 204 205 205 "Density" … … 216 216 else 217 217 "Closed" 218 Outlet.F = 0 * "kmol/h";218 Outlet.F = 0 * 'kmol/h'; 219 219 end 220 220 end -
branches/newlanguage/eml/reactors/pfr.mso
r170 r176 39 39 PARAMETERS 40 40 41 outer PP as Plugin (Brief = "External Physical Properties" );41 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 42 42 outer NComp as Integer (Brief="Number of components"); 43 43 NReac as Integer (Brief="Number of reactions"); -
branches/newlanguage/eml/stage_separators/batch_dist.mso
r72 r176 48 48 49 49 PARAMETERS 50 ext PP as CalcObject (Brief = "External Physical Properties");51 ext NComp as Integer(Brief = "Number of chemical components", Lower = 1);50 outer PP as Plugin (Brief = "External Physical Properties", Type="PP"); 51 outer NComp as Integer (Brief = "Number of chemical components", Lower = 1); 52 52 Across as area (Brief="Cross Section Area"); 53 53 V as volume (Brief="Total volume"); 54 54 55 55 VARIABLES 56 in Inlet as stream ; #(Brief="Feed stream");57 in InletL as stream ; #(Brief="Liquid inlet stream");58 out OutletV as stream_therm; #(Brief="Vapour outlet stream");56 in Inlet as stream (Brief="Feed stream"); 57 in InletL as stream (Brief="Liquid inlet stream"); 58 out OutletV as vapour_stream (Brief="Vapour outlet stream"); 59 59 60 60 M(NComp) as mol (Brief="Molar Holdup in the distillator"); … … 111 111 Level = ML*volL/Across; 112 112 113 "vaporization fraction "114 OutletV.v = 1.0;115 116 113 "Enthalpy" 117 114 h = PP.LiquidEnthalpy(T, P, x); -
branches/newlanguage/eml/stage_separators/column.mso
r125 r176 64 64 trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * 65 65 (trays([top:topdown:bot]).OutletV.P - 66 trays([top:topdown:bot]).InletL.P)/ "Pa"))/2 *66 trays([top:topdown:bot]).InletL.P)/'Pa'))/2 * 67 67 trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * 68 68 sqrt(2*(trays([top:topdown:bot]).OutletV.P - 69 trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /69 trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') / 70 70 (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); 71 71 … … 111 111 else 112 112 "No flow in reboiler" 113 reb.OutletV.F = 0.0 * "mol/s";113 reb.OutletV.F = 0.0 * 'mol/s'; 114 114 end 115 115 116 116 "Pressure Drop through the tray" 117 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/ "Pa"))/2 *117 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 * 118 118 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 119 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));119 cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 120 120 121 121 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 122 122 (trays([top+topdown:topdown:bot]).OutletV.P - 123 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *123 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 124 124 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 125 125 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 126 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /126 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 127 127 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 128 128 … … 185 185 else 186 186 "No flow in reboiler" 187 reb.OutletV.F = 0.0 * "mol/s";187 reb.OutletV.F = 0.0 * 'mol/s'; 188 188 end 189 189 190 190 "Pressure Drop through the tray" 191 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/ "Pa"))/2 *191 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 * 192 192 trays(top).Ah/trays(top).vV /2* sqrt(2*(trays(top).OutletV.P - 193 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));193 ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 194 194 195 195 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 196 196 (trays([top+topdown:topdown:bot]).OutletV.P - 197 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *197 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 198 198 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV /2* 199 199 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 200 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /200 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 201 201 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 202 202 … … 260 260 else 261 261 "No flow in reboiler" 262 reb.OutletV.F = 0.0 * "mol/s";262 reb.OutletV.F = 0.0 * 'mol/s'; 263 263 end 264 264 265 265 "Pressure Drop through the tray" 266 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/ "Pa"))/2 *266 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 * 267 267 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 268 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));268 cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 269 269 270 270 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 271 271 (trays([top+topdown:topdown:bot]).OutletV.P - 272 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *272 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 273 273 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 274 274 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 275 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /275 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 276 276 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 277 277 … … 331 331 else 332 332 "No flow in reboiler" 333 reb.OutletV.F = 0.0 * "mol/s";333 reb.OutletV.F = 0.0 * 'mol/s'; 334 334 end 335 335 336 336 "Pressure Drop through the tray" 337 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/ "Pa"))/2 *337 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 * 338 338 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 339 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));339 ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 340 340 341 341 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 342 342 (trays([top+topdown:topdown:bot]).OutletV.P - 343 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *343 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 344 344 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 345 345 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 346 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /346 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 347 347 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 348 348 … … 391 391 EQUATIONS 392 392 "Pressure Drop through the tray" 393 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/ "Pa"))/2 *393 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 * 394 394 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 395 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));395 cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 396 396 397 397 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 398 398 (trays([top+topdown:topdown:bot]).OutletV.P - 399 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *399 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 400 400 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 401 401 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 402 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /402 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 403 403 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 404 404 … … 448 448 EQUATIONS 449 449 "Pressure Drop through the tray" 450 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/ "Pa"))/2 *450 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 * 451 451 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 452 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));452 ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 453 453 454 454 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 455 455 (trays([top+topdown:topdown:bot]).OutletV.P - 456 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *456 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 457 457 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 458 458 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 459 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /459 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 460 460 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 461 461 … … 502 502 EQUATIONS 503 503 "Pressure Drop through the tray" 504 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/ "Pa"))/2 *504 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 * 505 505 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 506 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));506 cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 507 507 508 508 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 509 509 (trays([top+topdown:topdown:bot]).OutletV.P - 510 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *510 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 511 511 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 512 512 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 513 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /513 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 514 514 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 515 515 … … 559 559 EQUATIONS 560 560 "Pressure Drop through the tray" 561 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/ "Pa"))/2 *561 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 * 562 562 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 563 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));563 ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 564 564 565 565 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 566 566 (trays([top+topdown:topdown:bot]).OutletV.P - 567 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *567 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 568 568 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 569 569 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 570 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /570 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 571 571 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 572 572 … … 613 613 EQUATIONS 614 614 "Pressure Drop through the tray" 615 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/ "Pa"))/2 *615 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - cond.OutletL.P)/'Pa'))/2 * 616 616 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 617 cond.OutletL.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));617 cond.OutletL.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 618 618 619 619 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 620 620 (trays([top+topdown:topdown:bot]).OutletV.P - 621 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *621 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 622 622 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 623 623 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 624 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /624 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 625 625 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 626 626 … … 671 671 EQUATIONS 672 672 "Pressure Drop through the tray" 673 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/ "Pa"))/2 *673 trays(top).OutletV.F = (1 + tanh(1 * (trays(top).OutletV.P - ttop.Outlet.P)/'Pa'))/2 * 674 674 trays(top).Ah/trays(top).vV * sqrt(2*(trays(top).OutletV.P - 675 ttop.Outlet.P + 1e-8 * "atm") / (trays(top).alfa*trays(top).rhoV));675 ttop.Outlet.P + 1e-8 * 'atm') / (trays(top).alfa*trays(top).rhoV)); 676 676 677 677 trays([top+topdown:topdown:bot]).OutletV.F = (1 + tanh(1 * 678 678 (trays([top+topdown:topdown:bot]).OutletV.P - 679 trays([top+topdown:topdown:bot]).InletL.P)/ "Pa"))/2 *679 trays([top+topdown:topdown:bot]).InletL.P)/'Pa'))/2 * 680 680 trays([top+topdown:topdown:bot]).Ah/trays([top+topdown:topdown:bot]).vV * 681 681 sqrt(2*(trays([top+topdown:topdown:bot]).OutletV.P - 682 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * "atm") /682 trays([top+topdown:topdown:bot]).InletL.P + 1e-8 * 'atm') / 683 683 (trays([top+topdown:topdown:bot]).alfa*trays([top+topdown:topdown:bot]).rhoV)); 684 684 … … 728 728 else 729 729 "Prato selado" 730 reb.OutletV.F = 0.0 * "mol/s";730 reb.OutletV.F = 0.0 * 'mol/s'; 731 731 end 732 732 … … 734 734 trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * 735 735 (trays([top:topdown:bot]).OutletV.P - 736 trays([top:topdown:bot]).InletL.P)/ "Pa"))/2 *736 trays([top:topdown:bot]).InletL.P)/'Pa'))/2 * 737 737 trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * 738 738 sqrt(2*(trays([top:topdown:bot]).OutletV.P - 739 trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /739 trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') / 740 740 (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); 741 741 … … 786 786 else 787 787 "Prato selado" 788 reb.OutletV.F = 0.0 * "mol/s";788 reb.OutletV.F = 0.0 * 'mol/s'; 789 789 end 790 790 … … 792 792 trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * 793 793 (trays([top:topdown:bot]).OutletV.P - 794 trays([top:topdown:bot]).InletL.P)/ "Pa"))/2 *794 trays([top:topdown:bot]).InletL.P)/'Pa'))/2 * 795 795 trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * 796 796 sqrt(2*(trays([top:topdown:bot]).OutletV.P - 797 trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /797 trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') / 798 798 (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); 799 799 … … 842 842 else 843 843 "Prato selado" 844 reb.OutletV.F = 0.0 * "mol/s";844 reb.OutletV.F = 0.0 * 'mol/s'; 845 845 end 846 846 … … 848 848 trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * 849 849 (trays([top:topdown:bot]).OutletV.P - 850 trays([top:topdown:bot]).InletL.P)/ "Pa"))/2 *850 trays([top:topdown:bot]).InletL.P)/'Pa'))/2 * 851 851 trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * 852 852 sqrt(2*(trays([top:topdown:bot]).OutletV.P - 853 trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /853 trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') / 854 854 (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); 855 855 … … 900 900 else 901 901 "Prato selado" 902 reb.OutletV.F = 0.0 * "mol/s";902 reb.OutletV.F = 0.0 * 'mol/s'; 903 903 end 904 904 … … 906 906 trays([top:topdown:bot]).OutletV.F = (1 + tanh(1 * 907 907 (trays([top:topdown:bot]).OutletV.P - 908 trays([top:topdown:bot]).InletL.P)/ "Pa"))/2 *908 trays([top:topdown:bot]).InletL.P)/'Pa'))/2 * 909 909 trays([top:topdown:bot]).Ah/trays([top:topdown:bot]).vV * 910 910 sqrt(2*(trays([top:topdown:bot]).OutletV.P - 911 trays([top:topdown:bot]).InletL.P + 1e-8 * "atm") /911 trays([top:topdown:bot]).InletL.P + 1e-8 * 'atm') / 912 912 (trays([top:topdown:bot]).alfa*trays([top:topdown:bot]).rhoV)); 913 913 … … 942 942 943 943 EQUATIONS 944 if ( reb.OutletV.P > 1 * "atm") then944 if ( reb.OutletV.P > 1 * 'atm' ) then 945 945 "Pressure Drop through the tray" 946 reb.OutletV.F = trays(1).Ah/reb.vV * sqrt((reb.OutletV.P - 1* "atm") / (0.15*reb.rhoV) );946 reb.OutletV.F = trays(1).Ah/reb.vV * sqrt((reb.OutletV.P - 1*'atm') / (0.15*reb.rhoV) ); 947 947 else 948 948 "Prato selado" 949 reb.OutletV.F = 0.0 * "mol/s";949 reb.OutletV.F = 0.0 * 'mol/s'; 950 950 end 951 951 -
branches/newlanguage/eml/stage_separators/condenser.mso
r125 r176 161 161 Q as heat_rate (Brief="Heat supplied"); 162 162 Vol as volume; 163 r as reaction_mol (Brief = "Reaction rate", Unit = "mol/l/s");163 r as reaction_mol (Brief = "Reaction rate", Unit = 'mol/l/s'); 164 164 C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); 165 165 -
branches/newlanguage/eml/stage_separators/flashPH.mso
r101 r176 38 38 Model FlashPHSteady 39 39 PARAMETERS 40 ext PP as CalcObject;41 extNComp as Integer;40 outer PP as Plugin; 41 outer NComp as Integer; 42 42 B as Real(Default=1000, Brief="Regularization Factor"); 43 43 44 44 VARIABLES 45 in Inlet as stream ; #(Brief="Feed Stream");46 out OutletL as stream_therm; #(Brief="Liquid outlet stream");47 out OutletV as stream_therm; #(Brief="Vapour outlet stream");45 in Inlet as stream (Brief="Feed Stream"); 46 out OutletL as liquid_stream (Brief="Liquid outlet stream"); 47 out OutletV as vapour_stream (Brief="Vapour outlet stream"); 48 48 in Q as heat_rate (Brief="Rate of heat supply"); 49 49 vfrac as fraction(Brief="Real vaporization fraction"); … … 84 84 OutletV.P = OutletL.P; 85 85 86 "vaporization fraction "87 OutletV.v = 1.0;88 "vaporization fraction "89 OutletL.v = 0.0;90 91 86 # regularization functions 92 87 zero_one = (1 + tanh(B * vsat))/2; -
branches/newlanguage/eml/stage_separators/reboiler.mso
r125 r176 158 158 outer NComp as Integer; 159 159 DP as press_delta (Brief="Pressure Drop in the reboiler"); 160 k as Real (Brief = "Flow Constant", Unit= "mol/J");160 k as Real (Brief = "Flow Constant", Unit='mol/J'); 161 161 162 162 VARIABLES … … 180 180 181 181 "Fake output temperature" 182 OutletV.T = 300* "K";182 OutletV.T = 300*'K'; 183 183 184 184 "Pressure Drop through the reboiler" … … 217 217 startup as Real; 218 218 rhoV as dens_mass; 219 r as reaction_mol (Brief = "Reaction resulting ethyl acetate", Unit = "mol/l/s");219 r as reaction_mol (Brief = "Reaction resulting ethyl acetate", Unit = 'mol/l/s'); 220 220 C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); 221 221 -
branches/newlanguage/eml/stage_separators/tray.mso
r124 r176 197 197 rhoL as dens_mass; 198 198 rhoV as dens_mass; 199 r as reaction_mol (Brief = "Reaction rate", Unit = "mol/l/s");199 r as reaction_mol (Brief = "Reaction rate", Unit = 'mol/l/s'); 200 200 C(NComp) as conc_mol (Brief = "Molar concentration", Lower = -1); #, Unit = "mol/l"); 201 201 … … 248 248 if Level > (beta * hw) then 249 249 "Francis Equation" 250 OutletL.F = (1.84 *"1/s"*lw*((Level-(beta*hw))/(beta))^2/vL);250 OutletL.F = (1.84/'s'*lw*((Level-(beta*hw))/(beta))^2/vL); 251 251 else 252 252 "Low level" 253 OutletL.F = 0 * "mol/h";253 OutletL.F = 0 * 'mol/h'; 254 254 end 255 255 256 256 257 257 "Pressure Drop through the tray" 258 OutletV.F = (1 + tanh(1 * (OutletV.P - Pstartup)/ "Pa"))/2 *259 Ah/vV * sqrt(2*(OutletV.P - InletL.P + 1e-8 * "atm") / (alfa*rhoV) );258 OutletV.F = (1 + tanh(1 * (OutletV.P - Pstartup)/'Pa'))/2 * 259 Ah/vV * sqrt(2*(OutletV.P - InletL.P + 1e-8 * 'atm') / (alfa*rhoV) ); 260 260 261 261 -
branches/newlanguage/sample/miscellaneous/sample_arrays.mso
r125 r176 31 31 EQUATIONS 32 32 for i in [1 : Dimension] 33 diff(Var1(1,i)) = Var2(1,i)/ "s";33 diff(Var1(1,i)) = Var2(1,i)/'s'; 34 34 end 35 35 36 diff(Var1(2:Dimension,:)) * "s"= Scalar*Var2(2:Dimension,:);36 diff(Var1(2:Dimension,:)) * 's' = Scalar*Var2(2:Dimension,:); 37 37 38 exp(Scalar)*Var2 = sin(time * "180*grad/s");38 exp(Scalar)*Var2 = sin(time * '180*grad/s'); 39 39 end 40 40 -
branches/newlanguage/sample/miscellaneous/sample_arrays2.mso
r83 r176 30 30 EQUATIONS 31 31 32 diff(Var1(1,1))* "s"= Var2(1,2);32 diff(Var1(1,1))*'s' = Var2(1,2); 33 33 34 34 for i in [2 : Dimension-1] 35 diff(Var1(1,i))* "s"= Var2(1,i-1)+Var2(1,i+1);35 diff(Var1(1,i))*'s' = Var2(1,i-1)+Var2(1,i+1); 36 36 end 37 37 38 diff(Var1(1,Dimension))* "s"= Var2(1,Dimension);39 diff(Var1(2:Dimension,:))* "s"= Scalar*Var2(2:Dimension,:);38 diff(Var1(1,Dimension))*'s' = Var2(1,Dimension); 39 diff(Var1(2:Dimension,:))*'s' = Scalar*Var2(2:Dimension,:); 40 40 41 exp(Scalar)*Var2 = sin(time /"s");41 exp(Scalar)*Var2 = sin(time*'rad/s'); 42 42 end 43 43 … … 51 51 52 52 OPTIONS 53 time = [0:0.1:2*3.1415]; 53 TimeStep = 0.1; 54 TimeEnd = 2*3.1415; 54 55 end -
branches/newlanguage/sample/miscellaneous/sample_bc.mso
r83 r176 47 47 EQUATIONS 48 48 "Balanço no Prato 0" 49 diff(H0)* "s"= -V/(R+1);50 diff(x1(1))* "s"= V/H0 * (x1(1)-y1(1) + R * ((x1(2) - x1(1))/(R+1)));49 diff(H0)*'s' = -V/(R+1); 50 diff(x1(1))*'s' = V/H0 * (x1(1)-y1(1) + R * ((x1(2) - x1(1))/(R+1))); 51 51 52 52 "Balanço demais pratos" 53 diff(x1(2:Np))* "s"= V/Hi * (y1(1:Np-1) - y1(2:Np) + (R * ( x1(3:Np+1) - x1(2:Np) ) / (R+1)));53 diff(x1(2:Np))*'s' = V/Hi * (y1(1:Np-1) - y1(2:Np) + (R * ( x1(3:Np+1) - x1(2:Np) ) / (R+1))); 54 54 55 55 "Balanço último prato" 56 diff(x1(Np+1))* "s"= V * ( y1(Np) - x1(Np+1) )/Hi;56 diff(x1(Np+1))*'s' = V * ( y1(Np) - x1(Np+1) )/Hi; 57 57 58 58 x1 = 1 - x2; … … 86 86 87 87 OPTIONS 88 time = [0:0.01:0.1, 0.2:0.1:2.1]; 89 integration = "index0"; #original, index0 or index 1 90 relativeAccuracy = 1e-6; 91 absoluteAccuracy = 1e-8; 88 #time = [0:0.01:0.1, 0.2:0.1:2.1]; 89 TimeStep = 0.01; 90 TimeEnd = 2.1; 91 #integration = "index0"; #original, index0 or index 1 92 RelativeAccuracy = 1e-6; 93 AbsoluteAccuracy = 1e-8; 92 94 DAESolver = "dasslc"; # "mebdf" 93 95 end -
branches/newlanguage/sample/miscellaneous/sample_calc_object.mso
r83 r176 28 28 Model CalcBasic 29 29 PARAMETERS 30 extNoComps as Integer;30 outer NoComps as Integer; 31 31 VARIABLES 32 32 T as temperature; … … 34 34 z(NoComps) as fraction; 35 35 36 r1 as Real(Unit= "K*K");37 r2 as Real(Unit= "atm*K");36 r1 as Real(Unit='K*K'); 37 r2 as Real(Unit='atm*K'); 38 38 r3 as Real; 39 39 end … … 45 45 Model Calc as CalcBasic 46 46 PARAMETERS 47 ext obj as CalcObject;47 outer obj as Plugin; 48 48 49 49 EQUATIONS … … 76 76 FlowSheet CalcTest 77 77 PARAMETERS 78 obj as CalcObject(File = "calcsample");78 obj as Plugin(File = "calcsample"); 79 79 NoComps as Integer(Default = 5); 80 80 … … 84 84 85 85 SPECIFY 86 #calc1.T = 100 * "K";87 #calc1.P = 100 * "Pa";86 #calc1.T = 100 * 'K'; 87 #calc1.P = 100 * 'Pa'; 88 88 calc1.z(1:NoComps-1) = 1/NoComps; 89 calc1.r1 = 20000 * "K*K";90 calc1.r2 = 10000 * "Pa*K";89 calc1.r1 = 20000 * 'K*K'; 90 calc1.r2 = 10000 * 'Pa*K'; 91 91 calc1.r3 = 1; 92 92 93 #calc2.T = 100 * "K";94 #calc2.P = 100 * "Pa";93 #calc2.T = 100 * 'K'; 94 #calc2.P = 100 * 'Pa'; 95 95 calc2.z(1:NoComps-1) = 1/NoComps; 96 calc2.r1 = 20000 * "K*K";97 calc2.r2 = 10000 * "Pa*K";96 calc2.r1 = 20000 * 'K*K'; 97 calc2.r2 = 10000 * 'Pa*K'; 98 98 calc2.r3 = 1; 99 99 100 100 OPTIONS 101 relativeAccuracy = 1e-6;101 RelativeAccuracy = 1e-6; 102 102 #mode = "steady"; 103 103 end … … 116 116 117 117 SPECIFY 118 #calc2.T = 100 * "K";119 #calc2.P = 100 * "Pa";118 #calc2.T = 100 * 'K'; 119 #calc2.P = 100 * 'Pa'; 120 120 calc2.z(1:NoComps-1) = 1/NoComps; 121 calc2.r1 = 20000 * "K*K";122 calc2.r2 = 10000 * "Pa*K";121 calc2.r1 = 20000 * 'K*K'; 122 calc2.r2 = 10000 * 'Pa*K'; 123 123 calc2.r3 = 1; 124 124 125 125 OPTIONS 126 relativeAccuracy = 1e-6;127 mode = "steady";126 RelativeAccuracy = 1e-6; 127 Dynamic = false; 128 128 end 129 -
branches/newlanguage/sample/miscellaneous/sample_car.mso
r83 r176 83 83 84 84 OPTIONS 85 time = [0:0.01:3]; 86 integration = "index0"; # "original"; 85 TimeStart = 0; 86 TimeStep = 0.01; 87 TimeEnd = 3; 88 #integration = "index0"; # "original"; 87 89 #DAESolver = "mebdf"; 88 90 89 relativeAccuracy = 1e-5;90 absoluteAccuracy = 1e-5;91 indVarAccuracy = 1e-3;91 RelativeAccuracy = 1e-5; 92 AbsoluteAccuracy = 1e-5; 93 #indVarAccuracy = 1e-3; 92 94 end -
branches/newlanguage/sample/miscellaneous/sample_cstr_simple.mso
r83 r176 36 36 k0 as frequency; 37 37 Ea as energy_mol (Brief = "Energia de Ativação"); 38 R as en ergy_mol;38 R as entr_mol; 39 39 40 40 VARIABLES … … 48 48 rA as reaction_mol; 49 49 rB as reaction_mol; 50 Cps as cp_mol; # (Unit= "cal/mol/K");50 Cps as cp_mol; # (Unit='cal/mol/K'); 51 51 T0 as temperature; 52 52 … … 57 57 58 58 "Constante de Reação" 59 k=k0*exp(Ea/R*(1/ 436.15 - 1*"K"/T));59 k=k0*exp(Ea/R*(1/(436.15*'K') - 1/T)); 60 60 61 61 "Taxas de Reação" … … 64 64 65 65 "Calor de Reação" 66 HR=-(80*250)* "cal/mol";66 HR=-(80*250)*'cal/mol'; 67 67 68 68 "Cp da mistura" 69 Cps=(0.5*250)*3 ;# *"cal/mol/K";69 Cps=(0.5*250)*3*'J/mol/K'; 70 70 71 71 "Balanço de Energia" … … 82 82 83 83 "Temperatura da corrente de alimentação" 84 T0= (40 + 273.15 + time*200/1000/ "s") * "K";84 T0= (40 + 273.15 + time*200/1000/'s') * 'K'; 85 85 86 86 SET 87 Fin = 0.125997903* "m^3/h";88 Fout = 0.125997903* "m^3/h";89 CA0=9.3652352* "mol/m^3";90 CB0=0* "mol/m^3";87 Fin = 0.125997903*'m^3/h'; 88 Fout = 0.125997903*'m^3/h'; 89 CA0=9.3652352*'mol/m^3'; 90 CB0=0*'mol/m^3'; 91 91 FA0 = Fin*CA0; 92 92 FB0 = Fin*CB0; 93 Tw = (140+273)* "K";94 k0=0.8* "1/h"; #constante para T=436.15 K95 Ea=28960* "cal/mol";96 R=1.98* "cal/mol/K";97 U = 0 * "cal/m^2/K/s";#isolado98 A = 1* "m^2";93 Tw = (140+273)*'K'; 94 k0=0.8*'1/h'; #constante para T=436.15 K 95 Ea=28960*'cal/mol'; 96 R=1.98*'cal/mol/K'; 97 U = 0 *'cal/m^2/K/s';#isolado 98 A = 1*'m^2'; 99 99 100 100 INITIAL 101 T = (140 + 273) * "K";102 V = 0.9*6* "m^3";103 CA = 2* "mol/m^3";104 CB = 6* "mol/m^3";101 T = (140 + 273) * 'K'; 102 V = 0.9*6*'m^3'; 103 CA = 2*'mol/m^3'; 104 CB = 6*'mol/m^3'; 105 105 106 106 OPTIONS 107 time = [0:10:1200]; 107 TimeStep = 10; 108 TimeEnd = 1200; 108 109 end -
branches/newlanguage/sample/stage_separators/sample_flash.mso
r124 r176 49 49 50 50 EQUATIONS 51 fl.OutletL.F = 400*sqrt(fl.Level/ "m") * "kmol/h";51 fl.OutletL.F = 400*sqrt(fl.Level/'m') * 'kmol/h'; 52 52 53 53 SPECIFY 54 s1.Outlet.F = 496.3 * "kmol/h";55 s1.Outlet.T = 338 * "K";56 s1.Outlet.P = 507.1 * "kPa";54 s1.Outlet.F = 496.3 * 'kmol/h'; 55 s1.Outlet.T = 338 * 'K'; 56 s1.Outlet.P = 507.1 * 'kPa'; 57 57 #s1.Outlet.v = 0.1380; 58 58 s1.Outlet.z = [0.2379,0.3082,0.09958,0.1373,0.08872,0.1283]; 59 59 60 fl.OutletV.F = 68.5 * "kmol/h";61 Q = 0 * "kJ/h";60 fl.OutletV.F = 68.5 * 'kmol/h'; 61 Q = 0 * 'kJ/h'; 62 62 63 63 SET 64 fl.V = 2000 * "m^3";65 fl.Across = 1 * "m^2";64 fl.V = 2000 * 'm^3'; 65 fl.Across = 1 * 'm^2'; 66 66 67 67 INITIAL 68 fl.OutletL.T = 338 * "K";69 fl.Level = 1 * "m";68 fl.OutletL.T = 338 * 'K'; 69 fl.Level = 1 * 'm'; 70 70 71 71 fl.OutletL.z(1) = 0.1; … … 81 81 TimeStep = 0.1; 82 82 TimeEnd = 20; 83 TimeUnit = "h";83 TimeUnit = 'h'; 84 84 end 85 85 … … 108 108 109 109 SPECIFY 110 s1.Outlet.F = 496.3 * "kmol/h";111 s1.Outlet.T = 338 * "K";112 s1.Outlet.P = 507.1 * "kPa";110 s1.Outlet.F = 496.3 * 'kmol/h'; 111 s1.Outlet.T = 338 * 'K'; 112 s1.Outlet.P = 507.1 * 'kPa'; 113 113 #s1.Outlet.v = 0.1380; 114 114 s1.Outlet.z = [0.2379,0.3082,0.09959,0.1373,0.08872,0.1283]; 115 115 116 fl.OutletL.P = 2.5 * "atm";116 fl.OutletL.P = 2.5 * 'atm'; 117 117 118 #Q = 0 * "kJ/h";119 fl.OutletL.T = 315.06 * "K";118 #Q = 0 * 'kJ/h'; 119 fl.OutletL.T = 315.06 * 'K'; 120 120 121 121 OPTIONS
Note: See TracChangeset
for help on using the changeset viewer.