Piecewise Linear Timeseries

class ionworksdata.piecewise_linear_timeseries.PiecewiseLinearTimeseries(t_data: ndarray, y_data: ndarray, atol: float | None = None, rtol: float | None = None, name: str | None = None, options: dict[str, Any] | None = None)

A class to preprocess and linearize time series data using piecewise linear approximation.

Attributes:

t_dataarray-like

The time data points.

y_dataarray-like

The corresponding data points.

atolfloat, optional

Absolute tolerance for the solver. If None, uses the default solver atol of 1e-6.

rtolfloat, optional

Relative tolerance for the solver. If None, uses the default solver rtol of 1e-4.

namestr, optional

The name of the timeseries. Default is “Piecewise linear timeseries”.

optionsdict, optional

Additional options for preprocessing. If None, default options are used.

solver_max_save_pointsint, optional

Maximum number of points to save in the solver. Disabled by default.

interactive_preprocessingbool

Whether to use interactive preprocessing to select atol and rtol. Default is False.

window_maxint

Maximum window size for removing neighboring points. Default is 10.

interpolant(interpolator: str = 'linear', name: str | None = None, **kwargs) Interpolant

Generate an interpolant for the given sparse time series data.

Parameters

interpolatorstr, optional

The type of interpolation to use. Default is “linear”.

namestr, optional

The name of the interpolant. Default is the name of the timeseries.

**kwargs

Additional keyword arguments to pass to pybamm.Interpolant.

Returns

pybamm.Interpolant

An interpolant object for the sparse time series data.