Cycle ageing objective¶
Objectives for fitting the data generated by a cycle ageing experiment.
- class ionworkspipeline.objectives.CycleAgeing(data_input, options=None, callbacks=None, custom_parameters=None, constraints=None, penalties=None, parameters=None)¶
Objective for fitting summary variables to cycling 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.
- model: :class:
pybamm.BaseModel The model to fit. No default is provided, but this option is required (a model must be passed in).
- model: :class:
- experiment:
pybamm.Experiment The experiment to use for the simulation. No default is provided, but this option is required (an experiment must be passed in).
- experiment:
- objective variables: list of strings
The variables to fit. No default is provided, but this option is required (a list of variables must be passed in). The variables must be a subset of the keys in the data.
- metrics: dict of str to BaseMetric
A dictionary mapping variable names to metric objects that extract values from the simulation solution. Each metric should be created with
.by_cycle()to evaluate across cycles. The cycles will be set automatically from the data. Default metrics are provided for “LLI [%]”, “LAM_ne [%]”, and “LAM_pe [%]”.
- simulation_kwargs: dict
Keyword arguments to pass to the simulation (
iwp.Simulation). Default is None.
- callbackslist of callable, optional
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.fitting_objective.SimulationObjective- 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 CycleAgeing objective.
- default_validation_plot_types: list[str] | None = ['model data', 'error']¶
Default list of validation plot type names for this objective.
Subclasses that support validation should override. Return
Noneto use the pipeline fallback (e.g.["model data", "error"]); return[]for no plots.
- prepare_validation_results(results: dict, summary_stats: list) tuple[list[dict[str, float]], dict[str, float]]¶
Prepare validation results for CycleAgeing objective.
Parameters¶
- resultsdict
The raw results from running the objective (keys = variable names, values = arrays per cycle).
- summary_statslist
List of summary statistic cost functions to compute.
Returns¶
- tuple[list[dict[str, float]], dict[str, float]]
A tuple of (computed_statistics, validation_result) where computed_statistics is a list of dictionaries with computed metric names and values, and validation_result is a dictionary of validation data (Cycle number and per-variable model/data).