Skip to main content
emobility.academy
M.TechBattery modellingAdvanced About 8 weeksMATLAB & Simulink

Module and Pack Modelling with Simscape Battery: Cell Variation and Thermal Effects

Build module and pack models of an example EV battery with Simscape Battery's pack-building objects, add cell-to-cell variation in capacity, resistance and temperature, and study how variation and thermal coupling affect pack voltage, usable capacity and hottest-cell temperature on a drive cycle.

Tools: Simscape Battery · Simscape Electrical

Module and Pack Modelling with Simscape Battery: Cell Variation and Thermal Effects: Students assembling a lithium-ion battery pack in a DIYguru workshop
Representative photo from DIYguru's EV lab, not of this specific project.

The problem

Pack designers need to know how cell spread and uneven cooling affect usable capacity, current sharing between parallel cells and hot spots. Detailed models with every cell are slow, while lumped models hide these effects. Simscape Battery offers a structured way to build packs at chosen levels of detail, which makes the trade-off between fidelity and simulation speed explicit.

Objectives

  • Define a cell, parallel assembly, module and pack with Simscape Battery objects and generate library blocks.
  • Parametrise cells from a published datasheet or identified ECM data.
  • Add cell-to-cell variation and a thermal network with coolant boundary conditions.
  • Compare lumped and detailed model resolutions on accuracy and speed.
  • Quantify the effect of variation and cooling on usable capacity and hottest-cell temperature.

What you need

Tools and toolboxes

  • Simscape Battery — batteryCell, batteryParallelAssembly, batteryModule, batteryModuleAssembly and batteryPack objects, buildBattery to generate blocks, and the Battery Builder app.
  • Simscape Electrical — Current sources, sensors and the electrical load interface.
  • Simscape — Thermal domain elements (thermal mass, conductive and convective heat transfer, temperature sources) and solver configuration.
  • Simulink — Drive-cycle current input, logging and scripted runs.

Software

  • MATLAB R2023b or later (Simscape Battery is available from R2022b)
  • Simulink and Simscape products
  • Pack current profile from a vehicle model

Extra parts and data

  • Published cell datasheet or test data — Cell OCV, resistance, capacity and thermal properties are needed to parametrise the model.

Key concepts

Model resolution
Simscape Battery lets a parallel assembly or module be modelled lumped (one equivalent cell) or detailed (every cell). Detailed models show spread but are slower.
Cell-to-cell variation
Random spread in capacity, resistance and initial SOC. In parallel cells it causes unequal current sharing; in series it limits usable capacity to the weakest cell.
Thermal coupling
Heat moves between adjacent cells and to the coolant or cold plate. Cells far from cooling run hotter, which changes resistance and ageing.
Usable pack capacity
Charge delivered before any cell reaches its minimum voltage, which can be less than the nominal pack capacity.

