MSC. EASY5 Gas Properties Components GP and GM This example of a pneumatically actuated steam valve has 2 makeups: steam (MUI1)and airMU2 The User Code component models two adjacent, interlocked masses Analytic Functon Exit Port Flow Mass A) The pneumatic actuator piston shaft+ pilot plate Mass B) The valve plt Forit flcw-Scalar ret: Pressare Specifed Bottom Chamber Port Watch List Port Bottom voume Integration Iformation o Resistanc Component GM specifies MUl=2 (air) Component GP specifies MUl=1(steam) Top Chamber Port Pneumatic Actuator Model Modeling and Simulation of Gas Systems with MSC EASY5 - Chart 36 MSC XSOFTWARE
MSC.EASY5 Modeling and Simulation of Gas Systems with MSC.EASY5 - Chart 36 Gas Properties Components GP and GM • This example of a pneumatically actuated steam valve has 2 makeups: steam (MUI=1) and air (MUI=2). Component GM specifies MUI=2 (air) Component GP specifies MUI=1 (steam)
MSC. EASY5 Pressure Requlator Source File Create an executable model: select Build/create Executable Select Build/display executable Source File The source code for this model should look like: aReferencepre Ele Edit Search Optons Halp FTP Py Fc Forceou Fs+ FC ACtPosout 1 PM Connections are made by AC ForceIn SWPO0 (CVRT GD, SUP Pl, DVP PH, PBF Pl, PCF PM MP PM, Ax ForceIn Pl, Av ForceIn PH, VPC PH, substituting in the name of the SP PH, DDP PH, FX PM, FV PH,A ForceIn PM output of the component Desired value of event switch sip PM It(inx( 8+IEZPsU) NE, 0) Call ezaurs( 8+IEZPSU, DSP PM) for the name of the input in the sired value of event switch DVp Py (m:1m code of the to component f(inx( 10). NE. 0) dot( 10)= FV PI f(inx( 9). NE, 0) dot( 91=FX PH Notice that the model at this stage 9039 Continue has no values for parameters initial BD - U Exit oRL (1 conditions tables, etc UT1_ORL"zero 1t2_NO WT1 ORL" UT1 oRL U Exit2 ORL IJ ORL Modeling and Simulation of Gas Systems with MSC EASY5 - Chart 37 MSC XSOFTWARE
MSC.EASY5 Modeling and Simulation of Gas Systems with MSC.EASY5 - Chart 37 Pressure Regulator Source File • Create an executable model: Select Build/Create Executable • Select Build/Display Executable Source File • The source code for this model should look like: • Connections are made by substituting in the name of the output of the ‘from’ component for the name of the input in the code of the ‘to’ component • Notice that the model at this stage has no values for parameters, initial conditions, tables, etc
MSC. EASY5 Creating the Executable MSC. EASY5 Translates topology -boxes, connections, size of tables-into model generation statements in MSC. EASY5's language in file model name. mod Saves the latest version of your model(model_ name. ver.ezmf)if model has changed Model file contains no data Model file is host-independent-can be processed on any MSC EASY5 platform. Places file in your working directory Invokes the msc easy5 model generator MSC EASY5 Model generator Sorts computations in the model into explicit order-every quantity calculated before it is used elsewhere MSC EASY5 can handle some implicit code-see Reference Manual for details Generates model description file(model name. ezmgl) Generates FoRTRAN code representing your model (model_ name. f) Compiles same and binds it with the MSC EASY5 Analysis Program (model name. exe) Modeling and Simulation of Gas Systems with MSC EASY5 - Chart 38 MSC XSOFTWARE
MSC.EASY5 Modeling and Simulation of Gas Systems with MSC.EASY5 - Chart 38 Creating the Executable • MSC.EASY5 – Translates topology - boxes, connections, size of tables - into model generation statements in MSC.EASY5’s language in file model_name.mod – Saves the latest version of your model (model_name.ver.ezmf) if model has changed. – Model file contains no data. – Model file is host-independent - can be processed on any MSC.EASY5 platform. – Places file in your working directory. – Invokes the MSC.EASY5 Model Generator. • MSC.EASY5 Model Generator – Sorts computations in the model into explicit order - every quantity calculated before it is used elsewhere. – MSC.EASY5 can handle some implicit code - see Reference Manual for details. – Generates model description file (model_name.ezmgl). – Generates FORTRAN code representing your model (model_name.f). – Compiles same and binds it with the MSC.EASY5 Analysis Program (model_name.exe)
MSC. EASY5 Creating the Executable MSC EASY5 model of your system Set of explicit, ordinary differential equations in State Space Form include: dot= f(x, time)-derivatives of state variables y= g(x, time)-formulas for algebraic variables Implies that calling model with given(x, t)will result in given xdot: No matter how many times you call it No 'memory hidden in model (x=x+1) State variables are those defined by ordinary differential equations They do not change instantaneously. The states contain all the information needed to stop a simulation and then restart it later The numerical integration advances time and recomputes x Algebraic variables are just called variables in MSC EASY5: They are determined instantaneously by the states. They don 't need to be saved Modeling and Simulation of Gas Systems with MSC EASY5 - Chart 39 MSC XSOFTWARE
MSC.EASY5 Modeling and Simulation of Gas Systems with MSC.EASY5 - Chart 39 Creating the Executable • MSC.EASY5 model of your system – Set of explicit, ordinary differential equations in State Space Form include: § xdot = f(x, time) - derivatives of state variables § y = g(x, time) - formulas for algebraic variables – Implies that calling model with given (x, t) will result in given xdot: § No matter how many times you call it. § No ‘memory’ hidden in model (x = x +1). • State variables are those defined by ordinary differential equations: – They do not change instantaneously. – The states contain all the information needed to stop a simulation and then restart it later. – The numerical integration advances time and recomputes x. • Algebraic variables are just called variables in MSC.EASY5: – They are determined instantaneously by the states. – They don’t need to be saved
MSC. EASY5 Define Model data 1. Define the model data, both parameter values(Inputs Tab) and initial conditions(States Tab), as given in the following table Component Input Ⅴ alue Comments TF_Inletl 580 Const. inlet temperature cD 0.85 Discharge coefficient NO PP_Inletl 40 Pressure(state)IC 580 Temperature(state)IC VOL 13 Volume ORL DIA 0.025 Diameter CD 0.82 Discharge coefficient ORS DIA 0.098 Diameter CD 0.82 Discharge coefficient VY PPInletl40 Pressure(state)IC 580 Temperature(state)IC Modeling and Simulation of Gas Systems with MSCEASY5 -Chart 40 MSC XSOFTWARE
MSC.EASY5 Modeling and Simulation of Gas Systems with MSC.EASY5 - Chart 40 Define Model Data 1. Define the model data, both parameter values (Inputs Tab) and initial conditions (States Tab), as given in the following table: Component Input Value Comments OR TF_Inlet1 CD 580 0.85 Const. inlet temperature Discharge coefficient NO PP_Inlet1 TS VOL 40 580 13 Pressure (state) I.C. Temperature (state) I.C. Volume ORL DIA CD 0.025 0.82 Diameter Discharge coefficient ORS DIA CD 0.098 0.82 Diameter Discharge coefficient VY PP_Inlet1 TS 40 580 Pressure (state) I.C. Temperature (state) I.C