*SetFMUInputs()
Sets input array for an FMU entity.
Syntax
*SetFMUInputs(varname, {“sv_1_name;`sv_1_value`”, “sv_2_name;`sv_2_value`”,… “sv_n_name;`sv_n_value`”} )
{} choose any one argument among the list
Arguments
- varname
- The variable name of the FMU entity.
- sv_1_name, sv_2_name,…sv_n_name
- Names of the channel in the Input array of the FMU.
- sv_1_expr, sv_2_expr,…sv_n_expr
- Solver expressions to be assigned to the channel in the input array of FMU.
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})`" } )
*SetForce( frc_cart, LIN, , EXPR, fmu_0.y_array.output_1, LIN )
*EndMDL()
Context
Comments
Use the *FMU() statement to create a functional mock-up unit (FMU).
The input array of FMU generally is made of one or more channels that enables the FMU to seek input from the connecting solver. Each channel consists of a name, description, and a value field.
This statement assigns a solver expression as a value to the name of a channel. The name of the channel is pre-defined in the FMU. The input is provided as an array comprising of name;value pair separated by commas.
The array is defined within curly braces.
The solver expression in the value if not a real number or a MotionView entity datamember is provided within backticks (`
`
).