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.15/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...
10:55:18 - INFO - LOGGING (log: True)
10:55:18 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
10:55:18 - INFO - GRAPH (nodes: 4, edges: 6, alg. depth: 2, loop depth: 0, runtime: 0.045ms)
10:55:18 - INFO - STARTING -> TRANSIENT (Duration: 3600.00s)
10:55:40 - INFO - --------------------   1% | 22.2s<22:17 | 0.19 it/s
10:55:45 - INFO - --------------------   2% | 27.1s<17:18 | 0.20 it/s
10:55:53 - INFO - --------------------   3% | 35.1s<15:31 | 0.17 it/s
10:55:57 - INFO - --------------------   4% | 39.2s<08:47 | 0.19 it/s
10:56:04 - INFO - #-------------------   6% | 46.2s<06:58 | 0.18 it/s
10:56:10 - INFO - ##------------------  10% | 52.2s<04:34 | 0.18 it/s
10:56:18 - INFO - ###-----------------  16% | 59.5s<02:54 | 0.16 it/s
10:56:26 - INFO - #####---------------  28% | 01:08<01:34 | 0.15 it/s
10:56:35 - INFO - ########------------  44% | 01:16<52.0s | 0.14 it/s
10:56:38 - INFO - #############-------  67% | 01:19<9.2s | 0.21 it/s
10:56:38 - INFO - #################### 100% | 01:19<--:-- | 1.6 it/s
10:56:38 - INFO - FINISHED -> TRANSIENT (total steps: 14, successful: 14, runtime: 79552.12 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...
10:56:39 - INFO - LOGGING (log: True)
10:56:39 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
10:56:39 - INFO - GRAPH (nodes: 4, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.046ms)
10:56:39 - INFO - STARTING -> TRANSIENT (Duration: 1800.00s)
10:56:47 - INFO - --------------------   1% | 7.2s<08:29 | 0.35 it/s
10:56:52 - INFO - --------------------   2% | 13.2s<08:47 | 0.29 it/s
10:56:56 - INFO - --------------------   3% | 16.6s<06:02 | 0.29 it/s
10:57:00 - INFO - #-------------------   5% | 20.8s<04:27 | 0.28 it/s
10:57:05 - INFO - #-------------------   9% | 25.7s<03:16 | 0.25 it/s
10:57:07 - INFO - ##------------------  14% | 27.8s<01:18 | 0.32 it/s
10:57:08 - INFO - ####----------------  24% | 28.4s<12.7s | 0.74 it/s
10:57:08 - INFO - #########-----------  45% | 28.6s<1.8s | 1.8 it/s
10:57:11 - INFO - ###############-----  79% | 32.1s<0.8s | 1.3 it/s
10:57:15 - INFO - #################### 100% | 36.0s<--:-- | 1.0 it/s
10:57:15 - INFO - FINISHED -> TRANSIENT (total steps: 11, successful: 11, runtime: 36019.25 ms)
10:57:17 - INFO - LOGGING (log: True)
10:57:17 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
10:57:17 - INFO - GRAPH (nodes: 4, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.045ms)
10:57:17 - INFO - STARTING -> TRANSIENT (Duration: 1800.00s)
10:57:25 - INFO - --------------------   1% | 8.4s<13:32 | 0.23 it/s
10:57:28 - INFO - --------------------   2% | 11.0s<03:14 | 0.58 it/s
10:57:29 - INFO - --------------------   4% | 12.2s<02:12 | 0.67 it/s
10:57:30 - INFO - #-------------------   6% | 13.4s<01:31 | 0.72 it/s
10:57:32 - INFO - #-------------------   9% | 15.7s<01:22 | 0.63 it/s
10:57:36 - INFO - ####----------------  20% | 19.5s<20.3s | 1.0 it/s
10:57:41 - INFO - ######--------------  32% | 24.7s<19.6s | 0.77 it/s
10:57:42 - INFO - ###########---------  56% | 25.8s<4.8s | 0.81 it/s
10:57:45 - INFO - #################---  88% | 28.9s<1.3s | 0.67 it/s
10:57:49 - INFO - #################### 100% | 32.9s<--:-- | 0.54 it/s
10:57:49 - INFO - FINISHED -> TRANSIENT (total steps: 13, successful: 13, runtime: 32889.17 ms)
10:57:50 - INFO - LOGGING (log: True)
10:57:50 - INFO - BLOCKS (total: 4, dynamic: 1, static: 3, eventful: 0)
10:57:50 - INFO - GRAPH (nodes: 4, edges: 5, alg. depth: 2, loop depth: 0, runtime: 0.043ms)
10:57:50 - INFO - STARTING -> TRANSIENT (Duration: 1800.00s)
10:58:10 - INFO - --------------------   1% | 19.7s<14:04 | 0.42 it/s
10:58:12 - INFO - --------------------   2% | 21.3s<08:19 | 0.48 it/s
10:58:13 - INFO - --------------------   3% | 23.0s<01:08 | 1.6 it/s
10:58:15 - INFO - ###-----------------  17% | 24.2s<7.3s | 4.5 it/s
10:58:15 - INFO - ####----------------  24% | 24.3s<2.7s | 6.0 it/s
10:58:15 - INFO - ############--------  61% | 24.6s<0.4s | 7.3 it/s
10:58:15 - INFO - ##################--  90% | 24.7s<0.1s | 7.2 it/s
10:58:15 - INFO - STOP (StopSimulation: 'undervoltage: V=1.8736 V <= 2.5 V')
10:58:15 - INFO - INTERRUPTED -> TRANSIENT (total steps: 20, successful: 17, runtime: 24963.44 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.