4S2P Thevenin Battery Pack Simulation with Thermal Model v01

Version 1.0.0 (97.9 KB) by Sanskruti
Simulates a 4S2P Li-ion pack using Thevenin (R0+R1||C1) ECM, Coulomb SOC, thermal model; outputs pack voltage, SOC, RC voltage, temp - demo!
7 Downloads
Updated 10 Nov 2025

View License

This MATLAB script models a 4S2P lithium-ion pack using a single-cell Thevenin equivalent (R0 + R1‖C1) for electrical dynamics, Coulomb-counting for SOC, and a lumped one-node thermal model for temperature rise. The code splits pack current across parallel strings to compute per-cell current, updates the RC branch voltage and terminal voltage each time step, integrates SOC from current, and computes heat generation as with simple convective cooling. The simulation produces time plots of pack current, pack voltage, cell SOC, RC voltage, and cell temperature so you can observe transient voltage sag, SOC evolution, and thermal effects under different current pulses. Parameters (cell capacity, R0, R1, C1, thermal mass, convection coefficient, and OCV-SOC table) are defined at the top for easy tuning or replacement with measured data. Suggested uses: study current-pulse effects, test balancing/imbalance scenarios (by adding cell variability), validate SOC estimator algorithms (EKF/UKF), and investigate thermal limits. The script and outputs are ready to paste into your report (include parameter table, governing equations, assumptions, and interpretation of the plotted results).

Cite As

Sanskruti (2025). 4S2P Thevenin Battery Pack Simulation with Thermal Model v01 (https://uk.mathworks.com/matlabcentral/fileexchange/182556-4s2p-thevenin-battery-pack-simulation-with-thermal-model-v01), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025b
Compatible with R2025b
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0