Model ElementRequest defines an output request entity in MotionSolve.
Description
Request are written to MotionSolve output files so
that they may be used for plotting and signal processing by HyperGraph.
Request is available in four types:
- As built-in marker-based functions
- As a set of expressions based on the MotionSolve
run-time expression language
- As a user-subroutine written in a compiled language Fortran, C or C++
- As a user-subroutine written in Python
Attribute Summary
Name |
Property |
Modifiable by
command? |
Designable? |
id |
Int
() |
|
No |
label |
Str
() |
Yes |
type |
Enum
("DISPLACEMENT VELOCITY ACCELERATION FORCE") |
|
i |
Reference (Marker) |
Yes |
j |
Reference (Marker) |
Yes |
rm |
Reference (Marker) |
Yes |
f1 |
Function () |
Yes |
f2 |
Function () |
Yes |
f3 |
Function () |
Yes |
f4 |
Function () |
Yes |
f5 |
Function () |
Yes |
f6 |
Function () |
Yes |
f7 |
Function () |
Yes |
f8 |
Function () |
Yes |
function |
Function ("REQSUB") |
|
routine |
Routine () |
|
comment |
String () |
|
results_name |
String () |
|
cnames |
String () |
|
cunits |
String () |
|
clabels |
String () |
|
variables |
Reference ("Variable", count=0) |
|
active |
Bool
() |
Yes |
Usage
#1. As built-in marker-based functions
Request (type=string, i=objMarker, optional_attributes)
#2: As a set of expressions based on the MotionSolve run-time expression language
Request (optional_attributes)
#3. As a user-subroutine written in a compiled language Fortran, C or C++
Request (function=userString, routine=string, optional_attributes)
#4. As a user-subroutine written in Python
Request (function=userString, routine=functionPointer, optional_attributes)
Attributes
As built-in marker-based functions
- type
- String
- Specifies the type of REQUEST element. Select from
"DISPLACEMENT", "VELOCITY",
"ACCELERATION", or "FORCE".
- The type attribute is mandatory.
- i
- Reference to an existing Marker object.
- Specifies the Reference_Marker ID at which the
information is being calculated.
- The i attribute is mandatory.
- j
- Reference to an existing Marker object.
- Specifies the Reference_Marker ID at which the
information is being calculated. from which the information is being
calculated. The information is typically some vector or orientation
relating to j, such as displacement, velocity,
acceleration and I or force.
- The j attribute is optional.
- When not specified, j defaults to the global
coordinate system. You can also set j=0, indicating
it is the global coordinate system.
- rm
- Reference to an existing Marker object.
- Specifies the Marker in whose coordinate system the
vector 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. You can also set rm=0, indicating
it is the global coordinate system.
As a set of expressions
- f1, f2,
f3,f4, f5,
f6,f7,
f8
- String defining a valid MotionSolve
expression.
- Each of these attributes contains an expression that specifies a scalar
quantity that is to be computed at run-time as output.
- All of these attributes are optional. When not specified they default to
0.
- As a user-subroutine written in a compiled language Fortran, C or
C++
- 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 Request 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.dll::myRequest"
- "/staff/Altair/
engine.dll is the DLL
- "myRequest" is the
function within this DLL that performs the calculations
- The attribute routine is optional.
- When not specified, routine defaults to
REQSUB.
As a user-subroutine written in
Python
- 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 Request is
defined.
- The function attribute is mandatory.
- routine
- Pointer to a callable function in Python.
- An example is:
routine=myRequest.
-
- myRequest 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
REQSUB.
Optional attributes - Available to all variants
- id
- Integer
- Specifies the element identification number. This number must be unique
among all the Gforce objects in the model.
- This attribute is optional. MotionSolve
automatically creates an ID when one is not specified.
- Range of values: id > 0
- label
- String
- Specifies the name of the Gforce object.
- This attribute is optional. When not specified, MotionSolve will create a label for you.
- comment
- String
- A character string that gives a general description of signals being
measured in this Request. The string can be of any
length.
- This attribute is optional.
- cnames
- List of strings.
- Specifies eight component names for each of the eight signals.
- This attribute is optional.
- cunits
- List of strings.
- Specifies the Units of each signal.
- This attribute is optional.
- active
- Bool
- Select one from True or False.
- True indicates that the element is active in
the model and it affects the behavior of the system
- False indicates that the element is inactive in
the model and it does not affect the behavior of the system. It
is almost as if the entity was removed from the model, of course
with the exception that can be turned "ON" when
desirable.
The attribute active is optional. When not
specified, False defaults to
True
Example
- XML example: Marker displacement
REQUEST.
req1 = Request(type="DISPLACEMENT", i=satellite.cm, comment="Satellite trajectory time history")
- XML example: Angular Momentum
REQUEST.
Hx = "{M}*WX ({i},0,{i})".format(M=satellite.mass, i=satellite.cm)
Hy = "{M}*WY ({i},0,{i})".format(M=satellite.mass, i=satellite.cm)
Hz = "{M}*WZ ({i},0,{i})".format(M=satellite.mass, i=satellite.cm )
req2 = Request (f2=Hx, f3=Hy, f4=Hz, comment="Satellite angular momentum")
- XML Example: Force
REQUEST.
req3 = Request (type="Force", i=m1102, j=m1972, rm=m1972, comment="Tether force time history")
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 Request,
see Post: Request.