Class Sensor()

Sensor(parent='MODEL', name='Sensor_n', label='Sensor_n', active=True, value=0, operator='EQ', 
error=0, halt=False, restart=False, print_=False, return_=False, codgen=False, yydump=False, 
use_stepsize=False, stepsize=0, use_dt=False, dt=0, do_evaluate=False, evaluate_user=False)

Creates a sensor entity.

Keyword Arguments

Argument Data Type Description Default
name String The variable name. Sensor_n, for next available integer n.
label String The descriptive label. Sensor_n, for next available integer n.
parent Object The parent. MODEL
active Boolean Used to activate or deactivate this entity. True
value Double The value that the main expression will be compared against. 0
operator Enum The sensor will be triggered when the value is within error, either less than, equal to, or greater than. One of GE, LE or EQ. EQ
error Double The tolerance where the main sensor expression and value have to differ within, in order for the sensor to be triggered. 0
halt Bool Causes the solver to stop simulation if set to True. False
restart Bool Causes the solver to restart if the sensor is triggered when True. False
print Bool Causes results to be written to the output files at the time when the sensor. False
return Bool Causes the solver to return to the command input for simulation to continue when True. Defaults to False. * codgen (Bool) : Causes the solver to generate a new pivot sequence if set to True. False
yydump Bool Causes the solver to export the state variable vector when True. False
use_stepsize Bool Use the stepsize provided by stepsize when True. False
stepsize Double Resets the stepsize to this if the sensor is triggered. 0
use_dt Bool Use the solver printout stepsize provided by dt when True. False
dt Double Resets the solver printout steps to this value. 0
do_evaluate Bool Determines if an evaluation of an expression will occur when a sensor is triggered, and if the expression is determined by a user subroutine or direct expression. False
evaluate_user Bool Indicates if the main expression for the sensor will be described directly by an expression or by a user subroutine. False
evaluate_local_funcname String The function/subroutine name. 'MOTSUB'
evaluate_use_local_dll Bool Uses a local function when True. False
evaluate_local_dll File The path and filename for the user subroutine DLL to be used with an instance of the user defined sensor. ''
evaluate_local_func_type Enum The type of the user subroutine. One of DLL, PYTHON or MATLAB. 'DLL'
evaluate_usr_sub Function The expression passed to the user DLL. When using solver expressions, Templex syntax (within ``) is used and all variables are enclosed in braces {} and the rest is treated as literal. 'USER()'


Instance Type Description
expr Nonlinear Main expression of the sensor.
evaluate_expr Nonlinear Expression when do_evaluate is True.