Sensors

Sense an event during simulation and control the future course of the simulation.

The sensor entity tracks a signal (a solver function) during the simulation and gets activated when the value of the signal at the current timestep matches the value and condition to which it is compared. Once the sensor is activated, the next course of the simulation could be changed.

  • halt, restart, or execute the next command in sequence for the solver
  • evaluate an expression
  • change solution parameters such as output step, maximum step size, etc.

For information on how to add or edit an entity like a Sensor, see Entity Creation.

By default, variables names of entities follow a certain convention. For example, all sensor entities have a variable name starting with “Sensor_0”. This is the recommended convention to follow when building models since it has many advantages in model editing and model manipulation.

Sensor Properties

Descriptions of sensor properties in the Property Editor.

Table 1.
Property Name Description
General
Name Name of the entity
Variable Name The variable name, a unique identifier string of the entity
ID A unique identifying integer
Signal
Type

Select the type of input for the signal

  • Constant: In the Value (expr) field, enter a constant value.
  • Spline:
    1. Select an Interpolation method:
      • AKIMA
      • CUBIC
      • LINEAR
      • QUINTIC
    2. Enter a value under Independent variable. The independent variable should be specified in Templex syntax.
    3. Select a spline:
      1. Next to Spline (fx), click the empty field.
      2. In the microdialog, click .
      3. In the Select Spline dialog, select a spline.
      Note: To use a spline, you first need to define a spline that represents the behavior of the sensor.
  • Spline3D (expr):
    1. Select an Interpolation method:
      • AKIMA
      • CUBIC
      • LINEAR
      • QUINTIC
    2. Specify an expression for Independent variable X and Independent variable Z.
    3. Select a spline3D:
      1. Next to Spline3D (fx), click the empty field.
      2. In the microdialog, click .
      3. In the Select Spline3D dialog, select a spline3D.
      Note: To use a spline3D, you first need to define a spline3D that represents the behavior of the sensor.
  • Expression (expr): Enter a solver expression.
User-defined This is an alternate to the Type choices. Use a subroutine to define the sensor.
  • For User expr, provide an expression with the USER solver function with parameters being passed to the user subroutine.
  • Turn on Use local file and function name to provide a local file for the subroutine. Otherwise, Inspire Motion will search for the subroutine within its search path.
    1. Specify a Local file where the subroutine code can be accessed by the solver. If this option is not specified, the application will search for a subroutine following its user subroutine loading rules.
      Note: The type of file to be specified will depend on the selected function type. For example, if DLL/SO is selected, you can specify a file with a .dll extension (for Windows) or an .so extension (for Linux).
    2. Select a Function type from the dropdown menu:
      • DLL/SO
      • Python
      • MatLab
      • Compose
    3. Specify the Function name in the subroutine that defines the entity, or accept the default name provided by the application.
Compare To

Define the value that the current signal will be compared to.

Value Enter a Value (Real) to compare the signal with.
Error Specify the tolerance applied to the value to create a numerical bandwidth.
Respond if Select one of the following options for triggering a response.
Option Description
Signal is greater than VALUE - ERROR Make the response trigger when the signal is greater than the value.
Signal is less than VALUE + ERROR Make the response trigger when the signal is less than the value.
Abs(Signal) is less than or equal to VALUE + ERROR Make the response trigger when the signal is near equal to the value.
Response

Specify one or more actions the solver should take when the signal is within the Compare To range. Click any of the check boxes to activate the response.

Halt simulation The simulation will stop when the sensor is triggered.
Restart simulation The simulation will start when the sensor is triggered.
Print to output Results will be written to the output files when the sensor is triggered.
Evaluate expression Evaluate the expression provided when the sensor is triggered.
New output step Activating this option allows you to provide a value that will result in the solver using a new output step from that point forward.
New integration step Activating this option allows you to provide a value for the maximum stepsize for the next solver iteration step.
Return to command file Read the next solver command in sequence when the sensor is triggered.
New pivot sequence Reset the pivot sequence for the solver when the sensor is triggered.
Export state variable vector Write the state information to a file when the sensor is triggered.
Notes and Tags
Attachment Candidate Add an attachment candidate tag. See Attachments.