*Coupler()

Creates a coupler for two or three joints.

Syntax

*Coupler(coupler_name,"coupler_label",2JOINT|3JOINT, joint_1, joint_2, [joint_3], TRANS|ROT, TRANS|ROT, [TRANS|ROT])

Arguments

coupler_name
The variable name of the coupler.
Data type: varname
coupler_label
The descriptive label of the coupler.
Data type: label
2JOINT|3JOINT
Set to 3JOINT for a three joint coupler, otherwise, set to 2JOINT.
joint_1
The first joint constrained by the coupler.
Data type: joint
joint_2
The second joint constrained by the coupler.
Data type: joint
joint_3
The third joint constrained by the coupler.
Data type: joint
TRANS|ROT
See Comments .
TRANS|ROT
See Comments .
TRANS|ROT
Required if *SetCouplerType() is 3JOINT. See Comments.

Example

*BeginMDL(model, "The Model")
*Point(p_0, "Point 0")
*Point(p_1, "Point 1")
*Point(p_2, "Point 2")
*Point(p_3, "Point 3")
*SetPoint(p_0, 1, 2, 3)
*SetPoint(p_1, 4, 5, 6)
*SetPoint(p_2, 7, 8, 9)
*SetPoint(p_3, 10, 11, 12)
*Body(b_0, "Body 0", p_0)
*Body(b_1, "Body 1", p_1)
*Body(b_2, "Body 2", p_2)
*Body(b_3, "Body 3", p_3)
*RevJoint(j_0, "Rev Joint 0", b_0, b_1, p_0, V_Global_Y)
*RevJoint(j_1, "Rev Joint 1", b_1, b_2, p_1, V_Global_Z)
*RevJoint(j_2, "Rev Joint 2", b_2, b_3, p_2, V_Global_X)
*Coupler(c_0, "Coupler 0", 2JOINT, j_0, j_1, ROT, ROT)
*SetCoupler(c_0, 50)
*SetCoupler(c_0, USER, `USER( 300, 1, 2)`)
*SetLocalUserDLLFlag(c_0, TRUE)
*SetLocalUserDLL(c_0, " C:/Test/mycoupler.py ")
*SetLocalUserFuncname(c_0, "COUSUB")
*SetLocalUserFunction(c_0, PYTHON)
*Set(c_0.local_der1_funcname, COUXX)
*Set(c_0.local_der2_funcname, COUXX2)
*EndMDL()

Context

*BeginMdl()

*DefineAnalysis()

*DefineAssembly()

*DefineSystem()

Properties

Table 1.
Property Returns Data Type Description
j1 Joint The first joint constrained by the coupler.
j2 Joint The second joint constrained by the coupler.
j3 Joint The third joint constrained by the coupler.
label string The descriptive label of the coupler.
ratio1 real The ratio is the displacement of joint 1 divided by the displacement of joint 2 for each joint's respective direction of displacement.
ratio2 real The ratio is the displacement of joint 1 divided by the displacement of joint 3 for each joint's respective direction of displacement.
state boolean Control state (TRUE or FALSE).
varname string The variable name of the coupler.
id long integer The solver ID of the coupler.
usr_sub string User expression passed to the solver dll in the case of a user defined coupler.
use_local_dll boolean Valid values are "true" or "false". True switches the flag on to use a local function instead of default.
local_func_type string Keyword to set the type of function to be used. Valid choices are: DLL, PYTHON, and MATLAB.
local_dll string String containing the path to the local function file.
local_funcname string The function name or subroutine name called by the entity. The default name is "COUSUB".
local_der1_funcname string The function name or subroutine name for the first derivative. The default name is "COUXX". See Comments (below).
local_der2_funcname string The function name or subroutine name for the second derivative. The default name is "COUXX2". See ^Comments^ (below).

Comments

A coupler can constrain a revolute, translational, or cylindrical joint. When a coupler contains a cylindrical joint, either of its two degrees of freedom (translational or rotational) may be constrained by specifying the TRANS or ROT flag, respectively. The TRANS or ROT flag for the seventh, eigth, and ninth argument applies to the first joint, second joint, and third joint, respectively. The TRANS or ROT argument needs to be specified for cylindrical joints only.The function names for the first order and second order derivatives cannot be set using the MotionView graphical user interface. Use the general *Set statement to set the function names.