MOTSUB
ModelingUsed to compute displacement, velocity, or acceleration for a Motion entity.
Use
User-defined motion using displacement and computed in a MOTSUB:
<Motion_Joint
id = "301001"
type = "USERSUB"
val_type = "D"
usrsub_param_string = "USER(5,2)"
usrsub_dll_name = "NULL"
joint_id = "301002"
joint_type = "R"
motion_type = "R"
ic_disp = "0."
ic_vel = "0."
/>
Format
- Fortran Calling Syntax
-
SUBROUTINE MOTSUB (ID, TIME, PAR, NPAR, IORD, IFLAG, VALUE)
- C/C++ Calling Syntax
-
void STDCALL MOTSUB (ID, TIME, PAR, NPAR, IORD, IFLAG, VALUE)
- Python Calling Syntax
-
def MOTSUB(id, time, par, npar, iord, iflag): return value
- MATLAB Calling Syntax
-
function value = MOTSUB(id, time, par, npar, iord, iflag)
Attributes
- ID
- [integer]
- TIME
- [double precision]
- PAR
- [double precision]
- NPAR
- [integer]
- IORD
- [integer]
- IFLAG
- [logical]
Output
- VALUE
- [double precision]
Example
def MOTSUB(id, time, par, npar, iord, iflag):
if par[0]==100001:
if iflag!=0:
return -1.0
if iord==0:
value = par[1]*pow(time,par[2])
elif iord==1:
value = par[1]*par[2]*pow(time,(par[2]-1.0))
elif iord==2:
value = par[1]*par[2]*(par[2]-1.0)*pow(time,(par[2]-2.0))
else:
value = 0.0
return value