*SetFMUType()

Sets the type of FMU to be used when the FMU has more than one type.

Syntax

*SetFMUType(varname, fmu_type)
Note: [] indicates optional arguments

Arguments

varname
The variable name of the FMU entity.
Data type: varname
fmu_type
Valid values are ModelExchange | CoSimulation.
Keyword suggesting the type of FMU to be used during solution in case FMU has both ModelExchange and CoSimulation.
Data type: String

Example

*BeginMDL( the_model, "Model", "2019.1" )
  *Point( p_0, "Point 0" )
  *Body( b_0, "Body 0", p_0, , , ,  )
  *Graphic( gbox_0, "Box 0", BOX, b_0, CENTER, p_0, ZX, POINT, P_Global_Origin, VECTOR, V_Global_X, 1, 1, 1, 3 )
  *TransJoint( j_0, "Joint 0", b_0, B_Ground, p_1, VECTOR, V_Global_X )
  *Point( p_1, "Point 1" )
  *ActionOnlyForce( frc_0, "Force 0", TRANS, b_0, p_4, Global_Frame )
  *Point( p_2, "Point 2" )
  *CoilSpring( sd_0, "SpringDamper 0", b_0, B_Ground, p_2, p_3 )
  *Point( p_3, "Point 3" )
  *Point( p_4, "Point 4" )
  *ActionOnlyForce( frc_pid, "PID", TRANS, b_0, p_2, Global_Frame )
  *Marker( m_0, "Marker 0", B_Ground, p_0 )
  *SetPoint( p_0,                        , , 1.5 )
  *SetPoint( p_1,                        , , 1 )
  *SetPoint( p_2,                        -0.5, , 1.5 )
  *SetPoint( p_3,                        -1, , 1.5 )
  *SetBodyInertia( b_0,                        1, 1e4, 1e4, 1e4 )
  *SetCoilSpring( sd_0,                       LIN, 20, LIN, 10 )
  *SetPoint( p_4,                        0.5, , 1.5 )
  *SetForce( frc_0,                      LIN, 1, LIN, , LIN )
  *FMU( fmu_control, "Controller", "C:/Users/Tutorials/sb_Controller.fmu" )
  *SetFMUInputs( fmu_control,{ "Angle (rad);`{j_pend_cart.AZ}+3.1416`", "Angular Velocity (rad/s);`{j_pend_cart.WZ}`", "Position (mm);`DY({b_cart.cm.id},{b_plat.cm.id})`" } )
  *SetFMUType(fmu_control, “ModelExchange”)
  *SetForce( frc_control,  EXPR, `ARYVAL({fmu_control.y_array.idstring},1)`, LIN, , LIN )
  *EndMDL()

Context

*BeginMdl()

*DefineAssembly()

*DefineSystem()

*DefineAnalysis()

Comments

An FMU could be of the type ModelExchange or CoSimulation or have both types. In the case of FMU having both types, use this statement to select the type to be used for the solution. If not specified, ModelExchange will be used as default.