Previous topic

Broadcasting Operators

Next topic

Input Parameter

This Page

Functions

class pybamm.Function(function, *children, name=None, derivative='autograd', differentiated_function=None)[source]

A node in the expression tree representing an arbitrary function

Parameters:
  • function (method) – A function can have 0 or many inputs. If no inputs are given, self.evaluate() simply returns func(). Otherwise, self.evaluate(t, y, u) returns func(child0.evaluate(t, y, u), child1.evaluate(t, y, u), etc).
  • children (pybamm.Symbol) – The children nodes to apply the function to
  • derivative (str, optional) – Which derivative to use when differentiating (“autograd” or “derivative”). Default is “autograd”.
  • differentiated_function (method, optional) – The function which was differentiated to obtain this one. Default is None.
  • **Extends (** pybamm.Symbol) –
diff(variable)[source]

See pybamm.Symbol.diff().

evaluate(t=None, y=None, y_dot=None, inputs=None, known_evals=None)[source]

See pybamm.Symbol.evaluate().

evaluates_on_edges()[source]

See pybamm.Symbol.evaluates_on_edges().

get_children_domains(children_list)[source]

Obtains the unique domain of the children. If the children have different domains then raise an error

new_copy()[source]

See pybamm.Symbol.new_copy().

class pybamm.SpecificFunction(function, child)[source]

Parent class for the specific functions, which implement their own diff operators directly.

Parameters:
  • function (method) – Function to be applied to child
  • child (pybamm.Symbol) – The child to apply the function to
class pybamm.Cos(child)[source]

Cosine function

pybamm.cos(child)[source]

Returns cosine function of child.

class pybamm.Cosh(child)[source]

Hyberbolic cosine function

pybamm.cosh(child)[source]

Returns hyperbolic cosine function of child.

class pybamm.Exponential(child)[source]

Exponential function

pybamm.exp(child)[source]

Returns exponential function of child.

class pybamm.Log(child)[source]

Logarithmic function

pybamm.log(child, base='e')[source]

Returns logarithmic function of child (any base, default ‘e’).

pybamm.max(child)[source]

Returns max function of child. Not to be confused with pybamm.maximum(), which returns the larger of two objects.

pybamm.min(child)[source]

Returns min function of child. Not to be confused with pybamm.minimum(), which returns the smaller of two objects.

class pybamm.Sin(child)[source]

Sine function

pybamm.sin(child)[source]

Returns sine function of child.

class pybamm.Sinh(child)[source]

Hyperbolic sine function

pybamm.sinh(child)[source]

Returns hyperbolic sine function of child.