Sforce
Model ElementSforce defines a force or torque acting between two Markers.
Class Name
Sforce
Description
The force or torque is characterized by a magnitude and a direction. The direction is pre-defined dependent on TYPE and ACTIONONLY. For details, see the Comments in the Force: Two Body Scalar model statement. The magnitude may be defined using a function expression, a user-defined subroutine, a Python script or a MATLAB script. The magnitude can 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 |
j | Reference (Marker) | Yes | Yes |
type | Enum ("TRANSLATION ROTATION") | ||
actiononly | Bool () | Yes | |
function | Function ("SFOSUB") | Yes | |
routine | Routine () | ||
active | Bool () | Yes |
Declaration
#1. Force or torque magnitude defined in a MotionSolve expression
Sforce (i=objMarker, j=objMarker, type=string, function=expressionString, routine=string, optional_attributes)
#2. Force or torque magnitude defined in a compiled DLL
Sforce (i=objMarker, j=objMarker, type=string, function=userString, routine=string, optional_attributes)
#3. Force or torque magnitude defined in a Python/Matlab script
Sforce (i=objMarker, j=objMarker, type=string, function=userString, routine=functionPointer, optional_attributes)
Attributes
- i
- Reference to an existing Marker object.
- j
- Reference to an existing Marker object.
- type
- String
- function
- String defining a valid MotionSolve expression
- i
- Reference to an existing Marker object
- j
- Reference to an existing Marker object.
- type
- String
- function
- String defining a valid user function MotionSolve expression.
- routine
- String
- i
- Reference to an existing Marker object
- j
- Reference to an existing Marker object.
- type
- String
- function
- String defining a valid user function MotionSolve expression.
- routine
- Pointer to a callable function in Python.
- id
- Integer
- label
- String
- actiononly
- Boolean
- active
- Bool
Example
#<Force_Scalar_TwoBody
# id = "7"
# type = "TORQUE"
# i_marker_id = "71"
# j_marker_id = "81"
# val_expression = "(SQRT(JOINT(7,2,0,71)**2 + JOINT(7,3,0,71)**2) + 1167)*
# STEP(0.044*WZ(71,72,72),-0.01,0.3,0.01,-0.3) * 0.44"
#/>
#
# Normal force: Fn
Fn = "sqrt (joint(7,2,0,71)**2 + joint(7,3,0,71)**2) + 1167)"
# Coefficient of friction: Mu
Mu = "step (0.044*wz(71,72,72),-0.01,0.3,0.01,-0.3)"
# Friction Torque = Pin_Radius * Fn * Mu
pinRad = "0.44"
fricTorque = pinRad + " * " + Fn + " * " + Mu
# Sforce
sf07 = Sforce (id=7, label= "sfo7", i=m71, j=m81, type="ROTATION", function=fricTorque)
Comments
- The table below summarizes the direction of the force or torque that is
applied by an Sforce.
Type ActionOnly Direction "TRANSLATION" True The direction of the force on Marker I is defined by the unit vector along the z-axis of Marker J. There is no reaction force on the body containing Marker J.
"TRANSLATION" False The direction of the force on Marker I is defined by the unit vector from Marker J to Marker I. The force on Marker J is equal and opposite.
"ROTATION" True The direction of the torque is also defined by the z-axis of Marker J. There is no reaction torque on the body containing Marker J.
"ROTATION" False The direction of the torque is defined by the z-axis of Marker J. The z-axis of Marker I and Marker J are required to always be parallel.
- 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 Sforce, see Force: Two Body Scalar model statement.