Vforce
Model ElementVFORCE defines a general force acting between two markers.
Class Name
Vforce
Description
The force vectors is defined by its three components with respect to a third marker. The components may be defined using MotionSolve expressions or a user-defined subroutine. 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 |
fx | Function () | Yes | Yes |
fy | Function () | Yes | Yes |
fz | Function () | Yes | Yes |
function | Function ("VFOSUB") | Yes | |
routine | Routine () | ||
active | Bool () | Yes |
Usage
#1. Force defined in a MotionSolve expression Vforce (i=objMarker, j=objMarker, fx=expressionString, fy=expressionString, fz=expressionString, optional_attributes)
#2. Force defined in a compiled DLLVforce (i=objMarker, j=objMarker, function=userString, routine=string, optional_attributes)
#3. Force defined in a Python scriptVforce (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.
- fx
- String defining a valid MotionSolve expression.
- fy
- String defining a valid MotionSolve expression.
- fz
- 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
- Vforce defined via
expressions.
Vfo1 = Vforce (label="nonlinear bushing", i=m1801, jfloat=m1901, rm=m1903, fx="-1e3*DX(1801,1903,1903) -2*(VX(1801,1903,1903,1903)**3)", fy="-1e3*DY(1801,1903,1903) -2*(VY(1801,1903,1903,1903)**3)", fz="-1e3*DZ(1801,1903,1903) -2*(VZ(1801,1903,1903,1903)**3)")
- Vforce defined in a Python
function.
# Define the user subroutine first def myVfosub (id, time, par, npar, dflag, iflag): i = par[0] j = par[1] k = par[2] c = par[3] # Get the state of the bushing dx = DX(i,j,j) dy = DY(i,j,j) dz = DZ(i,j,j) vx = VX(i,j,j,j) vy = VY(i,j,j,j) vz = VZ(i,j,j,j) # Compute force fx = -k*dx - c*(vx**3) fy = -k*dy - c*(vy**3) fz = -k*dz - c*(vz**3) return [fx, fy, fz]
vfo2 = Vforce (label= "nonlinear bushing" , i=m1801, jfloat=m1901, rm=m1903,
function= "user(1801,1903,1000.0, 2.0)" , routine=myVfosub )
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 Vforce, see Force: Two Body Vector.