Model Element |
||||||||||||||||||||||||||||||||
Class NameSforce Description |
||||||||||||||||||||||||||||||||
Sforce defines a force or torque acting between two Markers. 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 XML syntax section. 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
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) |
||||||||||||||||||||||||||||||||
Attribute Description |
||||||||||||||||||||||||||||||||
Force or torque magnitude defined in a MotionSolve expression |
||||||||||||||||||||||||||||||||
i |
Reference to an existing Marker object Specifies the marker at which the force and moment is applied. This is designated as the point of application of the force. The i attribute is mandatory. |
|||||||||||||||||||||||||||||||
j |
Reference to an existing Marker object Specifies the marker at which the reaction force and moment is applied. This is designated as the point of reaction of the force. The j attribute is mandatory. |
|||||||||||||||||||||||||||||||
type
|
String Specifies the type of Sforce being defined. Select from "TRANSLATION" and "ROTATION".
|
|||||||||||||||||||||||||||||||
function |
String defining a valid MotionSolve expression Specifies the MotionSolve expression that defines the VARIABLE. Any valid run-time MotionSolve expression can be provided as input. A constant magnitude Sforce can be specified as a constant expression. The function attribute is mandatory. |
|||||||||||||||||||||||||||||||
Force or torque magnitude defined in a compiled DLL |
||||||||||||||||||||||||||||||||
i |
Reference to an existing Marker object Specifies the marker at which the force and moment is applied. This is designated as the point of application of the force. The i attribute is mandatory. |
|||||||||||||||||||||||||||||||
j |
Reference to an existing Marker object Specifies the marker at which the reaction force and moment is applied. This is designated as the point of reaction of the force. The j attribute is mandatory. |
|||||||||||||||||||||||||||||||
type
|
String Specifies the type of Sforce being defined. Select from "TRANSLATION" and "ROTATION".
|
|||||||||||||||||||||||||||||||
function |
String defining a valid user function MotionSolve expression The list of parameters that are passed from the data file to the user defined subroutine where the Sforce is defined. The function attribute is mandatory. |
|||||||||||||||||||||||||||||||
routine |
String Specifies an alternative name for the user subroutine. The name consists of two pieces of information, separated by “∷”. The first is the pathname to the shared library containing the function that computes the response of the user-defined Variable. The second is the name of the function in the shared library that does the computation. An example is: routine=”/staff/Altair/engine.dll∷mySforce”
The attribute routine is optional. When not specified, routine defaults to SFOSUB. |
|||||||||||||||||||||||||||||||
Force or torque magnitude defined in a Python function |
||||||||||||||||||||||||||||||||
i |
Reference to an existing Marker object Specifies the marker at which the force and moment is applied. This is designated as the point of application of the force. The i attribute is mandatory. |
|||||||||||||||||||||||||||||||
j |
Reference to an existing Marker object Specifies the marker at which the reaction force and moment is applied. This is designated as the point of reaction of the force. The j attribute is mandatory. |
|||||||||||||||||||||||||||||||
type
|
String Specifies the type of Sforce being defined. Select from "TRANSLATION" and "ROTATION".
|
|||||||||||||||||||||||||||||||
function |
String defining a valid user function MotionSolve expression The list of parameters that are passed from the data file to the user defined subroutine where the Sforce is defined. The function attribute is mandatory. |
|||||||||||||||||||||||||||||||
routine |
Pointer to a callable function in Python An example is: routine=mySforce
The attribute routine is optional. When not specified, routine defaults to SFOSUB. |
|||||||||||||||||||||||||||||||
Optional attributes – Available to all variants |
||||||||||||||||||||||||||||||||
id |
Integer Specifies the element identification number. This number must be unique among all the Variable objects in the model. This attribute is optional. MotionSolve will automatically create an ID when one is not specified. Range of values: id > 0 |
|||||||||||||||||||||||||||||||
label |
String Specifies the name of the Variable object. This attribute is optional. When not specified, MotionSolve will create a label for you. |
|||||||||||||||||||||||||||||||
actiononly |
Boolean. Select from "True" and "False".
Default value is FALSE. |
|||||||||||||||||||||||||||||||
active |
Bool Select one from True or False.
The attribute active is optional. When not specified, active defaults to True |
|||||||||||||||||||||||||||||||
Comments |
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
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) |