Lithium battery model built based on Simscape
I. Introduction
To ensure the safe and reliable operation of battery energy storage systems, battery management systems must estimate and predict various states of the lithium-ion batteries in the energy storage system, such as state of charge (SOC), state of health, and internal resistance. A prerequisite for achieving these functions is the establishment of an accurate and reliable lithium-ion battery model. The nonlinear characteristics of power lithium-ion batteries make it difficult for many methods to obtain accurate estimation results. Therefore, a suitable mathematical model must be established to characterize the battery's characteristics. This article will explain how to build an accurate battery model using Simscape.
There are many methods for modeling lithium-ion batteries, such as Simulink models and Simscape models. This article uses Simscape components to build a lithium-ion battery model. The Matlab/Simscape language supports the definition of physical modeling components, domains, and libraries, providing a natural and efficient way to construct mathematical models of physical systems. Multi-domain schematics can be created through physical connections, where Simscape components directly represent physical components. The connections between model components directly correspond to actual physical connections, enabling energy transfer.
Simscape also provides the Parameter Estimation Toolbox, which allows you to estimate model parameters by matching simulation outputs to experimental data under the same inputs after model establishment. The model's operation under different charge and discharge conditions yields data on the temporal variations of battery cell current, voltage, temperature, and SOC. Commonly used equivalent circuit models include the Rint model, the Thevenin model, the PNGV model, and the RC model. After comprehensively comparing the advantages and disadvantages of each model, this article chose Simscape to build a second-order RC equivalent circuit model.
II. Battery Testing
After selecting an appropriate battery model, the next step is to conduct battery charge and discharge tests to identify certain internal battery parameters. During the battery charge and discharge process, its internal parameters change dynamically with the state of charge, which is the primary factor contributing to the discrepancy between simulation results and actual values. Since internal parameters cannot be directly measured, battery charge and discharge tests are conducted, and the measured voltage data is used to identify these parameters, thereby reducing estimation errors caused by dynamic changes in battery parameters.
Ternary lithium batteries were used in the experiment. Intermittent charge/discharge tests and hybrid pulse power characteristic (HPPC) tests were performed on the batteries. The test steps are as follows.
2.1 Intermittent Charge/Discharge Test
Step 1: Discharge the battery to empty or fully charge it.
Step 2: Discharge at a 1C discharge rate for 6 minutes. If the battery voltage is below 3.0V or above 4.2V within 6 minutes, proceed to Step 4; otherwise, proceed to Step 3.
Step 3: Allow the battery to rest for 1 hour, then return to Step 2.
Step 4: Discharge the battery to empty or fully charge it at a low current of 0.02C.
2.2 HPPC Test
Step 1: At room temperature, charge the battery fully with a 1C charge current, reaching a SOC of 100%, and allow it to rest for 1 hour.
Step 2: Discharge the battery with a 1C discharge current for 6 minutes, then allow it to rest for 1 hour.
Step 3: Discharge the battery with a 1C pulse current for 10 seconds, then allow it to rest for 40 seconds; then charge the battery for 10 seconds, then allow it to rest for 40 seconds (completing one HPPC test).
Step 4: Repeat steps 2 and 3 for a cycle test until the battery SOC reaches 0%.
III. Battery Parameter Identification
Battery parameter identification can be performed using the results of the intermittent charge/discharge test and the HPPC test. The specific methods are discussed in numerous publications on CNKI and will not be detailed here.
3.1 Open Circuit Voltage Identification Results
Table 1: OCV-SOC Identification Results

This identifies the open-circuit voltage. Next, we used the Matlab fitting toolbox to perform an nth-order polynomial fit on the identification results in Table 1. This yielded the relationship between SOC and open-circuit voltage (OCV) at different times.
3.2 Resistance and Capacitance Identification Results
Based on Kirchhoff's law, the mathematical relationship for the second-order RC model can be derived:

Where R0 is the battery's ohmic internal resistance, R1 and C1 are the polarization resistance and capacitance, R2 and C2 are the concentration resistance and capacitance, and U1 and U2 are the terminal voltages of R1 and R2, respectively.

