Estimating the battery capacity using current power consumption and battery percentage



I want to estimate the current maximum capacity (in kWh) having the current power consumption (in kWh) and the state of charge of the battery (in %) available in a time series.

I do not have a full battery charge circle recorded but only a snippet with the state of charge going from ~95% to ~35% in a 1 second data recording interval.

At first, i cumulated the current power consumption and noticed that the progression between cumulated power consumption and state of charge was almost the same (see figure 1 and 2).

progression of state of charge vs. cumulated power consumption enter image description here

So i tried to use a linear regression model to predict two values of cumulated power consumption at 0% and 100% state of charge. In my assumption the delta of these two leaves me with the current maximum capacity of the battery.

Ideally i want to monitor the capacity during the data recording. Which means i only have data of a few percent of state of charge. In figure 3 and 4 you can see my attempt of trying to create a linear regression model for every 2% state of charge. As you can see in the right plot, the estimated capacity has a very high variance.

LEFT: regression lines (green) of every 2% state of charge; RIGHT: estimated capacity of every 2% state of charge enter image description here

Since i am not an expert in neither the matter of regression nor batteries/physics, my questions are:

  • Is there a much simple or more exact way (or both) to estimate the current maximum capacity of the battery?

  • If yes, is there a good way to estimate an sufficiently exact capacity with an even smaller snippet in an ongoing process, lets say every 2% state of charge? (maybe using a characteristic curve of the discharge process)

Here is a sample of my data: sample file

R. Doe

Posted 2016-01-27T14:02:57.430

Reputation: 251

Although this question is absolutely suited to this site, I suspect you might have more luck over at

– CatsLoveJazz – 2016-02-09T10:45:58.477

@r-doe. I have a few questions and some of these may or may not apply to your case depending on what the data looks like. 1. Are you imputing any values? 2. Is there a pattern to the state of charge % like a least count increment. 3. Is the data tagged with any other categorical variables? 4. Is the graph of state of charge (x) vs non cumulated consumption (y) a flat line? (Should be) 4. Any sample data? – Drj – 2016-04-12T20:44:32.710

Power consumption is measured in kW, nor kWh neither kW/h. Are you sure you get your physics right? – Diego – 2016-04-18T04:28:04.597

1@Diego Battery Capacity is most of the times given in kWh. Because of that I integrated the consumption over time to get the time component in there. – R. Doe – 2016-04-18T07:35:21.657

@Drj: 1.) I do interpolate the two times series "state of charge" and "power consumption" in order to make them equidistant in the time domain (for direct comparison) but other than that, no. 2.) I am not sure what you mean here. (could you please explain yourself a bit more?) 3.) the data is tagged with a charging variable stating whether the cable is plugged to charge the battery or not.. however I only consider complete data samples where the cable is unplugged, so it might not be relevant. – R. Doe – 2016-04-18T07:42:40.413

@Drj: 4.) Link is in the main post. – R. Doe – 2016-04-18T08:35:36.560

It's been a while since I did my B.Eng (elec), but I have a recollection that discharge curves were different for different types of batteries Lead-Acid / NiCd and now NiMH. What type of battery are you using, or have I missed that? I'm pretty sure that the discharge curves of the last two are quite different to Lead-Acid and solid chemical battery. – Marcus D – 2016-05-09T07:53:04.653

@MarcusD according to the manufacturer, the battery is an ithium ion; Battery weight: 260kg; Capacity (kWh): 22kwh; Number of elements: 192 cells; Nominal voltage: 240 to 400; From 0 to 100%: 8h; From 0 to 50%: 3h30; From 50 to 100%: 4h30; From 20 to 80%: 4h30; Maximum Current drawn from 220V main: 3KW; Slow Charge (A): 16A – R. Doe – 2016-05-09T08:49:24.333

@MarcusD The discharging curve seems pretty linear to me (in the area of 40% to 90%). However, I do expect some non-linear progression beyond that, but I do not know how to take them into account since I have only very few data beyond 40% or above 90%. The discharging from 90% to 40% will take several hours of driving an electrical car. – R. Doe – 2016-05-09T08:54:36.907

Welcome to the site :) – Dawny33 – 2016-01-27T16:34:51.417



Firstly, a common chemical battery discharging from 95% to 35% in 1 second is undergoing a very deep discharge and its discharge profile will be very different from a slow steady discharge, e.g. 95% to 35% within 10 hours. Secondly, inferring from a very small snippet of the charge process (2% change) may work only if you know exactly which charge profile is being exhibited by the battery during that charge cycle, so that you can identify at which point of the charge cycle is the battery right now.

For most chemical batteries, the current consumption by the load determines the discharge profile and hence the capacity at a given point of time in the future. Since this is usually non-linear, and the slope varies at different points of the discharge profile, a linear regression would not be a good fit. I would recommend trying out a polynomial regression fit on the discharge profile. Multivariate adaptive regression splines should also work well. Similarly, the rate of charging determines the charge profile/characteristic curve.

You could fit multiple models, one each for each type of charge profile (e.g. deep discharge, slow discharge, etc.) and then select the appropriate model based on the current status of the battery, to predict the future state.

To understand this process for a lead acid battery, refer to these -

  1. and,

Sandeep S. Sandhu

Posted 2016-01-27T14:02:57.430

Reputation: 2 087