COUSUB/COUXX/COUXX2
ModelingUsed to specify a user coupler element.
Definition
Coupler constraints are used to constrain the relative translational and/or the rotational motion of two or three joints. By using a subroutine-based formulation, for example, you can specify a variable coupler ratio based on system states, relational operators, and logical expressions. A typical example is a nonlinear coupler multiplier ratio defined as a function of an input joint velocity.
Use
User-defined coupler entity example:
<Constraint_UserConstr
id = id ...
usrsub_param_string = "USER(r1,… r30)"
usrsub_dll_name = "NULL">
</Constraint_UserConstr>
Format
Fortran Calling
Syntax
SUBROUTINE COUSUB (ID, TIME, PAR, NPAR, DISP, NDISP, IFLAG, PHI)
SUBROUTINE COUXX (ID, TIME, PAR, NPAR, DISP, NDISP, IFLAG, DFDA)
SUBROUTINE COUXX2 (ID, TIME, PAR, NPAR, DISP, NDISP, IFLAG, D2FDA2)
C Calling
Syntax
void STDCALL COUSUB (int *id, double *time, double *par, int *npar, double *disp, int *ndisp, int *iflag, double *phi)
void STDCALL COUXX (int *id, double *time, double *par, int *npar, double *disp, int *ndisp, int *iflag, double *DFDA)
void STDCALL COUXX2 (int *id, double *time, double *par, int *npar, double *disp, int *ndisp, int *iflag, double *D2FDA2)
Python Calling
Syntax
def COUSUB(id, time, par, npar, disp, ndisp, iflag):
return phi
def COUXX(id, time, par, npar, disp, ndisp, iflag):
return dfda
def COUXX2(id, time, par, npar, disp, ndisp, iflag):
return dfda2
MATLAB Calling
Syntax
function phi = COUSUB(id, time, par, npar, disp1, ndisp, iflag)
function dfda = COUSUBXX(id, time, par, npar, disp1, ndisp, iflag)
function d2fda2 = COUSUBXX2(id, time, par, npar, disp1, ndisp, iflag)
Attributes
- ID
- [integer]
- TIME
- [double precision]
- PAR
- [double precision]
- NPAR
- [integer]
- DISP
- [double precision]
- NDISP
- [integer]
- IFLAG
- [logical]
Output
- PHI
- [double precision]
- DFDA
- [double precision]
- D2FDA2
- [double precision]
Example
def COUSUB(id, time, par, npar, disp, ndisp, iflag):
phi = disp[0]+par[0]*disp[1]
return phi
def COUXX(id, time, par, npar, disp, ndisp, iflag):
dfda =2*[0]
dfda[0] =1.0dfda[1] = par[0]
return dfda
def COUXX2(id, time, par, npar, disp, ndisp, iflag):
d2fda2 = 2*[0]
return d2fda2