pybop.models.lithium_ion#
Submodules#
Classes#
Overwrites and extends BaseModel class for electrochemical PyBaMM models. |
|
Wraps the Single Particle Model (SPM) for simulating lithium-ion batteries, as implemented in PyBaMM. |
|
Represents the Single Particle Model with Electrolyte (SPMe) for lithium-ion batteries. |
Package Contents#
- class pybop.models.lithium_ion.EChemBaseModel[source]#
Bases:
pybop.models.base_model.BaseModelOverwrites and extends BaseModel class for electrochemical PyBaMM models.
- _check_params(inputs=None, parameter_set=None, allow_infeasible_solutions=True)[source]#
Check compatibility of the model parameters.
- Parameters:
inputs (dict) – The input parameters for the simulation.
allow_infeasible_solutions (bool, optional) – If True, infeasible parameter values will be allowed in the optimisation (default: True).
- Returns:
A boolean which signifies whether the parameters are compatible.
- Return type:
bool
- approximate_capacity(x)[source]#
Calculate and update an estimate for the nominal cell capacity based on the theoretical energy density and an average voltage.
The nominal capacity is computed by dividing the theoretical energy (in watt-hours) by the average open circuit potential (voltage) of the cell.
- Parameters:
x (array-like) – An array of values representing the model inputs.
- Returns:
The nominal cell capacity is updated directly in the model’s parameter set.
- Return type:
None
- cell_mass(parameter_set=None)[source]#
Calculate the total cell mass in kilograms.
This method uses the provided parameter set to calculate the mass of different components of the cell, such as electrodes, separator, and current collectors, based on their densities, porosities, and thicknesses. It then calculates the total mass by summing the mass of each component.
- Parameters:
parameter_set (dict, optional) – A dictionary containing the parameter values necessary for the mass calculations.
- Returns:
The total mass of the cell in kilograms.
- Return type:
float
- cell_volume(parameter_set=None)[source]#
Calculate the total cell volume in m3.
This method uses the provided parameter set to calculate the total thickness of the cell including electrodes, separator, and current collectors. It then calculates the volume by multiplying by the cross-sectional area.
- Parameters:
parameter_set (dict, optional) – A dictionary containing the parameter values necessary for the volume calculation.
- Returns:
The total volume of the cell in m3.
- Return type:
float
- class pybop.models.lithium_ion.SPM(name='Single Particle Model', parameter_set=None, geometry=None, submesh_types=None, var_pts=None, spatial_methods=None, solver=None, options=None)[source]#
Bases:
pybop.models.lithium_ion.echem_base.EChemBaseModelWraps the Single Particle Model (SPM) for simulating lithium-ion batteries, as implemented in PyBaMM.
The SPM is a simplified physics-based model that represents a lithium-ion cell using a single spherical particle to simulate the behavior of the negative and positive electrodes.
- Parameters:
name (str, optional) – The name for the model instance, defaulting to “Single Particle Model”.
parameter_set (pybamm.ParameterValues or dict, optional) – The parameters for the model. If None, default parameters provided by PyBaMM are used.
geometry (dict, optional) – The geometry definitions for the model. If None, default geometry from PyBaMM is used.
submesh_types (dict, optional) – The types of submeshes to use. If None, default submesh types from PyBaMM are used.
var_pts (dict, optional) – The discretization points for each variable in the model. If None, default points from PyBaMM are used.
spatial_methods (dict, optional) – The spatial methods used for discretization. If None, default spatial methods from PyBaMM are used.
solver (pybamm.Solver, optional) – The solver to use for simulating the model. If None, the default solver from PyBaMM is used.
options (dict, optional) – A dictionary of options to customize the behavior of the PyBaMM model.
- class pybop.models.lithium_ion.SPMe(name='Single Particle Model with Electrolyte', parameter_set=None, geometry=None, submesh_types=None, var_pts=None, spatial_methods=None, solver=None, options=None)[source]#
Bases:
pybop.models.lithium_ion.echem_base.EChemBaseModelRepresents the Single Particle Model with Electrolyte (SPMe) for lithium-ion batteries.
The SPMe extends the basic Single Particle Model (SPM) by incorporating electrolyte dynamics, making it suitable for simulations where electrolyte effects are non-negligible. This class provides a framework to define the model parameters, geometry, mesh types, discretization points, spatial methods, and numerical solvers for simulation within the PyBaMM ecosystem.
- Parameters:
name (str, optional) – A name for the model instance, defaults to “Single Particle Model with Electrolyte”.
parameter_set (pybamm.ParameterValues or dict, optional) – A dictionary or a ParameterValues object containing the parameters for the model. If None, the default PyBaMM parameters for SPMe are used.
geometry (dict, optional) – A dictionary defining the model’s geometry. If None, the default PyBaMM geometry for SPMe is used.
submesh_types (dict, optional) – A dictionary defining the types of submeshes to use. If None, the default PyBaMM submesh types for SPMe are used.
var_pts (dict, optional) – A dictionary specifying the number of points for each variable for discretization. If None, the default PyBaMM variable points for SPMe are used.
spatial_methods (dict, optional) – A dictionary specifying the spatial methods for discretization. If None, the default PyBaMM spatial methods for SPMe are used.
solver (pybamm.Solver, optional) – The solver to use for simulating the model. If None, the default PyBaMM solver for SPMe is used.
options (dict, optional) – A dictionary of options to customize the behavior of the PyBaMM model.