Expression class
(Shortest import: from brian2 import Expression)
- class brian2.equations.codestrings.Expression(code=None, sympy_expression=None)[source]
Bases:
CodeString
Class for representing an expression.
Attributes
Stochastic variables in this expression
Methods
Split the expression into a stochastic and non-stochastic part.
Details
- stochastic_variables
Stochastic variables in this expression
- split_stochastic()[source]
Split the expression into a stochastic and non-stochastic part.
Splits the expression into a tuple of one
Expression
objects f (the non-stochastic part) and a dictionary mapping stochastic variables toExpression
objects. For example, an expression of the formf + g * xi_1 + h * xi_2
would be returned as:(f, {'xi_1': g, 'xi_2': h})
Note that theExpression
objects for the stochastic parts do not include the stochastic variable itself.