Skip to main content
PyBaMM provides several physics-based lithium-ion battery models that span a wide range of fidelity and computational cost. All models are accessible from the pybamm.lithium_ion namespace.

Model comparison

SPM

Fastest. Ignores electrolyte dynamics. Best for rapid parameter sweeps and reduced-order studies.

SPMe

Adds electrolyte concentration and potential corrections to the SPM. Good balance for most simulations.

DFN

Full porous-electrode model. Highest fidelity for single-cell physics-based simulation.

MPM

Extends the SPM with a particle-size distribution. Captures heterogeneous utilisation effects.

MSMR

Multi-Site Multi-Reaction model. Uses thermodynamic site-occupancy formulations for OCP and kinetics.

Newman-Tobias

DFN-class model with uniform electrolyte concentration. Useful as a pedagogical reference.
ModelElectrolyte dynamicsParticle distributionRelative cost
SPMNoNoLow
SPMeYes (composite)NoMedium
DFNYes (full)NoHigh
MPMNoYesMedium
MSMRYes (full)NoHigh
Newman-TobiasNo (uniform)NoMedium
Yang2017Yes (full)NoHigh

Models

Single Particle Model

The SPM reduces each electrode to a single representative spherical particle. Electrolyte concentration gradients are neglected, and the overpotential is determined from the leading-order electrolyte conductivity. This is the fastest lithium-ion model in PyBaMM.When to use: Rapid parameter studies, state estimation, control design, or situations where electrolyte dynamics are unimportant (low C-rates).Reference: Marquis, S. G., et al. (2019). An asymptotic derivation of a single particle model with electrolyte. Journal of The Electrochemical Society.
import pybamm

model = pybamm.lithium_ion.SPM()
print(model.name)  # 'Single Particle Model'

# Solve with default parameters
param = model.default_parameter_values
sim = pybamm.Simulation(model, parameter_values=param)
sim.solve([0, 3600])
sim.plot()

Key model options

All lithium-ion models accept an options dictionary at instantiation. Options not provided take their default values.
Control how temperature is modelled.
OptionValuesDefault
"thermal""isothermal", "lumped", "x-lumped", "x-full""isothermal"
"cell geometry""arbitrary", "pouch", "cylindrical""arbitrary"
model = pybamm.lithium_ion.DFN(options={"thermal": "lumped"})
Control the intra-particle concentration profile.
OptionValuesDefault
"particle""Fickian diffusion", "uniform profile", "quadratic profile", "quartic profile", "MSMR""Fickian diffusion"
A 2-tuple selects different models for negative and positive electrodes:
model = pybamm.lithium_ion.DFN(
    options={"particle": ("Fickian diffusion", "uniform profile")}
)
Model SEI layer formation and its effect on capacity fade.
OptionValuesDefault
"SEI""none", "constant", "reaction limited", "solvent-diffusion limited", "electron-migration limited", "interstitial-diffusion limited", "ec reaction limited", "VonKolzenberg2020", "tunnelling limited""none"
"SEI film resistance""none", "distributed", "average""none" (if SEI is none)
"SEI porosity change""false", "true""false"
model = pybamm.lithium_ion.DFN(
    options={
        "SEI": "ec reaction limited",
        "SEI film resistance": "distributed",
        "SEI porosity change": "true",
    }
)
Model metallic lithium deposition on the negative electrode.
OptionValuesDefault
"lithium plating""none", "reversible", "partially reversible", "irreversible""none"
"lithium plating porosity change""false", "true""false"
model = pybamm.lithium_ion.DFN(
    options={
        "lithium plating": "irreversible",
        "lithium plating porosity change": "true",
    }
)
Capture electrode active material degradation.
OptionValuesDefault
"loss of active material""none", "stress-driven", "asymmetric stress-driven", "reaction-driven", "current-driven", "stress and reaction-driven""none"
"particle mechanics""none", "swelling only", "swelling and cracking""none"
model = pybamm.lithium_ion.DFN(
    options={
        "loss of active material": "stress-driven",
        "particle mechanics": "swelling and cracking",
    }
)
Select the kinetic expression at the electrode-electrolyte interface.
OptionValuesDefault
"intercalation kinetics""symmetric Butler-Volmer", "asymmetric Butler-Volmer", "linear", "Marcus", "Marcus-Hush-Chidsey", "MSMR""symmetric Butler-Volmer"
model = pybamm.lithium_ion.DFN(
    options={"intercalation kinetics": "Marcus-Hush-Chidsey"}
)

Example with custom options

import pybamm

# DFN with lumped thermal model, ec reaction limited SEI, and irreversible plating
model = pybamm.lithium_ion.DFN(
    options={
        "thermal": "lumped",
        "SEI": "ec reaction limited",
        "SEI film resistance": "distributed",
        "SEI porosity change": "true",
        "lithium plating": "irreversible",
        "lithium plating porosity change": "true",
    }
)

param = pybamm.ParameterValues("Chen2020")
sim = pybamm.Simulation(model, parameter_values=param)
sim.solve([0, 3600])
sim.plot()
Call pybamm.print_citations() after running a simulation to see the full list of references for the models and parameters used.

Build docs developers (and LLMs) love