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 toderivative (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.expression_tree.symbol.Symbol
- diff(variable)[source]#
See
pybamm.Symbol.diff()
.
- 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
- 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.