Independent Variable

class pybamm.IndependentVariable(name, domain=None, auxiliary_domains=None, domains=None)[source]

A node in the expression tree representing an independent variable.

Used for expressing functions depending on a spatial variable or time

Parameters
  • name (str) – name of the node

  • domain (iterable of str) – list of domains that this variable is valid over

  • auxiliary_domains (dict, optional) – dictionary of auxiliary domains, defaults to empty dict

  • domains (dict) – A dictionary equivalent to {‘primary’: domain, auxiliary_domains}. Either ‘domain’ and ‘auxiliary_domains’, or just ‘domains’, should be provided (not both). In future, the ‘domain’ and ‘auxiliary_domains’ arguments may be deprecated.

  • *Extends

to_equation()[source]

Convert the node and its subtree into a SymPy equation.

class pybamm.Time[source]

A node in the expression tree representing time.

Extends: Symbol

create_copy()[source]

See pybamm.Symbol.new_copy().

to_equation()[source]

Convert the node and its subtree into a SymPy equation.

class pybamm.SpatialVariable(name, domain=None, auxiliary_domains=None, domains=None, coord_sys=None)[source]

A node in the expression tree representing a spatial variable.

Parameters
  • name (str) – name of the node (e.g. “x”, “y”, “z”, “r”, “x_n”, “x_s”, “x_p”, “r_n”, “r_p”)

  • domain (iterable of str) – list of domains that this variable is valid over (e.g. “cartesian”, “spherical polar”)

  • auxiliary_domains (dict, optional) – dictionary of auxiliary domains, defaults to empty dict

  • domains (dict) – A dictionary equivalent to {‘primary’: domain, auxiliary_domains}. Either ‘domain’ and ‘auxiliary_domains’, or just ‘domains’, should be provided (not both). In future, the ‘domain’ and ‘auxiliary_domains’ arguments may be deprecated.

  • *Extends

create_copy()[source]

See pybamm.Symbol.new_copy().

pybamm.t = the independent variable time

A node in the expression tree representing time.

Extends: Symbol