Open-circuit potential objectives

Objectives for fitting the open-circuit potential / open-circuit voltage data.

class ionworkspipeline.objectives.OCPHalfCell(electrode, data_input, options=None, callbacks=None, custom_parameters=None, constraints=None, penalties=None, parameters=None)

Objective for the open-circuit potential (OCP) of a half-cell.

Parameters

electrodestr

The electrode to fit (“positive” or “negative”).

data_inputstr or dict

The data to use for the fit, see FittingObjective.

optionsdict, optional

A dictionary of options to pass to the objective.

  • theta_ref: float

    The reference value of lithiation used to map between capacity and extent of lithiation (theta).

    For the positive electrode the reference value is by default assumed to be 1 at the lowest potential observed in the data (i.e. we assume that upon lithiation we obtain fully lithiated electrode). As a result, for the positive electrode we have 0 <= theta <= theta_ref.

    For the negative electrode the reference value is by default assumed to be 0 at the highest potential observed in the data (i.e. we assume that upon delithiation we obtain fully delithiated electrode). electrode is fully delithiated in the data). As a result, for the negative electrode we have theta_ref <= theta <= 1.

  • stoichiometry limits: 2-tuple of floats

    The limits of the stoichiometry (theta) to use for the fit, if fitting a smooth function to the data. Default is (0, 1) - i.e. the fit will use the whole range of theta. If the default does not give a good fit, we recommend restricting the fit to a smaller range of theta, e.g. (0.02, 0.98) or (0.05, 0.95).

  • voltage limits: 2-tuple of floats

    The voltage limits to use for fitting. Default is None, which uses the full range of voltage in the data.

  • dUdQ cutoff: float

    The cutoff dUdQ value to use for fitting (i.e. ignore large values near the ends that the solver tries to fit to). Default is None.

  • direction: str

    The direction of the OCP, either “lithiation” or “delithiation”. Default is None, which means no directionality is assumed.

callbacksionworkspipeline.callbacks.Callback or list of callbacks

A class with methods that get called at various points during the datafit process

custom_parametersdict, optional

A dictionary of custom parameters to use for the objective. Deprecated, use parameters instead.

constraintslist[Constraint], optional

A list of equality and inequality constraints to apply to the objective.

penaltieslist[Penalty], optional

A list of penalties to apply to the objective.

parametersdict or pybamm.ParameterValues, optional

Objective-specific parameter values merged into the global parameter values before fitting. Default is None.

Extends: ionworkspipeline.data_fits.objectives.ocp._OCPValidationMixin

build(parameter_values)

Build the objective.

Parameters

parameter_valuespybamm.ParameterValues

The parameter values to use for the objective.

classmethod default_options() dict[str, Any]

Return the default options for the OCPHalfCell objective.

class ionworkspipeline.objectives.ElectrodeBalancingHalfCell(electrode, data_input, options=None, callbacks=None, custom_parameters=None, constraints=None, penalties=None, parameters=None)

Objective for finding the starting capacity and total capacity of an electrode, given an known OCV function. For example, this can be used to fit the starting capacity and total capacity for a GITT experiment to align with a previously measured OCV curve.

Parameters

electrodestr

The electrode to fit (“positive” or “negative”).

data_inputstr or dict

The data to use for the fit, see FittingObjective.

optionsdict, optional
A dictionary of options to pass to the objective.
  • direction: str

    The direction of the OCP, either “lithiation” or “delithiation”. Default is None, which means no directionality is assumed.

  • GITT: bool

    Whether the data is sparse GITT data. If True, the data is interpolated and upsampled. Default is False.

  • objective variables: list of str

    The variables to use for the objective. Default is [“Voltage [V]”, “Differential voltage [V/Ah]”].

  • dUdQ cutoff: float

    The cutoff dUdQ value to use for fitting (i.e. ignore large values near the ends that the solver tries to fit to). Default is None.

callbacksionworkspipeline.callbacks.Callback or list of callbacks

A class with methods that get called at various points during the datafit process

custom_parametersdict, optional

A dictionary of custom parameters to use for the objective. Deprecated, use parameters instead.

constraintslist[Constraint], optional

A list of equality and inequality constraints to apply to the objective.

penaltieslist[Penalty], optional

A list of penalties to apply to the objective.

parametersdict or pybamm.ParameterValues, optional

Objective-specific parameter values merged into the global parameter values before fitting. Default is None.

Extends: ionworkspipeline.data_fits.objectives.ocp._OCPValidationMixin

build(parameter_values)

Build the objective.

Parameters

parameter_valuespybamm.ParameterValues

The parameter values to use for the objective.

classmethod default_options() dict[str, Any]

Return the default options for the ElectrodeBalancingHalfCell objective.

class ionworkspipeline.objectives.ElectrodeBalancing(data_input, options=None, callbacks=None, custom_parameters=None, constraints=None, penalties=None, parameters=None)

Objective for electrode balancing (finding electrode capacities and stoichiometries that give the best fit to the full cell data).

Parameters

data_inputstr or dict

The data to use for the fit, see FittingObjective.

optionsdict, optional
A dictionary of options to pass to the objective.
  • dUdQ cutoff: float

    The cutoff dUdQ value to use for fitting (i.e. ignore large values near the ends that the solver tries to fit to). Default is None.

  • direction: str

    The direction of the full-cell OCV, either “charge” or “discharge”. Default is None, which means no directionality is assumed.

  • GITT: bool

    Whether the data is sparse GITT data. If True, the data is interpolated and upsampled. Default is False.

  • objective variables: list of str

    The variables to use for the objective. Default is [“Voltage [V]”, “Differential voltage [V/Ah]”].

callbacksionworkspipeline.callbacks.Callback or list of callbacks

A class with methods that get called at various points during the datafit process

constraintslist[Constraint], optional

A list of equality and inequality constraints to apply to the objective.

penaltieslist[Penalty], optional

A list of penalties to apply to the objective.

custom_parametersdict, optional

A dictionary of custom parameters to use for the objective. Deprecated, use parameters instead.

parametersdict or pybamm.ParameterValues, optional

Objective-specific parameter values merged into the global parameter values before fitting. Default is None.

Extends: ionworkspipeline.data_fits.objectives.ocp._OCPValidationMixin

build(parameter_values)

Build the objective.

Parameters

parameter_valuespybamm.ParameterValues

The parameter values to use for the objective.

classmethod default_options() dict[str, Any]

Return the default options for the ElectrodeBalancing objective.

ionworkspipeline.objectives.get_U_half_cell(n_peaks, electrode)