Model Element |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Class NameSensor Description |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sensor defines an event sensor in the model. Once an event of interest occurs, you can take action to respond to the event. 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
UsageThree alternative implementations of Sensor_Event are available in MotionSolve. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#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) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Attribute Description |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sensor event is specified in a MotionSolve expression |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
value |
Double The sensor event threshold. An event is said to occur when the Sensor expression or user subroutine meets the comparison criterion with respect to value. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
function |
String defining a valid MotionSolve expression Specifies the MotionSolve expression that defines the Sensor value. Any valid run-time MotionSolve expression can be provided as input. The function attribute is mandatory. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sensor event is specified in a compiled user-subroutine |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
value |
Double The sensor event threshold. An event is said to occur when the Sensor expression or user subroutine meets the comparison criterion with respect to value. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 Sensor 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∷mySensor”
The attribute routine is optional. When not specified, routine defaults to SENSUB. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sensor event is specified in a Python function |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
value |
Double The sensor event threshold. An event is said to occur when the Sensor expression or user subroutine meets the comparison criterion with respect to value. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 Sensor is defined. The function attribute is mandatory. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
routine |
Pointer to a callable function in Python An example is: routine=mySensub
The attribute routine is optional. When not specified, routine defaults to SENSUB. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Optional attributes – Available to all variants |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id |
Integer Specifies the element identification number. This number must be unique among all the Sensor 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 Sensor object. This attribute is optional. When not specified, MotionSolve will create a label for you. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operator |
String Defines the comparison operator. Select from “GE”, “EQ”, or “LE”. The comparison operator is used to detect when an event has occurred. It is implemented as follows:
This attribute is optional. When not specified, it defaults to “EQ”. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
error |
Double Defines the error tolerance for detecting an event. When the sensed value is within this tolerance of the threshold value, the solver generates an event. This attribute is optional. When not specified, it defaults to 0.001. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
zero_crossing |
Double Specifies the tolerance for the zero crossing search. The tolerance is defined as the value of zero_crossing multiplied by the current hmax. The search stops when the time reaches the exact time the event happens within this tolerance. See Comment 3 in the XML section for more details. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dt |
Double Specifies the new print interval to be applied when the event occurs. This attribute is optional. When not specified, the print interval is NOT changed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hmax |
Double Specifies the value of the maximum step size the solver is allowed to take as soon as the sensor is triggered. This value persists until the end of the simulation unless changed by another sensor. This attribute is optional. When not specified, the maximum step-size is NOT changed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
halt |
Boolean Set to either True or False. Stops the simulation when the event occurs and halt=True. This attribute is optional. When not specified, halt=False. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Boolean Set to either True or False. Prints an output when the event occurs and print=True This attribute is optional. When not specified, print=False. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
restart |
Boolean Set to either True or False. When restart=True and an event is sensed, MotionSolve will restart the integrator. All integrator history of the system is deleted and the integrator starts over. This attribute is optional. When not specified, restart=False. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return |
Boolean Set to either True or False. When return=True and an event is sensed, the action is to return control of the program to the command processor so the next command can be processed. If there are no more commands, simulation is halted. This attribute is optional. When not specified, restart=True. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
stepsize |
Double Specifies the maximum step size for the next trial step. This expires after one step. This attribute is optional. When not specified, the integrator step-size remains unaffected. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
evaluate |
When specifying a function expression String defining a valid MotionSolve function expression Specifies a regular MotionSolve expression that evaluates to a value When specifying a user subroutine String defining a valid user function MotionSolve expression Contains the list of parameters that are passed from the data file to the user- defined subroutine where the evaluation is performed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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”
The attribute routine is optional. When not specified, routine defaults to SEVSUB. When specifying a Python function Pointer to a callable function in Python An example is: routine= mySevsub
The attribute evaluate_routine is optional. When not specified, routine defaults to SEVSUB. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
active |
Bool Select one from True or False.
The attribute active is optional. When not specified, active defaults to True |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comments
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example
|