pyprobe.analysis.degradation_mode_analysis module#
Module for degradation mode analysis methods.
- class OCP(ocp_function)#
Bases:
_AbstractOCP
A class for single-component electrode open circuit potential data.
- Parameters:
ocp_function (Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]] | PPoly | Expr) – The OCP function for the electrode.
- static from_data(stoichiometry, ocp, interpolation_method='linear')#
Create an OCP object from stoichiometry and OCP data.
Appends to the ocp list for the given electrode. Composite electrodes require multiple calls to this method to provide the OCP data for each component.
- Parameters:
stoichiometry (ndarray[Any, dtype[float64]]) – The stoichiometry data.
ocp (ndarray[Any, dtype[float64]]) – The OCP data.
interpolation_method (Literal['linear', 'cubic', 'Pchip', 'Akima']) – The interpolation method to use. Defaults to “linear”.
- Returns:
The OCP object.
- Return type:
- static from_expression(sympy_expression)#
Create an OCP object from a sympy expression.
- Parameters:
sympy_expression (Expr) – A sympy expression for the OCP.
- Returns:
The OCP object.
- Return type:
- property eval: Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]]#
A callable function for ocp as a function of electrode stoichiometry.
- property grad: Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]]#
The gradient of the OCP function.
- class CompositeOCP(ocp_list, ocp_vector)#
Bases:
_AbstractOCP
A class for composite electrode open circuit potential data.
- Parameters:
ocp_list (List[Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]] | PPoly | Expr]) – A list of OCP functions for the composite electrode.
ocp_vector (ndarray[Any, dtype[float64]]) – The OCP vector for the composite electrode.
- static from_data(stoichiometry_comp1, ocp_comp1, stoichiometry_comp2, ocp_comp2, interpolation_method='linear')#
Create a CompositeOCP object from stoichiometry and OCP data.
- Parameters:
stoichiometry_comp1 (ndarray[Any, dtype[float64]]) – The stoichiometry data for the first component.
ocp_comp1 (ndarray[Any, dtype[float64]]) – The OCP data for the first component.
stoichiometry_comp2 (ndarray[Any, dtype[float64]]) – The stoichiometry data for the second component.
ocp_comp2 (ndarray[Any, dtype[float64]]) – The OCP data for the second component.
interpolation_method (Literal['linear', 'cubic', 'Pchip', 'Akima']) – The interpolation method to use. Defaults to “linear”.
- Return type:
- property eval: Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]]#
A callable function for ocp as a function of electrode stoichiometry.
- property grad: Callable[[ndarray[Any, dtype[float64]]], ndarray[Any, dtype[float64]]]#
The gradient of the OCP function.
- run_ocv_curve_fit(input_data, ocp_pe, ocp_ne, fitting_target='OCV', optimizer='minimize', optimizer_options={'bounds': [(0, 1), (0, 1), (0, 1), (0, 1)], 'x0': array([0.9, 0.1, 0.1, 0.9])})#
Fit half cell open circuit potential curves to full cell OCV data.
- Parameters:
input_data (RawData | Procedure | Experiment | Cycle | Step | Result) – The input data for the analysis.
ocp_pe (OCP | CompositeOCP) – The positive electrode OCP in the form of a OCP or CompositeOCP object.
ocp_ne (OCP | CompositeOCP) – The negative electrode OCP in the form of a OCP or CompositeOCP object.
fitting_target (Literal['OCV', 'dQdV', 'dVdQ']) – The target for the curve fitting. Defaults to “OCV”.
optimizer (Literal['minimize', 'differential_evolution']) – The optimization algorithm to use. Defaults to “minimize”.
optimizer_options (Dict[str, Any]) –
The options for the optimization algorithm. Defaults to {“x0”: np.array([0.9, 0.1, 0.1, 0.9]),
”bounds”: [(0, 1), (0, 1), (0, 1), (0, 1)]}.
Where x0 is the initial guess for the fit and bounds are the limits for the fit. The fitting parameters are ordered [x_pe_lo, x_pe_hi, x_ne_lo, x_ne_hi], where lo and hi indicate the stoichiometry limits at low and high full-cell SOC respectively.
- Returns:
The stoichiometry limits and electrode capacities.
The fitted OCV data.
- Return type:
- quantify_degradation_modes(stoichiometry_limits_list)#
Quantify the change in degradation modes between at least two OCV fits.
- run_batch_dma_parallel(input_data_list, ocp_pe, ocp_ne, fitting_target='OCV', optimizer='minimize', optimizer_options={'bounds': [(0, 1), (0, 1), (0, 1), (0, 1)], 'x0': array([0.9, 0.1, 0.1, 0.9])})#
Fit half cell open circuit potential curves to full cell OCV data.
DMA analysis is run in parallel across all provided input_data.
- Parameters:
input_data_list (List[RawData | Procedure | Experiment | Cycle | Step | Result]) – The list of input data for the analysis.
ocp_pe (OCP | CompositeOCP) – The positive electrode OCP in the form of a OCP or CompositeOCP object.
ocp_ne (OCP | CompositeOCP) – The negative electrode OCP in the form of a OCP or CompositeOCP object.
fitting_target (Literal['OCV', 'dQdV', 'dVdQ']) – The target for the curve fitting. Defaults to “OCV”.
optimizer (Literal['minimize', 'differential_evolution']) – The optimization algorithm to use. Defaults to “minimize”.
optimizer_options (Dict[str, Any]) –
The options for the optimization algorithm. Defaults to {“x0”: np.array([0.9, 0.1, 0.1, 0.9]),
”bounds”: [(0, 1), (0, 1), (0, 1), (0, 1)]}.
Where x0 is the initial guess for the fit and bounds are the limits for the fit. The fitting parameters are ordered [x_pe_lo, x_pe_hi, x_ne_lo, x_ne_hi], where lo and hi indicate the stoichiometry limits at low and high full-cell SOC respectively.
- Returns:
The stoichiometry limits, electrode capacities and degradation modes. - List[Result]: The fitted OCV data for each list item in input_data.
- Return type:
Result
- run_batch_dma_sequential(input_data_list, ocp_pe, ocp_ne, fitting_target='OCV', optimizer=['minimize'], optimizer_options=[{'bounds': [(0, 1), (0, 1), (0, 1), (0, 1)], 'x0': array([0.9, 0.1, 0.1, 0.9])}], link_results=False)#
Fit half cell open circuit potential curves to full cell OCV data.
DMA analysis is run sequentially across all provided input_data.
- Parameters:
input_data_list (List[RawData | Procedure | Experiment | Cycle | Step | Result]) – The list of input data for the analysis.
ocp_pe (OCP | CompositeOCP) – The positive electrode OCP in the form of a OCP or CompositeOCP object.
ocp_ne (OCP | CompositeOCP) – The negative electrode OCP in the form of a OCP or CompositeOCP object.
fitting_target (Literal['OCV', 'dQdV', 'dVdQ']) – The target for the curve fitting. Defaults to “OCV”.
optimizer (List[Literal['minimize', 'differential_evolution']]) –
A list of optimization algorithms to use. The length of the list determines how the optimizers will be applied:
Length = 1, the same optimizer will be used for all provided input
data. - Length = 2, the first optimizer will be used for the first item in the input_data_list and the second optimizer will be used for the remaining items. - Length = n, the ith optimizer will be used for the ith item in the input_data_list. The length of the optimizer list must match the length of the input_data_list.
Defaults to [“minimize”].
optimizer_options (List[Dict[str, Any]]) –
A list of dictionaries containing the options for the optimization algorithm. The length of the list determines how the options will be applied in the same manner as the optimizer argument. Defaults to [{“x0”: np.array([0.9, 0.1, 0.1, 0.9]),
”bounds”: [(0, 1), (0, 1), (0, 1), (0, 1)]}].
link_results (bool) – Whether to link the fitted stoichiometry limits from the previous input data list item to the next input data list item. Defaults to False.
- Returns:
The stoichiometry limits, electrode capacities and degradation modes. - List[Result]: The fitted OCV data for each list item in input_data.
- Return type:
Result
- average_ocvs(input_data, discharge_filter=None, charge_filter=None)#
Average the charge and discharge OCV curves.
- Parameters:
input_data (Procedure | Experiment | Cycle) – The input data for the analysis. Must be a PyProBE object that can be filtered to particular steps i.e. a Cycle object or higher.
discharge_filter (str | None) – The filter to apply to retrieve the discharge data from the input data. If left to default, the first discharge in the input data will be used.
charge_filter (str | None) – The filter to apply to retrieve the charge data from the input data. If left to default, the first charge in the input data will be used.
- Returns:
A Result object containing the averaged OCV curve.
- Return type: