Independent Variable#

class pybamm.IndependentVariable(name: str, domain: list[str] | str | None = None, auxiliary_domains: dict[str, str] | None = None, domains: dict[str, list[str] | str] | None = 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: pybamm.expression_tree.symbol.Symbol

to_equation() Symbol[source]#

Convert the node and its subtree into a SymPy equation.

class pybamm.Time[source]#

A node in the expression tree representing time.

Extends: pybamm.expression_tree.independent_variable.IndependentVariable

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: str, domain: list[str] | str | None = None, auxiliary_domains: dict[str, str] | None = None, domains: dict[str, list[str] | str] | None = 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: pybamm.expression_tree.independent_variable.IndependentVariable

create_copy()[source]#

See pybamm.Symbol.new_copy().

pybamm.t = the independent variable time#

A node in the expression tree representing time.