is_constant_over_dt function

(Shortest import: from brian2.equations.codestrings import is_constant_over_dt)

brian2.equations.codestrings.is_constant_over_dt(expression, variables, dt_value)[source]

Check whether an expression can be considered as constant over a time step. This is not the case when the expression either:

  1. contains the variable t (except as the argument of a function that can be considered as constant over a time step, e.g. a TimedArray with a dt equal to or greater than the dt used to evaluate this expression)
  2. refers to a stateful function such as rand().
Parameters:

expression : sympy.Expr

The (sympy) expression to analyze

variables : dict

The variables dictionary.

dt_value : float or None

The length of a timestep (without units), can be None if the time step is not yet known.

Returns:

is_constant : bool

Whether the expression can be considered to be constant over a time step.