Model Element |
||||||||||||||||||||||||||||||||
Class NamePforce Description |
||||||||||||||||||||||||||||||||
Pforce defines a penalty force whose purpose is to maintain a “soft” constraint in the system. This means that when the constraint is satisfied, there is no penalty force. However, if the constraint is violated, a penalty force that tries to reduce the violation is generated. The generalized force acts on all the coordinates involved in the definition of the constraint. Pforce is available in three different implementations. |
||||||||||||||||||||||||||||||||
Attribute Summary
Usage |
||||||||||||||||||||||||||||||||
#1. Constraint defined in a MotionSolve expression Pforce (function=expressionString, penalty=double, optional_attributes)
#2. Constraint defined in a compiled DLL Pforce (function= userString, penalty=double, routine=string, optional_attributes)
#3. Constraint defined in a Python/Matlab script Pforce (function= userString, penalty=double, routine=functionPointer, optional_attributes) |
||||||||||||||||||||||||||||||||
Attribute |
Description |
|||||||||||||||||||||||||||||||
Pforce defined in a MotionSolve expression |
||||||||||||||||||||||||||||||||
function |
String defining a valid MotionSolve expression Specifies the MotionSolve expression that defines the Pforce. Any valid run-time MotionSolve expression can be provided as input. The function attribute is mandatory. |
|||||||||||||||||||||||||||||||
penalty |
Double Specifies a penalty factor to be used in calculating the restoring force that is used to enforce that the algebraic constraint is always zero. The attribute routine is mandatory. Range of values: penalty ≥ 0. |
|||||||||||||||||||||||||||||||
Pforce defined in a compiled DLL |
||||||||||||||||||||||||||||||||
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 Pforce is defined. The function attribute is mandatory. |
|||||||||||||||||||||||||||||||
penalty |
Double Specifies a penalty factor to be used in calculating the restoring force that is used to enforce that the algebraic constraint is always zero. The attribute penalty is mandatory. Range of values: penalty ≥ 0. |
|||||||||||||||||||||||||||||||
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∷myPforce”
The attribute routine is optional. When not specified, routine defaults to PFOSUB. |
|||||||||||||||||||||||||||||||
Pforce defined in a Python function |
||||||||||||||||||||||||||||||||
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 Pforce is defined. The function attribute is mandatory. |
|||||||||||||||||||||||||||||||
penalty |
Double Specifies a penalty factor to be used in calculating the restoring force that is used to enforce that the algebraic constraint is always zero. The attribute penalty is mandatory. Range of values: penalty ≥ 0. |
|||||||||||||||||||||||||||||||
routine |
Pointer to a callable function in Python An example is: routine=myPforce
The attribute routine is optional. When not specified, routine defaults to PFOSUB. |
|||||||||||||||||||||||||||||||
Optional attributes – Available to all variants |
||||||||||||||||||||||||||||||||
id |
Integer Specifies the element identification number. This number must be unique among all the Pforce 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 Pforce object. This attribute is optional. When not specified, MotionSolve will create a label for you. |
|||||||||||||||||||||||||||||||
penalty1 |
Double Specifies a second penalty factor to be used in calculating the restoring force that is used to enforce that the time derivative of the algebraic constraint. The attribute penalty1 is optional. When not specified, Penalty1 defaults to 0.0. Range of values: penalty1 ≥ 0. |
|||||||||||||||||||||||||||||||
unilateral |
Boolean Select one from True and False.
The attribute unilateral is optional. It defaults to False when not specified. |
|||||||||||||||||||||||||||||||
smoothing_factor |
Double The penalty force due to a unilateral constraint is ramped up in a smooth manner using a STEP function. This specifies the x-value at which the smoothing is completed. The attribute smoothing_factor is optional. When not specified, smoothing_factor defaults to 0.0. Range of values: smoothing_factor ≥ 0. |
|||||||||||||||||||||||||||||||
active |
Bool Select one from True or False.
The attribute active is optional. When not specified, active defaults to True |
|||||||||||||||||||||||||||||||
Comments
|
||||||||||||||||||||||||||||||||
Example
XML Syntax:
Python Syntax: pf1 = Pforce (label="particle sliding on a catenary", function="dy(9)-cosh(dx(9))", penalty=1e4, penalty1=1e2)
XML Syntax:
Python Syntax: pf2 = Pforce (label="Enforce 1+x < = y", function="1+dx(10)-dy(10)", penalty=1e4, penalty1=1e2, unilateral=True, smoothing_factor=1)
XML Syntax: Python Syntax: |
||||||||||||||||||||||||||||||||
pf3 = Pforce (label="Enforce 1+x < = z", function="1+dx(10)-dz(10)", penalty=1e4, penalty1=1e2, unilateral=True, smoothing_factor=1)
pf4 = Pforce (label="Enforce 1-x < = z", function="1-dx(10)-dz(10)", penalty=1e4, penalty1=1e2, unilateral=True, smoothing_factor=1) |