Step-by-step guide

  1. 1

    Define the example pack

    Choose an example pack: cylindrical 21700 cells, 4P assemblies, 12 assemblies in series per module, 8 modules in series (96S4P), with cooling from a cold plate under the modules. Define the study questions: usable capacity loss from cell spread, maximum current imbalance in a parallel assembly, and hottest-cell temperature on a repeated WLTP-derived current with a stated coolant temperature. Record the cell datasheet values used.

    Checkpoint: A pack definition and study plan with example values labelled.

  2. 2

    Create the cell object

    Create a batteryCell object with a cylindrical geometry and a cell model block from Simscape Battery (the Battery Equivalent Circuit block), and parametrise it from your datasheet or ECM tables: OCV–SOC, R0 and RC parameters, capacity, thermal mass and heat capacity. Run a single cell test with a 1C discharge and a pulse in a small model. Save the cell object to a MAT file so every later build uses the same definition.

    Checkpoint: The single cell delivers its rated capacity at 1C and shows the expected voltage step in a pulse test.

  3. 3

    Build assemblies, modules and pack

    Create a batteryParallelAssembly of 4 cells, a batteryModule of 12 assemblies and a batteryPack of modules, choosing ModelResolution as Lumped for a first version. Use buildBattery to generate a library and add the pack block to a model with a Controlled Current Source and voltage sensor. Visualise the layout with the batteryChart function. Keep the build script under version control so pack variants can be regenerated quickly and exactly.

    Checkpoint: The generated pack block runs a constant-current discharge with pack voltage equal to 96 times the cell voltage at the same SOC.

  4. 4

    Add the thermal boundary

    Enable the thermal model so each block has thermal ports. Connect module thermal ports to a cold-plate representation: a Convective Heat Transfer or Conductive Heat Transfer element to a Controlled Temperature Source set to the coolant temperature. Choose heat-transfer coefficients as stated assumptions and check that a steady-current test settles at a sensible temperature rise. Note the heat-transfer coefficients used, since results depend strongly on them.

    Checkpoint: A constant 1C discharge shows cell temperature rising and levelling off at a value consistent with I²R heating and the chosen heat-transfer coefficient.

  5. 5

    Build a detailed-resolution version

    Regenerate one module (or the whole pack, if run time allows) with ModelResolution set to Detailed, so every cell is modelled. Keep the other modules lumped to limit run time. Compare total pack voltage and temperature with the lumped version on the same current profile, and record simulation time for each. Use these run times to decide how many detailed modules the later Monte Carlo study can afford within your available computing time.

    Checkpoint: Lumped and detailed versions agree on pack voltage within a few millivolts per cell when there is no variation, with run times recorded.

  6. 6

    Add cell-to-cell variation

    In the detailed module, assign each cell a capacity and resistance drawn from normal distributions with stated spreads (for example 1 per cent capacity and 5 per cent resistance standard deviation) and a small initial SOC spread, using a fixed random seed. Rebuild and run the drive-cycle profile. Plot the current in each parallel cell over the profile, and check that the sum of the parallel currents always equals the assembly current, as a consistency check.

    Checkpoint: Parallel-cell currents now differ, and the logged maximum current imbalance in an assembly is reported.

  7. 7

    Run the drive-cycle study

    Feed repeated WLTP-derived pack current scaled to the example pack until the first cell reaches its minimum voltage. Record usable capacity, pack voltage, the spread of cell SOC and temperature, and the hottest cell and its location. Use a variable-step solver and check results with a tighter tolerance. Plot a map of cell temperatures across the module at the end of the run so the hot spots and their relation to the cooling path are easy to see.

    Checkpoint: Usable capacity with variation is lower than without, with the reduction quantified and the hottest cell identified.

  8. 8

    Monte Carlo and cooling study

    Run a Monte Carlo over several random seeds for cell variation, and a sweep of coolant temperature and heat-transfer coefficient. Plot usable capacity loss and hottest-cell temperature against these factors. Identify which matters more for this example pack: electrical variation or thermal non-uniformity. Use parsim if Parallel Computing Toolbox is available, because detailed models are slow. Save every run's results with its seed so the distributions can be reproduced or extended later.

    Checkpoint: Distributions of usable capacity and hottest-cell temperature, and sweep plots for cooling parameters.

  9. 9

    Report

    Document the pack definition, parametrisation, model resolutions, thermal assumptions, variation, drive-cycle and Monte Carlo results. Discuss the accuracy and speed trade-off between lumped and detailed models and recommend where each is appropriate. State that thermal parameters are assumptions unless measured. Include the build scripts, cell definition and Monte Carlo seeds so the pack model and every result can be regenerated, and note which thermal parameters most need measurement on a real pack.

    Checkpoint: A report with quantified effects of variation and cooling, and guidance on model resolution.

Testing & validation

  • Single-cell capacity and pulse response match the source data.
  • Lumped and detailed models agree without variation.
  • Energy balance: electrical losses equal heat generated.
  • Results converge with tighter solver tolerances.

Expected results

A Simscape Battery pack model at lumped and detailed resolutions with cell variation and cold-plate cooling, quantifying usable capacity loss, parallel current imbalance and hottest-cell temperature on a drive cycle.

Research angle for your M.Tech thesis

Research questions: what level of model resolution is needed to predict usable capacity and hot-spot temperature within a stated accuracy, and how do electrical variation and thermal gradients interact in parallel assemblies? Baselines: fully lumped pack and fully detailed pack. Metrics: usable capacity error, hottest-cell temperature error, current imbalance and simulation time. A useful contribution is a validated guideline for choosing resolution, or a study of how cell spread grows into current imbalance under cooling gradients, ideally supported by published cell variation data.

Take it further

  • Add a BMS block for balancing and protection from Simscape Battery's library.
  • Model a liquid cooling loop with Simscape Fluids.
  • Add ageing so cell spread grows over life.
  • Compare cylindrical and prismatic cell packs of the same energy.

Viva and review questions

Why does cell variation reduce usable capacity?

In a series string, discharge stops when the weakest group reaches minimum voltage, so charge remaining in stronger groups cannot be used.

Why do parallel cells share current unevenly?

Current divides according to each cell's resistance and OCV; a cell with lower resistance or higher SOC takes more current.

Why not model every cell in detail all the time?

Run time grows with the number of cells, and for many questions a lumped model gives the same answer. Detailed resolution is used where spread matters.

Learn it at DIYguru

These DIYguru courses and programmes teach what this project needs.

Related EV projects

All 100 MATLAB & Simulink EV projects