Subroutine Type |
Modeling |
||
Definition |
Used 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." /> |
|||
Calling Syntax |
Fortran SUBROUTINE MOTSUB (ID, TIME, PAR, NPAR, IORD, IFLAG, VALUE)
C void STDCALL MOTSUB (ID, TIME, PAR, NPAR, IORD, IFLAG, VALUE)
Python def MOTSUB(id, time, par, npar, iord, iflag): return value
MATLAB function value = MOTSUB(id, time, par, npar, iord, iflag) |
||
Input Arguments |
[integer] ID |
The user-defined motion element identifier. |
|
[double precision] TIME |
The current simulation time. |
||
[double precision] PAR |
An array that contains the constant arguments from the list provided in the user-defined statement. |
||
[integer] NPAR |
The number of entries in the PAR array. |
||
[integer] IORD |
The order of the time derivative. |
||
|
0 |
Displacement. |
|
|
1 |
Velocity. |
|
|
2 |
Acceleration. |
|
[logical] IFLAG |
The initialization flag. |
||
Output Values |
[double precision] VALUE |
The output value that contains the computed displacement, velocity, or acceleration of the I marker with respect to the J marker. |
|
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 |