The problem
Equivalent-circuit models are cheap but lose accuracy at high C-rates and cannot report internal states such as surface concentration, which matter for fast charging and ageing. Full pseudo-two-dimensional (P2D) models are accurate but too slow for BMS use. Reduced electrochemical models such as the SPM sit between them, and the question of when the added complexity pays off is an active research topic.
Objectives
- Implement the SPM with radial diffusion in each electrode particle and Butler–Volmer kinetics.
- Add an electrolyte extension (SPMe) for better high-rate voltage prediction.
- Parametrise from a published parameter set and verify numerical convergence.
- Compare SPM, SPMe and a second-order ECM on voltage and SOC accuracy across C-rates.
- Assess computational cost and suitability for real-time estimation.
What you need
Tools and toolboxes
- MATLAB — Finite-volume or finite-difference discretisation, ode15s integration, parameter handling and analysis.
- Simulink — Running the reduced model and the ECM side by side on drive-cycle current with fixed-step solvers for real-time comparison.
- Simscape (optional) — A Simscape-language implementation of the model as a custom component; not needed if the model is written in MATLAB.
- Optimization Toolbox — Adjusting a small set of sensitive parameters (for example diffusion coefficients) to measured data with lsqnonlin.
Software
- MATLAB R2023b or later
- Simulink
- Parameter set and test data files
Extra parts and data
- Published electrochemical parameter set for a commercial cell and matching test data — SPM parameters cannot be identified reliably from terminal data alone; a published set gives a starting point and public test data allows validation.
Key concepts
- Single particle model
- Each electrode is represented by one spherical particle in which lithium diffuses radially: ∂c/∂t = (D/r²)·∂/∂r(r²·∂c/∂r). Terminal voltage comes from surface concentrations, open-circuit potentials and reaction overpotentials.
- Butler–Volmer kinetics
- Relates reaction current density to overpotential. In the SPM with symmetric transfer, overpotential η = (2RT/F)·asinh(j / (2·j0)), where j0 depends on surface and electrolyte concentrations.
- SPMe
- An extension that adds electrolyte concentration and potential effects, improving voltage prediction at higher C-rates while staying much cheaper than P2D.
- Numerical convergence
- Results must not change significantly when the number of radial nodes is increased; otherwise discretisation error contaminates the comparison.
Step-by-step guide
- 1
Define the comparison and select data
Choose a cell with a published electrochemical parameter set and public test data covering constant-current discharges at several C-rates and a dynamic profile. Define comparison metrics: voltage RMS error, SOC error relative to a coulomb-counted reference, surface-concentration availability and computation time per simulated hour. Fix which data is used for parameter adjustment and which is held out. Note any parameters the set leaves unspecified.
Checkpoint: A study plan with data splits, metrics and the parameter set's source recorded.
- 2
Derive and discretise the SPM
Write the diffusion equations for each electrode with boundary conditions ∂c/∂r = 0 at the centre and −D·∂c/∂r = j/F at the surface. Discretise radially with a finite-volume scheme (for example 20–30 shells) that conserves lithium. Write a state-derivative function and integrate it with ode15s, which handles the stiffness well. Write the discretised equations in matrix form, which simplifies both the Jacobian supplied to ode15s and the later fixed-step implementation in Simulink.
Checkpoint: Total lithium in both particles is conserved to numerical precision over a full discharge.
- 3
Implement the voltage equation
Compute surface stoichiometry, open-circuit potentials from the parameter set's OCP functions, exchange current densities and overpotentials from Butler–Volmer, and terminal voltage V = U_p − U_n + η_p − η_n − I·R_contact. Implement cut-off conditions with an ode events function. Verify by a 1C discharge against any reference curve supplied with the parameter set. Check the signs of the overpotentials for charge and discharge separately.
Checkpoint: 1C discharge voltage curve matches the reference curve for the parameter set within a small error.
- 4
Check numerical convergence
Repeat a 2C discharge with 10, 20, 40 and 80 radial shells and compare voltage and surface concentration. Choose the smallest number of shells where further refinement changes voltage by less than 1 mV. Also check solver tolerances. Record computation time against shell count. Plot surface concentration as well as voltage, because surface values converge more slowly than terminal voltage and matter for the internal-state study. Repeat the check at the highest C-rate you plan to test.
Checkpoint: A convergence table showing voltage change against shell count and the chosen resolution.
- 5
Add the electrolyte extension
Implement an SPMe: electrolyte concentration across negative electrode, separator and positive electrode using a coarse finite-volume grid, and add electrolyte overpotential and concentration-dependent terms to the voltage. Follow a published SPMe formulation and document every equation and assumption. Verify the electrolyte part on its own first: with a constant current, electrolyte concentration should settle to a steady linear-like profile across each region, with lithium conserved in the electrolyte. Then check that the combined model still conserves lithium overall and converges with grid refinement.
Checkpoint: At low C-rates SPMe and SPM agree closely; at 2C and above SPMe predicts more voltage drop, as expected.
- 6
Adjust parameters and identify the ECM
Using only the adjustment data, refine a small set of sensitive parameters (for example the diffusion coefficients and contact resistance) with lsqnonlin, keeping others at published values. Identify a second-order ECM from pulse data of the same cell with the usual method. Record the number of parameters and the data each model needs. Check that adjusted parameters stay within physically plausible ranges.
Checkpoint: Both models fitted on the same adjustment data, with residuals and parameter counts reported.
- 7
Compare across C-rates
Run SPM, SPMe and ECM on held-out constant-current discharges at C/2, 1C, 2C and 3C (if available) and on the dynamic profile. Compute voltage RMS error, end-of-discharge capacity error and SOC error. Plot voltage curves and errors together for each C-rate. Repeat the comparison at a second temperature if data exists, and report whether the ranking of the three models changes. Explain each model's error pattern physically, for example ECM error growing at the end of high-rate discharges where diffusion limits dominate.
Checkpoint: A table of errors by model and C-rate, with the crossover point where SPMe outperforms the ECM identified.
- 8
Build the real-time comparison
Implement the chosen SPMe and ECM as discrete-time Simulink models with fixed steps (for example 1 s) by converting the discretised ODEs to a discrete form such as backward Euler or a matrix exponential. Run both on a drive-cycle current and compare accuracy with the variable-step reference, and measure execution time per step. Report memory use and states per model as well as time per step.
Checkpoint: Fixed-step versions within a stated error of the reference, with time per step for each model reported.
- 9
Internal-state value study
Show what the electrochemical model adds beyond voltage: plot surface concentration and anode potential during a fast-charge pulse and identify conditions where the anode potential approaches 0 V against Li/Li+ (a lithium plating risk indicator). Discuss how an ECM cannot report this, and how the SPMe could support charging limits. Make clear that this is a model-based indicator, not a measurement, and that it depends on parameter accuracy.
Checkpoint: Plots of surface concentration and anode potential under fast-charge pulses with the risk region marked.
- 10
Sensitivity and identifiability
Compute local sensitivities of voltage to each parameter at several C-rates, and the correlation between parameter sensitivities, to show which parameters can be identified from terminal data. This supports the choice of which parameters to adjust and which to keep from literature. Use normalised sensitivities so parameters with different units can be compared, and repeat the analysis for constant-current and dynamic profiles, because a dynamic profile often makes more parameters identifiable.
Checkpoint: A sensitivity heat map and a list of identifiable and non-identifiable parameters.
- 11
Write up
Document equations, discretisation, convergence, SPMe extension, parameter handling, ECM identification, comparison results, real-time implementation, internal-state study and identifiability. State the limits: isothermal assumption unless a thermal model is added, a single parameter set and simplified electrolyte treatment. Release the code. Include a clear table of when to use each model, covering accuracy, cost and internal-state needs, and release the parameter files and scripts so the comparison can be rerun on another cell.
Checkpoint: A thesis chapter with reproducible comparisons and a clear statement of where the reduced model earns its cost.
Testing & validation
- Lithium conservation to numerical precision.
- Convergence with radial shell count and solver tolerance.
- Agreement with the parameter set's reference discharge.
- Held-out data used for all reported comparisons.
- Fixed-step versions agree with variable-step references.
Expected results
SPM and SPMe implementations with verified convergence, a quantified accuracy comparison against a second-order ECM across C-rates on held-out data, real-time cost measurements and a demonstration of internal-state outputs relevant to fast charging.
Research angle for your PhD
Research questions: at what C-rates and in which conditions does an SPM or SPMe give a meaningful accuracy or insight advantage over a second-order ECM, and what is the cost in computation and parameter identifiability? Baselines: second-order ECM and, where possible, a P2D reference. Metrics: voltage and SOC error by C-rate, computation per step, number of identifiable parameters and the quality of internal-state predictions. A rigorous, reproducible comparison on public data with identifiability analysis, or an estimator that uses the SPMe's internal states for safer fast charging, would be publishable.
Take it further
- Add a lumped thermal model and temperature-dependent parameters.
- Use the SPMe in a Kalman filter for SOC and surface-concentration estimation.
- Add an SEI growth model for ageing.
- Compare with a full P2D implementation for one case.
Viva and review questions
What assumption makes the SPM a single-particle model?
It assumes the current is distributed evenly through each electrode, so one representative particle can stand for all of them. This holds well at low C-rates and less well at high C-rates.
Why did you use a finite-volume discretisation?
It conserves lithium exactly, which avoids drifting SOC, and handles the flux boundary condition at the particle surface naturally.
Why are some parameters not identifiable from terminal voltage?
Several parameters affect voltage in nearly the same way, so their effects are correlated and cannot be separated without other measurements.
What does the SPMe give you that an ECM does not?
Physical internal states such as surface concentration and electrode potentials, which can be used to set charging limits that avoid lithium plating.
Learn it at DIYguru
These DIYguru courses and programmes teach what this project needs.
