Building Models Exercise A: A Simple Model Build a model called exercise a containing three components from the GP (General Purpose) Library-placed as shown below. SJ-Summing Junction -from Sum/Multiple/Divide Group IN-Integrator-from Integrators Group GN-Gain-from Sum/Multiply/ Divide Group(To change to feedback icon, Hold-R on icon select Flip) Select" Create Executable from the MscEasy5 Build menu When message"Executable has been Created"appears on the message line, select"Display Executable Source file"from the Build menu Scroll the source window down until you see"Model Equations EAS102. December 2005 pyright@ 2005 MSC Software Corporation Chart 11
EAS102, December 2005 Copyright© 2005 MSC.Software Corporation Chart 11 • Build a model called ExerciseA containing three components from the GP (General Purpose) Library - placed as shown below: – SJ - Summing Junction - from Sum/Multiple/Divide Group – IN - Integrator - from Integrators Group – GN - Gain - from Sum/Multiply/Divide Group (To change to feedback icon, Hold-R on icon, select Flip) • Select “Create Executable” from the MSC.EASY5 Build menu. • When message “Executable has been Created” appears on the message line, select “Display Executable Source file” from the Build menu. • Scroll the source window down until you see “Model Equations” Exercise A: A Simple Model Building Models Gain Block K -1 1 GKI Integrator s ExerciseA(1)
Building Models Exercise A (contin. Model Source Code You should see the following code Model Equations t sy Out sJ c1 SJ*s In1 s c2 SJ*s In2 SJ 9001 Continue CALL EZGPIN(S Out IN, XDOT(1),INX (1), S In IN, GKI IN, 1,'IN') 9002 Continue Component GN s out GN= K gn* s in gn bia gn 9003 Continue Components appear in the order they were added to model (in this case) SJ& gn appear as blocks ofactual code iN appears as a subroutine call(this is called a"standard "component) All these components can be"vectorized"setting channels(N)>1 in the CDT EAS102. December 2005 pyright@ 2005 MSC Software Corporation Chart 12
EAS102, December 2005 Copyright© 2005 MSC.Software Corporation Chart 12 C ---> Model Equations C Component SJ S_Out_SJ = C1_SJ*S_In1_SJ + C2_SJ*S_In2_SJ 9001 Continue C Component IN CALL EZGPIN(S_Out_IN,XDOT(1),INX(1),S_In_IN,GKI_IN,1,'IN') 9002 Continue C Component GN s_out_GN = K_GN* s_in_GN + bia_GN 9003 Continue You should see the following code: Components appear in the order they were added to model (in this case) SJ & GN appear as blocks of actual code IN appears as a subroutine call (this is called a “standard” component) All these components can be “vectorized” setting channels (N) > 1 in the CDT Exercise A (contin.): Model Source Code Building Models
Building Models Library and Com ponent Names Library Names 2 alphabetic characters, GP general purpose, HC Advanced Hydraulics, etc Component Names in Libraries 2 alphanumeric characters May have name collisions in different libraries GP/LL-Lead-Lag HC/LL- Laminar Leakage Add panel uses library name to qualify component name Component Qualifier 1 or 2 alphanumeric characters Used to distinguish between instances of like-named component in model Two integrators in model: IN2 and IN3 Lead-lag ll23 and laminar leakage llo6 Full model component name Two character component name plus two character qualifier Full component name is part of all source code variable names EAS102. December 2005 pyright@ 2005 MSC Software Corporation Chart 13
EAS102, December 2005 Copyright© 2005 MSC.Software Corporation Chart 13 • Library Names • 2 alphabetic characters, GP = general purpose, HC = Advanced Hydraulics, etc. • Component Names in Libraries • 2 alphanumeric characters • May have name collisions in different libraries • GP/LL – Lead-Lag • HC/LL – Laminar Leakage • Component Qualifier •1 or 2 alphanumeric characters • Used to distinguish between instances of like-named component in model • Two integrators in model: IN2 and IN3 • Lead-lag LL23 and Laminar Leakage LL06 • Full model component name • Two character component name plus two character qualifier • Full component name is part of all source code variable names • Add panel uses library name to qualify component name Building Models Library and Component Names
Building Models Input-Output Names for Components Default MSC EASY5 Naming Convention Characters left of the(first)underscore identify variable First character must be alphabetic Characters right of the(second)underscore are component name Names automatically unique Characters between underscores(if there are two underscores) identify the port More on ports later User-Supplied Names Can have up to 26 alphanumeric characters (1st must be alphabetic) Use for variables appearing in plots(others a waste of effort Meaningfulness is your responsibility They replace default names everywhere(menu, code, results Created by writing over default name in Component Data Table You can return to MsC eAsy5 names by selecting user-defined name and pressing the delete key followed by the return key EAS102. December 2005 pyright@ 2005 MSC Software Corporation Chart 14
EAS102, December 2005 Copyright© 2005 MSC.Software Corporation Chart 14 • Default MSC.EASY5 Naming Convention – Names automatically unique • Characters left of the (first) underscore identify variable – More on ports later – First character must be alphabetic • User-Supplied Names • Can have up to 26 alphanumeric characters (1st must be alphabetic) • Use for variables appearing in plots (others a waste of effort) • Meaningfulness is your responsibility • They replace default names everywhere (menu, code, results) • Created by writing over default name in Component Data Table • You can return to MSC.EASY5 names by selecting user-defined name and pressing the delete key followed by the return key Building Models Input-Output Names for Components • Characters right of the (second) underscore are component name • Characters between underscores (if there are two underscores) identify the port
Building Models Exercise A Continued: Connections Make the following default connections in your model: From sj to in From in to gn From n to sj Integrator s_out_s GKI s ut IN Gain block s Out Gn K Examine one of the connections (point at connection and click center mouse Button). Notice that only the"s"variables have been connected ( s= signal Create an executable and look at the executable source file EAS102. December 2005 pyright@ 2005 MSC Software Corporation Chart 15
EAS102, December 2005 Copyright© 2005 MSC.Software Corporation Chart 15 Building Models Exercise A Continued: Connections • Make the following default connections in your model: From SJ to IN From IN to GN From GN to SJ • Examine one of the connections (point at connection and click center mouse Button). Notice that only the “S” variables have been connected (S = signal) • Create an executable and look at the Executable source file -1 1 GKI Integrator s Gain Block K S_Out_SJ S_Out_IN S_Out_GN ExerciseA(3)