Sensor
Model ElementSensor defines an event sensor in the model. Once an event of interest occurs, you can take action to respond to the event.
Class Name
Sensor
Description
For instance, the lateral acceleration of a car body may be monitored to determine whether the car is going out of control during a vehicle simulation. If this quantity becomes larger than a threshold value, you may like to stop the simulation.
Attribute Summary
Name | Property | Modifiable by command? | Designable? |
---|---|---|---|
id | Int () | No | |
label | Str () | Yes | |
value | Double () | ||
error | Double () | ||
operator | Enum ("LE EQ GE", default="EQ") | Yes | |
dt | Double () | ||
hmax | Double () | ||
halt | Bool () | ||
print_ | Bool () | ||
restart | Bool () | ||
return_ | Bool () | ||
stepsize | Double () | ||
zero_crossing | Double () | ||
function | Function ("SENSUB") | Yes | |
routine | Routine () | ||
evaluate | Function ("SEVSUB") | ||
evaluate_routine | Routine () | ||
active | Bool () | Yes |
Usage
#1: Sensor event is specified in a MotionSolve expression
Sensor (value=double, function=expressionString, optional_arguments)
#2: Sensor event is specified in a compiled user-subroutine
Sensor (value=double, function=userString, routine=string, optional_arguments)
#3: Sensor event is specified in a Python function
Sensor (value=double, function=userString, routine=functionPointer, optional_arguments)
Attributes
- value
- Double
- function
- String defining a valid MotionSolve expression.
- value
- Double
- function
- String defining a valid user function MotionSolve expression.
- routine
- String
- value
- Double
- function
- String defining a valid user function MotionSolve expression.
- routine
- Pointer to a callable function in Python.
- id
- Integer
- label
- String
- operator
- String
- error
- Double
- zero_crossing
- Double
- dt
- Double
- hmax
- Double
- halt
- Boolean
- Boolean
- restart
- Boolean
- return
- Boolean
- stepsize
- Double
- evaluate
- When specifying a function expression
- String defining a valid MotionSolve function expression
- Specifies a regular MotionSolve expression that evaluates to a value
- evaluate_routine
- When specifying a compiled user subroutine
- 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::mySevsub"
- "/staff/Altair/ engine.dll is the DLL
- mySevsub is the function within this DLL that performs the calculations
- String
- active
- Bool
Example
|
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 Sensor, see Sensor: Event.