HyperWorks Solvers

Vforce

Vforce

Previous topic Next topic No expanding text in this topic  

Vforce

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Model Element

Class Name

Vforce

Description

VFORCE defines a general force acting between two markers. 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?

id    

Int ()

 

label

Str ()

 

i      

Reference (Marker)

jfloat

Reference (Marker)

rm    

Reference (Marker)

fx    

Function  ()

fy    

Function  ()

fz    

Function  ()

function

Function  ("VFOSUB")

routine

Routine   ()

 

active

Bool ()

Usage

Vforce is available in three flavors.

#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 DLL

Vforce (i=objMarker, j=objMarker, function=userString, routine=string, optional_attributes)

 

#3. Force defined in a Python script

Vforce (i=objMarker, j=objMarker, function=userString, routine=functionPointer,

      optional_attributes)

Attribute Description

Force defined in a MotionSolve expression

i

Reference to an existing Marker object

Specifies the marker at which the force is applied.  This is designated as the point of application of the force.

The i attribute is mandatory.

j

Reference to an existing floating Marker object

Specifies the marker at which the reaction force is applied.  This is designated as the point of reaction of the force.

The j attribute is mandatory.

fx

String defining a valid MotionSolve expression

Specifies the MotionSolve expression that defines the force acting along the x-axis of the reference coordinate system (see rm below).  Any valid run-time MotionSolve expression can be provided as input.

The fx attribute is mandatory.

fy

String defining a valid MotionSolve expression

Specifies the MotionSolve expression that defines the force acting along the y-axis of the reference coordinate system (see rm below).  Any valid run-time MotionSolve expression can be provided as input.

The fy attribute is mandatory.

fz

String defining a valid MotionSolve expression

Specifies the MotionSolve expression that defines the force acting along the z-axis of the reference coordinate system (see rm below).  Any valid run-time MotionSolve expression can be provided as input.

The fz attribute is mandatory.

Force defined in a compiled DLL

 

i

Reference to an existing Marker object

Specifies the marker at which the force is applied.  This is designated as the point of application of the force.

The i attribute is mandatory.

j

Reference to an existing floating Marker object

Specifies the marker at which the reaction force is applied.  This is designated as the point of reaction of the force.

The j attribute is mandatory.

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 Vforce 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 Vforce. The second is the name of the function in the shared library that does the computation.

An example is: routine=”/staff/Altair/engine.dllmyVforce

”/staff/Altair/ engine.dll is the dll
“myVforce” is the function within this DLL that performs the calculations

The attribute routine is optional.

When not specified, routine defaults to VFOSUB.

Force and Torque defined in a Python function






i

Reference to an existing Marker object

Specifies the marker at which the force is applied.  This is designated as the point of application of the force.

The i attribute is mandatory.

j

Reference to an existing floating Marker object

Specifies the marker at which the reaction force is applied.  This is designated as the point of reaction of the force.

The j attribute is mandatory.

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 Vforce is defined.

The function attribute is mandatory.

routine

Pointer to a callable function in Python

An example is: routine=myVforce

myVforce is a Python function or method that can be called from wherever the model resides.

The attribute routine is optional.

When not specified, routine defaults to VFOSUB.

Optional attributes – Available to all variants

id

Integer

Specifies the element identification number.  This number must be unique among all the Vforce 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 Vforce object.

This attribute is optional. When not specified, MotionSolve will create a label for you.

rm

Reference to an existing Marker object

Specifies the marker in whose coordinate system the torque components are computed. rm can be on any body, including Ground

The rm attribute is optional.

When not specified, rm defaults to the global coordinate system.

Comments

1.See Properties, for an explanation about what properties are, why they are used and how you can extend these.
2.For a more detailed explanation about Vforce, see the Comments in the XML syntax section

Example

1.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)” )

2.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]

# Define a bushing with nonlinear damping

vfo2 = Vforce (label="nonlinear bushing", i=m1801, jfloat=m1901, rm=m1903,

  function=”user(1801,1903,1000.0, 2.0)”, routine=myVfosub )