Previous topic

Input Parameter

Next topic

Operations on expression trees

This Page

Interpolant

class pybamm.Interpolant(data, child, name=None, interpolator='cubic spline', extrapolate=True, entries_string=None)[source]

Interpolate data in 1D.

Parameters:
  • data (numpy.ndarray) – Numpy array of data to use for interpolation. Must have exactly two columns (x and y data)
  • child (pybamm.Symbol) – Node to use when evaluating the interpolant
  • name (str, optional) – Name of the interpolant. Default is None, in which case the name “interpolating function” is given.
  • interpolator (str, optional) – Which interpolator to use (“pchip” or “cubic spline”). Note that whichever interpolator is used must be differentiable (for Interpolator._diff). Default is “cubic spline”. Note that “pchip” may give slow results.
  • extrapolate (bool, optional) – Whether to extrapolate for points that are outside of the parametrisation range, or return NaN (following default behaviour from scipy). Default is True.
  • **Extends** (pybamm.Function) –
set_id()[source]

See pybamm.Symbol.set_id().