Parameter#

class pybamm.Parameter(name)[source]#

A node in the expression tree representing a parameter.

This node will be replaced by a pybamm.Scalar node

Parameters:

name (str) – name of the node

Extends: pybamm.expression_tree.symbol.Symbol

create_copy()[source]#

See pybamm.Symbol.new_copy().

is_constant()[source]#

See pybamm.Symbol.is_constant().

to_equation()[source]#

Convert the node and its subtree into a SymPy equation.

to_json()[source]#

Method to serialise a Symbol object into JSON.

class pybamm.FunctionParameter(name, inputs, diff_variable=None, print_name='calculate')[source]#

A node in the expression tree representing a function parameter.

This node will be replaced by a pybamm.Function node if a callable function is passed to the parameter values, and otherwise (in some rarer cases, such as constant current) a pybamm.Scalar node.

Parameters:
  • name (str) – name of the node

  • inputs (dict) – A dictionary with string keys and pybamm.Symbol values representing the function inputs. The string keys should provide a reasonable description of what the input to the function is (e.g. “Electrolyte concentration [mol.m-3]”)

  • diff_variable (pybamm.Symbol, optional) – if diff_variable is specified, the FunctionParameter node will be replaced by a pybamm.Function and then differentiated with respect to diff_variable. Default is None.

  • print_name (str, optional) – The name to show when printing. Default is ‘calculate’, in which case the name is calculated using sys._getframe().

Extends: pybamm.expression_tree.symbol.Symbol

create_copy()[source]#

See pybamm.Symbol.new_copy().

diff(variable)[source]#

See pybamm.Symbol.diff().

set_id()[source]#

See pybamm.Symbol.set_id()

to_equation()[source]#

Convert the node and its subtree into a SymPy equation.

to_json()[source]#

Method to serialise a Symbol object into JSON.