Previous topic


Next topic

Binary Operators

This Page

State Vector

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

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

  • 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
  • *Extends

Returns a vector of NaNs to represent the shape of a StateVector. The size of a StateVector is the number of True elements in its evaluation_array See pybamm.Symbol.evaluate_for_shape()


Array to use for evaluating


Differentiate a slice of a StateVector of size m with respect to another slice of a StateVector of size n. This returns a (sparse) matrix of size m x n with ones where the y slices match, and zeros elsewhere.

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

See pybamm.Symbol.new_copy().


Set evaluation array using slices


See pybamm.Symbol.set_id()


Size of an object, found by evaluating it with appropriate t and y