Previous topic

Vector

Next topic

Binary Operators

This Page

State Vector

class pybamm.StateVector(*y_slices, name=None, domain=None, auxiliary_domains=None, evaluation_array=None)[source]

Node in the expression tree that holds a slice to read from an external vector type.

Parameters:
  • y_slice (slice) – the slice of an external y to read
  • name (str, optional) – the name of the node
  • domain (iterable of str, optional) – list of domains the parameter is valid over, defaults to empty list
  • auxiliary_domains (dict of str, optional) – dictionary of auxiliary domains
  • evaluation_array (list, optional) – List of boolean arrays representing slices. Default is None, in which case the evaluation_array is computed from y_slices.
  • *Extends
diff(variable)[source]

Differentiate a symbol with respect to a variable. For any symbol that can be differentiated, return 1 if differentiating with respect to yourself, self._diff(variable) if variable is in the expression tree of the symbol, and zero otherwise.

Parameters:variable (pybamm.Symbol) – The variable with respect to which to differentiate
class pybamm.StateVectorDot(*y_slices, name=None, domain=None, auxiliary_domains=None, evaluation_array=None)[source]

Node in the expression tree that holds a slice to read from the ydot.

Parameters:
  • y_slice (slice) – the slice of an external ydot to read
  • name (str, optional) – the name of the node
  • domain (iterable of str, optional) – list of domains the parameter is valid over, defaults to empty list
  • auxiliary_domains (dict of str, optional) – dictionary of auxiliary domains
  • evaluation_array (list, optional) – List of boolean arrays representing slices. Default is None, in which case the evaluation_array is computed from y_slices.
  • *Extends
diff(variable)[source]

Differentiate a symbol with respect to a variable. For any symbol that can be differentiated, return 1 if differentiating with respect to yourself, self._diff(variable) if variable is in the expression tree of the symbol, and zero otherwise.

Parameters:variable (pybamm.Symbol) – The variable with respect to which to differentiate