Since the voltage change during battery rest is primarily due to ohmic resistance, the ohmic resistance can be calculated based on the voltage change at the moment of discharge and the voltage change at the end of charge.
During the static state, the voltage rebounds due to the influence of the battery's internal polarization resistance and capacitance. The expression for this is as follows:

Based on the data from the pulse discharge test, the pulse power characteristic test data at each SOC point was imported into the Matlab fitting toolbox. A custom second-order exponential function was used to fit the data using Custom Equations. Substituting the fit results into the above two equations, the equivalent circuit model parameters at different SOCs were identified, as shown in the table below.
Table 2: Resistor-Capacitor Coefficient vs. SOC Identification Results

The parameter identification results in Table 2 show that as the battery's SOC decreases, the resistances R0, R1, and R2 fluctuate, but the fluctuations are not particularly significant. The capacitances C1 and C2 initially increase significantly, peak when the SOC decreases to approximately 0.4, and then decrease. This is primarily due to the varying strength of polarization effects, such as the battery's electrical polarization and concentration polarization, at different SOCs. (Note: Please pay attention to the units of the resistance-capacitance coefficients when performing parameter identification!)
IV. Building a Simscape Battery Model
After determining the equivalent circuit model for the lithium battery, we used the Simscape module in Matlab to build a second-order RC equivalent circuit model. Simscape modules describe the physical structure of the system, with each component representing a physical element. Because the six equivalent circuit components (Uoc, R0, R1, R2, C1, and C2) not only need to have corresponding physical properties, but their parameters also change continuously with the charge and discharge process, the second-order RC equivalent circuit model built using Simscape is shown in the figure below. (This article uses Matlab version 2019a.)

The figure above shows the schematic diagram of the battery equivalent circuit built in Simscape. The blue lines connect the physical model components, and the black lines connect the modules under Power System, which facilitates model construction. This article requires building an accurate dynamic parameter model and performing simulation optimization in Simulink based on input and output test data.
The controlled terminal of the controlled voltage source is connected to a lookup table module, Em Lookup, indicating that the battery's electromotive force changes with SOC. The negative terminal of the voltage source is connected to an ammeter, which transmits the current information in the circuit to the SOC calculation module, which then calculates the current battery SOC.
This model has two inputs: a test pulse current and a test voltage. The pulse current serves as the model input, and the simulated voltage generated by the model output is matched to the measured voltage. The specific image is shown below:

V. Battery Model Accuracy Verification
After performing parameter estimation using pulse discharge, the quality of the parameter estimation results requires experimental verification of the model parameters. Specifically, a battery discharge test is performed, and the terminal voltage data is recorded. Then, the same current is used as the model input, and the simulation time is set to match the experimental time to obtain the model voltage estimation results.
Verifying the accuracy of the established Simscape model primarily involves analyzing how well the simulation output matches the measured values under the same input values. The deviation is larger at the start of the pulse and during the transient voltage surge, primarily due to the sudden change in load current during this period. However, the maximum deviation does not exceed 2%. During the static phase, the deviation stabilizes due to the rebound characteristic of the battery voltage. Upon cessation of discharge, the voltage across the battery slowly rises and stabilizes.
In summary, a lithium-ion battery simulation model was established using physical models such as a constant voltage source, capacitors, and resistors built in Simscape. Battery test data was obtained through charge/discharge tests, and the nonlinear least squares method was used to fit this data to identify the required battery performance parameters in the model. Experimental verification demonstrated an overall error accuracy of less than 2%, demonstrating the high accuracy of the model and providing a foundation for vehicle analysis.
- The heart of new energy electric vehicles: a detailed introduction to the battery pack[Photo]
- Introduction to Solid-State Electrolytes: Oxides, Polymers, and Sulfides[Photo]
- Introduction to Basic Lithium Battery Parameters[Photo]
- Five-Axis Machine Tool Programming: From Basics to Key Technologies[Photo]
- Introduction and selection of PDU core electrical components--high voltage relay[Photo]
- High-Voltage DC Relay Knowledge
- Lithium-ion Battery Testing Manual[Photo]
- Lithium battery model built based on Simscape[Photo]
- Lithium battery equivalent circuit parameter identification (Thevenin first-order RC model)[Photo]
- Parameter Identification of Second-Order RC Equivalent Circuit of Lithium Batteries (Improved Thevenin Model)[Photo]













