Resistance objective

Objective for fitting an explicit resistance model to a set of data.

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

Objective for fitting the resistance.

Parameters

data_inputpd.DataFrame

The data to use for the fit, see Objective. Should have columns “SOC” and “Resistance [Ohm]”, plus any additional columns required by the resistance model.

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).

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. See Objective.

Extends: ionworkspipeline.data_fits.objectives.objective.Objective

The resistance objective requires the user to provide a model that calculates the resistance. The following pre-built models are available:

class ionworkspipeline.objectives.HalfCellResistanceModel(electrode)

Resistance model for a half-cell, which sums the charge transfer resistance for that electrode, the electrolyte ohmic resistance, and a contact resistance.

Parameters

electrodestr

The electrode to calculate the resistance for. Must be “negative” or “positive”.

Extends: ionworkspipeline.data_fits.objectives.resistance.SumResistanceModel

class ionworkspipeline.objectives.FullCellResistanceModel

Resistance model for a full cell, which sums the charge transfer resistance for each electrode, the electrolyte ohmic resistance, and a contact resistance.

Extends: ionworkspipeline.data_fits.objectives.resistance.SumResistanceModel

Alternatively, the user can create their own resistance model from components:

class ionworkspipeline.objectives.ContactResistanceModel

Resistance model for the contact resistance. The resistance is given by th “Contact resistance [Ohm]” parameter.

Extends: ionworkspipeline.data_fits.objectives.resistance.ResistanceModel

build(parameter_values, data)

Build the model (define the resistance attribute) using the given parameter values and data.

Parameters

parameter_valuesdict

The parameter values to use for the model.

datadict

The data to use for the fit. May be specific to the resistance model.

class ionworkspipeline.objectives.ChargeTransferResistanceModel(electrode)

Resistance model for the charge transfer resistance. The resistance is given by the equation

\[R_{ct} = \frac{RT}{F j_0 S}\]

where \(R_{tot}\) is the total resistance, \(R_{ct}\) is the charge transfer resistance, \(R\) is the gas constant, \(T\) is the temperature, \(F\) is Faraday’s constant, \(j_0\) is the exchange current density, and \(S\) is the surface area per unit volume, calculated as

\[S = 3 \frac{V_{elec} \varepsilon_s}{R_p}\]

where \(V_{elec}\) is the electrode volume, \(\varepsilon_s\) is the active material volume fraction, and \(R_p\) is the particle radius.

Parameters

electrodestr

The electrode to calculate the charge transfer resistance for. Must be “negative” or “positive”.

Extends: ionworkspipeline.data_fits.objectives.resistance.ResistanceModel

build(parameter_values, data)

Build the model (define the resistance attribute) using the given parameter values and data.

Parameters

parameter_valuesdict

The parameter values to use for the model.

datadict

The data to use for the fit. May be specific to the resistance model.

class ionworkspipeline.objectives.ElectrolyteOhmicResistanceModel(working_electrode='both')

Resistance model for the electrolyte ohmic resistance, from the SPMe. For a full cell, the resistance is given by the equation

\[R_{ohm} = \frac{L_n}{3 \kappa_{e,n}} + \frac{L_s}{\kappa_{e,s}} + \frac{L_p}{3 \kappa_{e,p}}\]

where \(L_n\), \(L_s\), and \(L_p\) are the thicknesses of the negative electrode, separator, and positive electrode, respectively, \(\kappa_{e,n}\), \(\kappa_{e,s}\), and \(\kappa_{e,p}\) are the electrolyte conductivities in the negative electrode, separator, and positive electrode, respectively, calculated using the Bruggeman relation

\[\kappa_{e} = \kappa_{e,0} \varepsilon^{b}\]

where \(\kappa_{e,0}\) is the electrolyte conductivity, \(\varepsilon\) is the porosity, and \(b\) is the Bruggeman coefficient for each domain

For a half-cell, we only consider the electrolyte ohmic resistance in the relevant electrode and separator.

Parameters

working_electrodestr

The electrode to calculate the electrolyte ohmic resistance for. Must be “negative”, “positive”, or “both”.

Extends: ionworkspipeline.data_fits.objectives.resistance.ResistanceModel

build(parameter_values, data)

Build the model (define the resistance attribute) using the given parameter values and data.

Parameters

parameter_valuesdict

The parameter values to use for the model.

datadict

The data to use for the fit. May be specific to the resistance model.

These components can be summed together to create a complete resistance model:

class ionworkspipeline.objectives.SumResistanceModel(*models)

Resistance model that sums the resistance of multiple sub-models.

Parameters

modelslist

The sub-models to sum the resistance of.

Extends: ionworkspipeline.data_fits.objectives.resistance.ResistanceModel

build(parameter_values, data)

Build the model (define the resistance attribute) using the given parameter values and data.

Parameters

parameter_valuesdict

The parameter values to use for the model.

datadict

The data to use for the fit. May be specific to the resistance model.

To create a new component, subclass the base resistance model:

class ionworkspipeline.objectives.ResistanceModel

Base class for resistance models, which are used by the Resistance objective to fit the relevant parameters.

This model implements the solve method, which returns the resistance evaluated at the given inputs. The build method must be implemented by the derived class.

build(parameter_values, data)

Build the model (define the resistance attribute) using the given parameter values and data.

Parameters

parameter_valuesdict

The parameter values to use for the model.

datadict

The data to use for the fit. May be specific to the resistance model.

solve(inputs)

Evaluate the total resistance at the given inputs.

Parameters

inputsdict

The inputs to evaluate the resistance at.

Returns

numpy.ndarray

The resistance evaluated at the given inputs.

solve_full(inputs)

Evaluate the resistance at the given inputs, returning the resistance of each sub-model.

Parameters

inputsdict

The inputs to evaluate the resistance at.

Returns

dict

The resistance evaluated at the given inputs for each sub-model.