Previous topic

Simplify

Next topic

EvaluatorPython

This Page

Functions

class pybamm.Function(function, *children)[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) returns func(child0.evaluate(t, y), child1.evaluate(t, y), etc).
  • children (pybamm.Symbol) – The children nodes to apply the function to
  • **Extends (** pybamm.Symbol) –
diff(variable)[source]

See pybamm.Symbol.diff().

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

See pybamm.Symbol.evaluate().

evaluate_for_shape()[source]

Default behaviour: has same shape as all child See pybamm.Symbol.evaluate_for_shape()

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

Returns logarithmic function of child.

pybamm.max(child)[source]

Returns max function of child.

pybamm.min(child)[source]

Returns min function of child.

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.