Scalar#

class pybamm.Scalar(value: int | float | number, name: str | None = None)[source]#

A node in the expression tree representing a scalar value.

Parameters:
  • value (numeric) – the value returned by the node when evaluated

  • name (str, optional) – the name of the node. Defaulted to str(value) if not provided

Extends: pybamm.expression_tree.symbol.Symbol

create_copy()[source]#

See pybamm.Symbol.new_copy().

is_constant() Literal[True][source]#

See pybamm.Symbol.is_constant().

set_id()[source]#

See pybamm.Symbol.set_id().

to_equation()[source]#

Returns the value returned by the node when evaluated.

to_json()[source]#

Method to serialise a Symbol object into JSON.

property value#

The value returned by the node when evaluated.