2RC Equivalent-Circuit Battery Model in MATLAB/Simulink: A Step-by-Step Guide
How a 2RC equivalent-circuit model of a Li-ion cell works, how to find its parameters from a pulse test, and how to build and check it in Simulink.
· Aura Volt Engineering Team
Almost every battery management system (BMS) algorithm starts with a cell model. State-of-charge (SOC) estimators, available-power limits and thermal checks all need a model that predicts the cell's voltage from its current. The 2RC equivalent-circuit model is the most common choice in EV work. It is accurate enough for control, simple enough to run on a microcontroller, and easy to build in MATLAB/Simulink.
What the 2RC model represents
The model replaces the chemistry inside a Li-ion cell with four electrical parts in series:
- An open-circuit voltage source, OCV(SOC): the voltage of a rested cell, which depends on its state of charge
- A series resistance, R0: the instant voltage drop when current starts or stops
- A fast RC pair, R1–C1: polarisation that settles in a few seconds (charge transfer)
- A slow RC pair, R2–C2: polarisation that settles over minutes (diffusion)
One RC pair (a 1RC model) often misses either the fast or the slow part of the voltage recovery after a pulse. Two pairs capture both, which is why 2RC is the usual compromise between accuracy and effort.
The equations
With discharge current I taken as positive, the terminal voltage is:
V = OCV(SOC) − I·R0 − V1 − V2
Each RC voltage follows a first-order equation:
dV1/dt = −V1/(R1·C1) + I/C1
dV2/dt = −V2/(R2·C2) + I/C2
State of charge comes from counting charge, with Q the cell capacity in ampere-seconds:
dSOC/dt = −I / Q
The time constants τ1 = R1·C1 and τ2 = R2·C2 are what you are really choosing. A typical Li-ion cell shows τ1 of a few seconds and τ2 of tens to hundreds of seconds.
Finding the parameters from a pulse test
The standard data source is a hybrid pulse power characterisation (HPPC) test, or any test with rest–pulse–rest steps at several SOC levels:
- OCV(SOC): rest the cell for long enough at each SOC step (often one hour or more) and record the settled voltage. This gives the OCV curve as a lookup table.
- R0: divide the instant voltage jump at the start or end of a current pulse by the current step.
- R1, C1, R2, C2: fit the voltage recovery after the pulse ends with two decaying exponentials. The two amplitudes divided by the current give R1 and R2; the two time constants give C1 = τ1/R1 and C2 = τ2/R2.
- Repeat across SOC (and temperature), because every parameter changes with them. The result is a set of lookup tables rather than single numbers.
In MATLAB, the exponential fit is a short least-squares problem (for example with lsqcurvefit), or you can use parameter estimation tools to fit the whole Simulink model to the measured voltage at once.
Building it in Simulink
There are two practical ways to build the model:
- With Simscape Electrical: connect a controlled voltage source driven by an OCV lookup table, a resistor and two parallel RC branches, then drive the circuit with a controlled current source. This approach scales naturally to packs with many cells.
- With plain Simulink blocks: implement the three differential equations above with integrators and lookup tables. This version runs fast and is easy to turn into code for an embedded BMS.
Either way, keep SOC as an explicit state, limit it to the range 0 to 1, and use the same lookup-table breakpoints for all parameters, so the tables stay consistent.
Checking the model
A model is only useful once it has been checked against data the fit did not use:
- Run a drive-cycle current profile (UDDS or WLTP current, scaled to your cell) and compare the simulated voltage with a measurement.
- Look at the voltage error over time, not just its average. Errors that grow at low SOC usually point to the OCV curve; errors right after current steps usually point to R0 or the fast RC pair.
- A well-fitted 2RC model typically stays within a few tens of millivolts over most of the SOC range.
Common mistakes
- Mixing up current direction: decide once whether discharge is positive, and use it everywhere: in the equations, the current source and the SOC integrator.
- A single R0 for all temperatures: resistance can change several-fold between cold and warm cells.
- Too-short rest periods when measuring OCV, which bakes polarisation into the OCV curve.
- Fitting all parameters at one SOC and assuming they hold everywhere.
Where to go next
Once the cell model is reliable, it becomes the base for an SOC estimator (such as an extended Kalman filter), a pack model with cell-to-cell variation, and balancing studies. Our Virtual Lab experiment on four commercial Li-ion cells shows charge and discharge behaviour of real cells built on the same ideas.
If you need a validated cell or pack model for your project, or training for your team on battery modelling in Simulink, talk to us about EV battery modelling and BMS.