Battery Model and Analysis with Wolfram SystemModeler
August 9, 2012 — Johan Rhodin, Kernel Developer, Mathematica Algorithm R&D
Explore the contents of this article with a free Wolfram SystemModeler trial. How do different activities such as making phone calls, watching video, listening to music, or browsing the web affect cell phone battery life? What about the temperature—does it matter if the cell phone is in a warm pocket or out in the cold? In this blog post, we’ll investigate how a model constructed with Wolfram SystemModeler can help in finding answers to such questions.
An area where battery usage is taking off right now is cell phones. There are different kinds of battery types used in cell phones: nickel metal hydride, lithium-polymer, and Li-ion. The superior energy density, power density, low self-discharge, and long cycle life of the Li-ion batteries makes them interesting for cell phone applications. In this blog post, we’ll look at Li-ion cells of the type LiFePO4, where lithium ions move from the negative electrode to the positive electrode during discharge and the other way around when charging.
The are many types of battery models: analytical, electrical circuits, electrochemical, and combinations of these types. Our model of choice is the electrical circuit model, which provides sufficient accuracy for top-level performance analysis and is easy to connect to other systems.
A typical schematic for an electrical circuit model of a battery cell might look something like this:
The left part is the energy balance unit, which will determine the cell capacity and amount of energy left in the cell. The right part is the voltage response circuit, which will determine how the cell voltage responds to a given load current. The resistors and the capacitors in the sketch are variable and depend on the State of Charge (SoC), processed charge, and the temperature. The SoC can vary between 1 (fully charged) and 0 (empty). To ensure safe operation, we only permit the SoC to operate in the region from 0.1 to 0.9.
The above sketch is easy to translate into a SystemModeler model. By dragging and dropping the corresponding components from our library into our model and connecting them together, we have a model of a battery cell similar to the sketch:
The threshold components at the top of the model ensure that the cell will turn off if the SoC gets too high or too low. We use this to stop the simulation when we reach these limits, as the model is only accurate within these bounds.
The variable components are components from the Modelica Standard Library with fitted functions from this thesis by Long Lam. Here’s an example of what one of the components, the long transient capacitance, looks like:
As we can see, it’s easy to incorporate custom expressions in the model. One expression will be used during the charge cycle and another during the discharge cycle. The switch will change between the two when the current drops below zero or rises above zero. The fitted expressions will dictate the behavior of the variable capacitance. We can construct the other circuit elements in the same way.
Let’s return to our initial questions and try to use a typical cell phone load on the battery cell. The data is from this paper. There are 11 different modes the cell phone can be in: suspend, idle, phone call, email (Wi-Fi and GPRS), web (Wi-Fi and GPRS), network downloads (Wi-Fi and GPRS), video playback, and audio playback. The power consumption is as follows:
We’ll create a usage cycle where most of the time is spent in the suspend state:
The load profile will look like this:
There’s now a multitude of different questions we can ask the model: How long will the battery last with this type of load cycle repeated? How does the potential change throughout the drain cycle? Does it matter at which temperature I keep the cell phone? With the connection between Mathematica and SystemModeler, analyzing these types of questions becomes easy:
The time until the SoC reached 0.1 and the battery shut down turns out to be almost 14 hours:
How long would the standby time be? This can be found out by using only the suspend mode:
In the same way, we can find out that the battery will last just over three hours with constant network usage:
Let’s compare two cell phones with the load profile we created above: one in Stockholm and one in Mexico City. The cell phone in Sweden will be at 0° C and the one in Mexico at 40° C.
Create two plots:
For this load profile, the battery in Mexico City will last 18 minutes longer than the one in Stockholm:
In SystemModeler it’s easy to start with an intuitive model based on standard components, test it in Simulation Center or Mathematica, and gradually add more components and finer granularity to create a full model.
Equipped with this model, we can go on to answer more questions. What is an optimal charging scheme? Does it matter if I fully charge and discharge the battery, or will the battery lifetime be the same if I just charge it in small chunks now and then? What will the expected discharge time for your typical load profile be? Download the model from the industry example page and find out!