Previous topic

Vector

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

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
  • *Extends
evaluate_for_shape()[source]

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()

evaluation_array

Array to use for evaluating

jac(variable)[source]

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
new_copy()[source]

See pybamm.Symbol.new_copy().

set_evaluation_array(y_slices)[source]

Set evaluation array using slices

set_id()[source]

See pybamm.Symbol.set_id()

size

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