This example requires external dependencies and cannot be run in the browser.

Constant-Current Discharge with the SPMe

Constant-current (CC) discharge simulation using CellElectrothermal, which wraps PyBaMM's SPMe with a lumped thermal sub-model. PathSim integrates the coupled ODE system.

Model

The SPMe extends the Single Particle Model (SPM) with electrolyte concentration dynamics, significantly improving accuracy at moderate-to-high C-rates. Solid-phase diffusion in each electrode follows:

MATHDISPLAY0ENDMATH

The terminal voltage is determined by open-circuit potentials and Butler–Volmer overpotentials. Cell temperature is tracked via PyBaMM's lumped thermal sub-model:

MATHDISPLAY1ENDMATH

Brosa Planella et al., arXiv:2203.16091 (2022).

Python
Loading...
/opt/hostedtoolcache/Python/3.11.18/x64/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

Single 1 C Discharge

Chen2020 is a 21700-format NMC/graphite cell with 5 Ah nominal capacity, so 1 C = 5 A. ESDIRK43 is used because the discretised SPMe ODE is stiff.

Python
Loading...
13:58:47 - INFO - LOGGING (log: True)
13:58:47 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
13:58:47 - INFO - GRAPH (nodes: 4, edges: 6, alg. depth: 2, loop depth: 0, runtime: 0.067ms)
13:58:47 - INFO - STARTING -> TRANSIENT (Duration: 3600.00s)
13:58:47 - INFO - --------------------   1% | 0.3s<17.1s | 15.8 it/s
13:58:48 - INFO - #####---------------  28% | 0.7s<0.7s | 17.4 it/s
13:58:48 - INFO - ########------------  44% | 0.7s<0.4s | 17.2 it/s
13:58:48 - INFO - #############-------  67% | 0.8s<0.1s | 17.1 it/s
13:58:48 - INFO - #################### 100% | 0.8s<--:-- | 16.4 it/s
13:58:48 - INFO - FINISHED -> TRANSIENT (total steps: 14, successful: 14, runtime: 846.46 ms)
Python
Loading...
Output

C-Rate Sweep

Higher C-rates cause larger concentration gradients and overpotentials, leading to steeper voltage drop-off and more pronounced temperature rise.

Python
Loading...
13:58:49 - INFO - LOGGING (log: True)
13:58:49 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
13:58:49 - INFO - GRAPH (nodes: 4, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.058ms)
13:58:49 - INFO - STARTING -> TRANSIENT (Duration: 1800.00s)
13:58:49 - INFO - --------------------   1% | 0.1s<11.3s | 15.4 it/s
13:58:49 - INFO - ####----------------  24% | 0.5s<0.8s | 17.0 it/s
13:58:49 - INFO - #########-----------  45% | 0.6s<0.4s | 15.7 it/s
13:58:49 - INFO - ###############-----  79% | 0.6s<0.1s | 15.9 it/s
13:58:49 - INFO - #################### 100% | 0.7s<--:-- | 16.1 it/s
13:58:49 - INFO - FINISHED -> TRANSIENT (total steps: 11, successful: 11, runtime: 685.93 ms)
13:58:50 - INFO - LOGGING (log: True)
13:58:50 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
13:58:50 - INFO - GRAPH (nodes: 4, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.058ms)
13:58:50 - INFO - STARTING -> TRANSIENT (Duration: 1800.00s)
13:58:50 - INFO - --------------------   1% | 0.1s<12.0s | 15.4 it/s
13:58:50 - INFO - ####----------------  20% | 0.5s<1.2s | 16.9 it/s
13:58:50 - INFO - ###########---------  56% | 0.7s<0.2s | 16.9 it/s
13:58:51 - INFO - #################---  88% | 0.7s<0.0s | 16.8 it/s
13:58:51 - INFO - #################### 100% | 0.8s<--:-- | 17.1 it/s
13:58:51 - INFO - FINISHED -> TRANSIENT (total steps: 13, successful: 13, runtime: 783.99 ms)
13:58:51 - INFO - LOGGING (log: True)
13:58:51 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
13:58:51 - INFO - GRAPH (nodes: 4, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.072ms)
13:58:51 - INFO - STARTING -> TRANSIENT (Duration: 1800.00s)
13:58:51 - INFO - --------------------   1% | 0.4s<19.0s | 16.1 it/s
13:58:52 - INFO - ####----------------  24% | 1.3s<1.7s | 11.5 it/s
13:58:52 - INFO - ############--------  61% | 1.5s<0.3s | 11.0 it/s
13:58:53 - INFO - ##################--  90% | 1.6s<0.1s | 10.8 it/s
13:58:53 - INFO - STOP (StopSimulation: 'undervoltage: V=1.8737 V <= 2.5 V')
13:58:53 - INFO - INTERRUPTED -> TRANSIENT (total steps: 20, successful: 17, runtime: 1641.49 ms)
Python
Loading...
Output

Summary

  • CellElectrothermal wraps the PyBaMM SPMe + lumped thermal ODE and integrates it as a standard DynamicalSystem in PathSim.
  • Higher C-rates produce steeper V–SOC curves and greater temperature rise.
  • For an external thermal model (e.g. a custom cooling loop), see notebook 02.