*SetMotion() - single motion with user subroutine
Sets the properties of a motion with a user subroutine.
Syntax
*SetMotion(motion_name, USER, `solver_expression`)
*Set(motion_name.use_local_dll, TRUE|FALSE)
*Set(motion_name.local_dll, "string")
Arguments
- motion_name
- The variable name of an existing motion.
- USER
- This argument indicates that a user subroutine is used to compute solver variable properties.
- solver_expression
- A solver expression enclosed in back quotes to specify arguments for the user subroutine.
- motion_name.use_local_dll
- Specifies if a user subroutine DLL is specific to the instance of one motion entity.
- motion_name.local_dll
- The path and filename for the user subroutine DLL to be used with an instance of the user defined motion.
Example
*RevJoint(j_crank_piv, "Crank pivot",
b_crank,
B_Ground,
p_crank_pivot,
p_crank_pivot_axis)
*Motion(crank_rot, "Crank rotation", j_crank_piv)
*SetMotion(crank_rot, DISP, `360D*TIME`)
*Motion(mounting, "Mounting", j_crank_piv)
*SetMotion(mtn1, VEL, ds.real1.value + ds.real2.value)
*Motion( mtn_stwheel, "Steering motion", j_stwheel)
*Curve( crv_mtn, "Steering input")
*SetMotion(mtn_stwheel, DISP, crv_mtn.interp(AKIMA, `TIME`))
*SetMotion(mtn_stwheel, DISP, `USER({ crv_mtn.id, %d })`)
Context
Comments
Templex syntax is used in solver expressions. All variables are
enclosed in braces {} and the rest of the expression is treated as literal. Solver
expressions are enclosed in back quotes. Curve data can be used to define a motion by
specifying an existing curve, interpolation method, and an independent variable. For
example,
curve_name.interp(CUBIC, `{DM}`)
where curve_name is the variable name of an existing curve. The interpolation method can be set to AKIMA, CUBIC, or PWL, and the independent variable is specified in Templex syntax.