This example shows how to model a lead-acid battery cell using the Simscape™ language to implement the nonlinear equations of the equivalent circuit components. In this way, as opposed to modeling entirely in Simulink®, the connection between model components and the defining physical equations is more easily understood. For the defining equations and their validation, see Jackey, R. "A Simple, Effective Lead-Acid Battery Modeling Process for Electrical System Component Selection", SAE World Congress & Exhibition, April 2007, ref. 2007-01-0778.
In this simulation, initially the battery is discharged at a constant current of 10A. The battery is then recharged at a constant 10A back to the initial state of charge. The battery is then discharged and recharged again. A simple thermal model is used to model battery temperature. It is assumed that cooling is primarily via convection, and that heating is primarily from battery internal resistance, R2. A standard 12 V lead-acid battery can be modeled by connecting six copies of the 2V battery cell block in series.
This model is constructed using the Simscape example library LeadAcidBattery_lib. The library comes built and on your path so that it is readily executable. However, it is recommended that you copy the source files to a new directory, for which you have write permission, and add that directory to your MATLAB® path. This will allow you to make changes and rebuild the library for yourself. The source files for the example library are in the following package directory: matlabroot/toolbox/physmod/simscape/simscapedemos/+LeadAcidBattery where matlabroot is the MATLAB root directory on your machine, as returned by entering matlabroot in the MATLAB Command Window.
The figure below shows the battery current and state of charge in a MATLAB figure. You can also view the data in the Simscape Results Explorer and the Simulation Data Inspector.