Current-driven objective

Objectives for fitting the data generated by a current-driven experiment.

class ionworkspipeline.objectives.CurrentDriven(data_input, options=None, callbacks=None, custom_parameters=None)

Objective for generic current-driven experiment.

Parameters

data_inputstr or dict

The data to use for the fit, see Objective.

optionsdict, optional

A dictionary of options to pass to the objective.

  • model: :class:pybamm.BaseModel

    The model to fit. No default is provided, but this option is required (a model must be passed in).

  • independent variable: string

    Whether to use voltage or time as the independent variable. Default is “time”. In some cases, it may be more appropriate to use voltage as the independent variable, and the objective variables will be interpolated to match the voltage data.

  • simulation_kwargs: dict

    Keyword arguments to pass to the simulation (iwp.Simulation). Default is None.

  • objective variables: list of strings

    The variables to fit to. If independent variable is “time”, this defaults to [“Voltage [V]”] and can be a list of any variables except “Time [s]”. If independent variable is “voltage”, this defaults to [“Time [s]”] and cannot be changed.

  • interpolant_atol: float

    Absolute tolerance for the current interpolant. Default is the solver atol if a solver is provided in simulation_kwargs, otherwise 1e-6.

  • interpolant_rtol: float

    Relative tolerance for the current interpolant. Default is the solver rtol if a solver is provided in simulation_kwargs, otherwise 1e-4.

  • interactive_preprocessing: bool

    Whether to use interactive preprocessing to adjust interpolant_atol and interpolant_rtol based on the current data. Default is False.

  • solver_max_save_points: int

    Maximum number of points to save in the solver. Default is 10000.

callbackslist of callable, optional

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

custom_parametersdict, optional

A dictionary of parameters to use within this objective only.

The following custom parameters are available:

  • Initial temperature [K]: Function to calculate the initial temperature. Default is iwp.data_fits.custom_parameters.initial_temperature.

  • Ambient temperature [K]: Function to calculate the ambient temperature. Default is iwp.data_fits.custom_parameters.initial_temperature.

  • Initial concentration in negative electrode [mol.m-3]: Function to calculate the initial concentration in the negative electrode for full cells. Default is iwp.data_fits.custom_parameters.initial_concentration_from_parameter_values(“full”, “negative”).

  • Initial concentration in positive electrode [mol.m-3]: Function to calculate the initial concentration in the positive electrode for full cells. Default is iwp.data_fits.custom_parameters.initial_concentration_from_parameter_values(“full”, “positive”).

  • Initial concentration in {working_electrode} electrode [mol.m-3]: Function to calculate the initial concentration in the working electrode for half cells. Default is iwp.data_fits.custom_parameters.initial_concentration_from_parameter_values(“half”, {working_electrode}).

These custom parameters are functions that take parameter_values and data as arguments and return the calculated value. They can be overridden by providing new functions in the custom_parameters dictionary. See Objective.

Extends: ionworkspipeline.data_fits.objectives.objective.SimulationObjective