Custom Parameters

ionworkspipeline.data_fits.custom_parameters.initial_concentration_from_voltage(cell_format, electrode, source='data')

Returns a partial function that calculates the initial concentration for a specific cell format and electrode.

Parameters

cell_formatstr

The cell format, either “full” or “half”.

electrodestr

The electrode, either “negative” or “positive”.

sourcestr

The source of the initial voltage, either “data” or “parameter”. Default is “data”.

Returns

functools.partial

A partial function that takes parameter_values and data as arguments.

ionworkspipeline.data_fits.custom_parameters.initial_concentration_from_parameter_values(cell_format, electrode)

Returns a partial function that calculates the initial concentration for a specific cell format and electrode.

Parameters

cell_formatstr

The cell format, either “full” or “half”.

ionworkspipeline.data_fits.custom_parameters.temperature_interpolant(parameter_values, data)

Creates an interpolant function for temperature based on the provided data.

This function takes the temperature data from the input and creates a PyBaMM Interpolant object that can be used to calculate the ambient temperature at any given time during the simulation.

Parameters

parameter_valuesdict

A dictionary of parameter values for the model.

datapandas.DataFrame

The input data containing temperature measurements.

Returns

callable

A function that takes y, z, and t as arguments and returns the interpolated temperature at time t. The y and z arguments are not used but are included for compatibility with PyBaMM’s expected function signature.

Notes

  • The function assumes that the temperature data is provided in Celsius and converts it to Kelvin.

  • The returned function uses PyBaMM’s Interpolant class to perform the interpolation.

ionworkspipeline.data_fits.custom_parameters.initial_temperature(parameter_values, data)

Returns the initial temperature for the simulation.

This function attempts to retrieve the initial temperature from the provided data. If the temperature data is not found in the input, it uses the initial temperature parameter from the parameter values.

Parameters

parameter_valuesdict

A dictionary of parameter values for the model.

datapandas.DataFrame

The input data containing temperature measurements.

Returns

float

The initial temperature for the simulation.