*SetFMUParameters()

Sets values for parameters of an FMU entity.

Syntax

*SetFMUParameters(varname, {“par_1_name; par_1_value`”, “par_2_name;`par_2_value`”,… “par_n_name;`par_n_value`”}  )
Note: [] indicates optional arguments

Arguments

varname
The variable name of the FMU entity.
Data type: varname
par_1_name, par_2_name,…par_n_name
Names of the parameter in the parameter list of the FMU.
Data type: String
par_1_value, par_2_value,…par_n_value
Value to be assigned to the parameter.
Data type: Real | Integer | Boolean | String
Default: FMU default

Example

*BeginMDL( pendulum, "Pendulum Model", "2024.1.0.27" )
  *StandardInclude(FILE)
  *Point( p_cart_cm, "Cart_pendumlum pivot Point" )
  *Point( p_pendu_cm, "Pendulum CM" )
  *Point( p_palt_cm, "Platform center" )
  *Point( p_cart_1, "Cart point 1" )
  *Point( p_cart_2, "Cart point 2" )
  *Body( b_link, "Pendulum", p_pendu_cm, , , ,  )
  *Body( b_cart, "Cart", p_cart_cm, , , ,  )
  *Body( b_plat, "Platform", p_palt_cm, , , ,  )
  *Point( p_plat_1, "Platform point 1" )
  *Point( p_plat_2, "Platform point 2" )
  *Graphic( gr_sphere, "pendulum sphere graphic", SPHERE, b_link, p_pendu_cm, 1, 3 )
  *Graphic( gr_link, "pendulum link graphic", CYLINDER, b_link, p_cart_cm, POINT, p_pendu_cm, 0.5, gr_link.r1, , 0.0, CAPBOTH, 3 )
  *Graphic( gr_cart, "Cart graphic", BOX, b_cart, CENTER, p_cart_cm, YZ, POINT, p_cart_1, POINT, p_cart_2, 4, 4, 4, 3 )
  *Graphic( gr_plat, "Platform graphic", BOX, b_plat, CENTER, p_palt_cm, YZ, POINT, p_plat_1, POINT, p_plat_2, 20, 150, 3.9, 3 )
  *FixedJoint( j_ground_plat, "Fix Platform to Ground", b_plat, B_Ground, p_plat_1 )
  *RevJoint( j_pend_cart, "Pin Pendulum to Cart", b_cart, b_link, p_cart_cm, VECTOR, V_Global_X )
  *TransJoint( j_plat_cart, "Cart to Platform", b_plat, b_cart, p_palt_cm, VECTOR, V_Global_Y )
  *ActionOnlyForce( frc_cart, "Force on Cart", TRANS, MODEL.b_cart, p_cart_cm, m_plat )
  *Marker( m_plat, "Platform coordinate", b_cart, p_palt_cm )
  *FMU( fmu_0, "FMU 0", "C:/Users/Tutorials/mv_hv_hg/mbd_modeling/motionsolve/fmu/sb_Controller.fmu" )
  *SetBodyInertia( b_plat,                     1000000, 100000, 100000, 100000, 0, 0, 0 )
  *SetPoint( p_cart_2,                   0, 7, 5+2*tan(0) )
  *SetPoint( p_cart_1,                   0, 3, 5-2*tan(0) )
  *SetPoint( p_plat_2,                   0, 20, 1+15*tan(0) )
  *SetPoint( p_plat_1,                   0, 0, 1-5*tan(0) )
  *SetBodyInertia( b_cart,                     10, 0, 0, 0, 0, 0, 0 )
  *SetBodyInertia( b_link,                     3, 226, 226, 226, 0, 0, 0 )
  *SetPoint( p_cart_cm,                  0, 5, 5 )
  *SetPoint( p_pendu_cm,                 0, 5.00001, -10 )
  *SetPoint( p_palt_cm,                  0, 5+70, 1 )
  *SetFMUInputs( fmu_0,  { "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})`" } )
  *SetFMUParameters(fmu_0, {"Par 1;10.0" , "Par 2;25" , "Par_3;false" , "Par_4;Linear"}
  *SetForce( frc_cart,                   LIN, , EXPR, fmu_0.y_array.output_1, LIN )
  *EndMDL()

Context

*BeginMdl()

*DefineAssembly()

*DefineSystem()

*DefineAnalysis()

*BeginContext()

Comments

Use the *FMU() statement to create a functional mock-up unit (FMU).

FMU parameters are variables that characterize the FMU system. Through parameters, FMU behavior can be varied. Parameters could be of any following datatypes – Real, Integer, Boolean, String, Enumeration

When FMU has parameters, they would have default values. Parameter values if not provided will take the default values as specified in the FMU.

Parameters could be of type real, integer, Boolean or string.

This statement assigns a value to a parameter. The name of the parameter is pre-defined in the FMU. The parameter values are provided as an array comprising of name;value pair separated by commas.

The array is defined within curly braces.