Vtorque
Model ElementTorque defined in a MotionSolve expression
Class Name
Vtorque
Description
They may be a function of any system state and time.
Attribute Summary
Name | Property | Modifiable by command? | Designable? |
---|---|---|---|
id | Int () | ||
label | Str () | ||
i | Reference (Marker) | Yes | Yes |
jfloat | Reference (Marker) | Yes | Yes |
rm | Reference (Marker) | Yes | Yes |
tx | Function () | Yes | Yes |
ty | Function () | Yes | Yes |
tz | Function () | Yes | Yes |
function | Function ("VTOSUB") | Yes | |
routine | Routine () | ||
active | Bool () | Yes |
Usage
#1. Torque defined in a MotionSolve expression
Vtorque (i=objMarker, j=objMarker, fx=expressionString, fy=expressionString, fz=expressionString, optional_attributes)
#2. Torque defined in a compiled DLL
Vtorque (i=objMarker, j=objMarker, function=userString, routine=string,optional_attributes)
#3. Torque y
Vtorque (i=objMarker, j=objMarker, function=userString, routine=functionPointer,optional_attributes)
Attributes
- i
- Reference to an existing Marker object.
- j
- Reference to an existing floating Marker object.
- tx
- String defining a valid MotionSolve expression.
- ty
- String defining a valid MotionSolve expression.
- tz
- String defining a valid MotionSolve expression.
- i
- Reference to an existing Marker object.
- j
- Reference to an existing floating Marker object.
- function
- String defining a valid user function MotionSolve expression.
- routine
- String.
- i
- Reference to an existing Marker object.
- j
- Reference to an existing floating Marker object.
- function
- String defining a valid user function MotionSolve expression.
- routine
- Pointer to a callable function in Python.
- id
- Integer
- label
- String.
- rm
- Reference to an existing Marker object.
Example
vto1 = Vtorque (label="nonlinear bushing", i=m1801, jfloat=m1901, rm=m1903,
fx="-1e3*AX(1801,1903) - 2*(WX(1801,1903,1903))**3",
fy="-1e3*AY(1801,1903) - 2*(WY(1801,1903,1903))**3",
fz="-1e3*AZ(1801,1903) - 2*(WZ(1801,1903,1903))**3")
# Define the user subroutine first
def myVtosub (id, time, par, npar, dflag, iflag):
i = par[0]
j = par[1]
k = par[2]
c = par[3]
# Get the state of the bushing
ax = AX(i,j)
ay = AY(i,j)
az = AZ(i,j)
wx = WX(i,j,j)
wy = WY(i,j,j)
wz = WZ(i,j,j)
# Compute force
tx = -k*ax - c*(wx**3)
ty = -k*ay - c*(wy**3)
tz = -k*az - c*(wz**3)
return [tx, ty, tz]
# Refer to the user subroutine in the bushing statementvto1 = Vtorque (label="nonlinear bushing", i=m1801, jfloat=m1901, rm=m1903,
function="user(1801,1903,1000.0,2.0)", routine=myVtosub )
Comments
- See Properties for an explanation about what properties are, why they are used, and how you can extend these.
- For a more detailed explanation about Vtorque, see Force: Two Body Vector.