Time to End of Life of a Battery Cell: Failure Times and Degradation Paths
A test of a battery batch that stops early leaves cells still running. This post predicts when they will reach 80% of their capacity with a Weibull model of the lifetimes and a model of the degradation path, and scores each by the cycle life that a manufacturer would quote.
Series: Bayesian Modelling for Industrial Applications, Part 4. Part 3 built a hierarchical model of the state of health of a battery cell, and its second post used it to decide when to retire a cell. This post asks how many cycles a cell will last.
A manufacturer that quotes a cycle life for a new cell cannot wait for every cell of a batch to fail. The slowest of the 13 cells of this series lasts 1,466 cycles, and a test that runs to the last failure takes months or years. The test is stopped early instead. The cells that have fallen below 80% of their capacity have a known life, and the others are still running. Their lives are censored, since all that is known is that they exceed the cycle at which the test stopped.
Two methods use what an early stop leaves. A Weibull model of the lifetimes sees one number for each cell, the cycle of its crossing or the cycle of the stop. A model of the degradation path sees every measurement of capacity and predicts the cycle at which each running cell will cross.1 Predicting the life of a cell from its first cycles is an active field of its own.2 This post compares the two methods on the 13 cells of Part 2, stopping the test at every hundredth cycle from 500 to 900, and scores each prediction by the cycle life that a manufacturer would quote from it. The path model is the more accurate when few cells have failed, and it is over-confident. The Weibull model learns little until cells start to fail, and from 600 cycles it is the safer of the two until about 700 cycles.
Show the setup of the notebook
from importlib.metadata import versionimport osfrom pathlib import Pathimport tempfileimport warningswarnings.filterwarnings("ignore")os.environ.setdefault("OMP_NUM_THREADS", "2")import numpy as npimport pandas as pdfrom bayes import degradation, eol_study, survivalfrom bayes.data import calcefrom bayes.plot import eol, hierarchyfrom bayes.plot.inline import showfrom bayes.plot.theme import BLUE, SLATEFAST = os.environ.get("HIER_FAST") =="1"# a smoke test with a few draws, to check that the notebook runsCACHE = Path("cache-eol-fast"if FAST else"cache-eol")CACHE.mkdir(exist_ok=True)FEATURES = ["charge_current_auc", "charge_current_mean", "discharge_voltage_auc", "discharge_voltage_crest"]STOPS = (500, 600, 700, 800, 900) # cycles at which the test stopsCONFIG = {"draws": 40if FAST else500, "tune": 40if FAST else750, "chains": 2if FAST else4, "target_accept": 0.97}METHODS = {"Path": BLUE, "Weibull": SLATE}CURVE_CYCLES = np.arange(0, 2001, 20)print("fast mode:", FAST)
Show the loading of the data
features = Path(tempfile.gettempdir()) /"calce-battery-features.parquet"full = calce.load(features, FEATURES, every=1) # every cycle, for the first crossing of each cellsample = calce.load(features, FEATURES, every=8) # every eighth cycle, for the path model, as in Part 3table = survival.end_of_life(full)CHEMISTRIES =list(dict.fromkeys(table["CellType"]))COLOURS = hierarchy.palette(CHEMISTRIES)print(table[["cell", "CellType", "first", "last", "eol"]].to_string(index=False))for stop in STOPS: records = survival.truncate(table, stop)print(f"stop {stop}: {int(records['event'].sum())} crossings seen, {int((~records['event']).sum())} cells running")
A rated life is a promise of the number of cycles that a cell will deliver before it falls below 80% of its capacity. A cell that fails before its rating costs the manufacturer a claim, and a rating below the real life gives away cycles that the cell could have sold. When each cycle promised beyond the real life costs and each cycle held back costs , the rating that minimises the expected cost is the quantile of the life distribution at
the same asymmetry of costs that sets the threshold of the cost-loss rule of Forecast Value, Part 1. With a cycle promised beyond the real life costs nine times as much as a cycle held back, and the rating is the 10% quantile of the predicted life. The loss of a rating for an observed life is the pinball loss,
which the last section averages over the cells. A prediction is therefore judged by the rating that it supports and not only by the distance of its median from the truth. A method that is a little too optimistic pays nine times more than one that is a little too cautious.
Lifetimes and Censoring
The end of life of a cell is the first cycle at which its state of health falls below 80%. The 13 cells reach it between 529 and 1,466 cycles: the six cells of CS2 between 529 and 670 and the seven cells of CX2 between 659 and 1,466. Every cell crosses, so the data have no censoring of their own. Stopping the test at a cycle creates it, because a cell that has not crossed then contributes a record that says only that its life exceeds the stop. Figure 1 shows the records for stops of 500, 700 and 900 cycles.
Show the code of the figure
for stop in (500, 700, 900): show(lambda stop=stop: eol.stops(survival.truncate(table, stop), stop, COLOURS))
(a) Stop at 500 cycles
(b) Stop at 700 cycles
(c) Stop at 900 cycles
Figure 1: Records of the 13 cells when the test stops at 500, 700 and 900 cycles. A filled point is a crossing that the test saw, a hollow point a cell still running, with the end of life that the test did not see in grey.
At 500 cycles no cell has failed and all 13 are censored. At 700 cycles nine have failed and four are censored: all six cells of CS2 and three of CX2 have crossed, and the four cells that run on are CX2_37, CX2_33, CX2_35 and CX2_16. At 900 cycles only CX2_16 is still running, and it runs to 1,466 cycles, 1.7 times the life of the next longest cell. Its record begins at cycle 463, so its early life is missing, and it is kept. A manufacturer that stops at 500 cycles has seen no failure and must still quote a life, and one that stops at 700 cycles has seen one chemistry finish failing while the other has not.
Weibull Model of Lifetimes
The Weibull distribution describes the life of a cell by a shape and a scale through its survival function,3
The shape is shared by the two chemistries, and the logarithm of the scale of chemistry is , so that is the difference between them. A record that crossed contributes the density of the distribution at its life, and a censored record contributes the survival function at the stop. A cell that is still running therefore tells the model that its life is longer than the stop, and nothing more. Two chemistries cannot support an estimate of a spread between chemistries, so the difference is a single parameter with a normal prior of standard deviation 0.5. The shape has a log-normal prior centred on 2, and the logarithm of the scale, in thousands of cycles, has a normal prior centred on the logarithm of 0.8 with a standard deviation of 0.7.
Figure 2 draws lifetimes from these priors before any cell is seen.4 Their median is 626 cycles and 90% of them lie between 87 and 2,917 cycles, so the priors allow lives much shorter and much longer than any observed one, and the 13 observed lives lie inside them. They are weak enough to be learnt from and strong enough to rule out a life of a million cycles.
Figure 2: Lifetimes implied by the priors of the Weibull model, as a density, with the end of life of the 13 observed cells as hollow points.
Survival after Each Stop
Figure 3 draws the posterior survival curve of each chemistry for the three stops, with the crossings that the test saw marked on the axis. At 500 cycles the curves of the two chemistries coincide and are wide. Every cell has outlived the stop and nothing bounds a life from above, so the posterior moves the scale of both chemistries up from the prior to a median of about 1,800 cycles, with a 90% interval from 860 to 4,900, and the posterior probability that CX2 lives longer than CS2 is 0.49.
Figure 3: Posterior survival curve of each chemistry, with its 90% band, after a stop at 500, 700 and 900 cycles. Points on the axis are the crossings that the test saw and the dashed line is the stop.
At 700 cycles nine failures have been seen and the curves separate. The scale is 605 cycles for CS2 (90% interval 541 to 685) and 792 for CX2 (695 to 998), the shape is 6.5 (3.5 to 10.7), and the probability that CX2 lives longer is 0.998. A shape of about 6 means that lives are narrowly spread, since a constant hazard has a shape of 1: once the cells of a chemistry begin to fail they fail within a short window. The model gives the mean remaining life of a cell that is in service at an age through the incomplete gamma function of the distribution and not through the scale alone,5 and for a CX2 cell in service at 700 cycles it is 121 cycles (90% interval 52 to 300). At 900 cycles the fit is almost the same as at 700, with a scale of 804 cycles for CX2, because the one cell that is still running adds little.
Degradation Path of Each Cell
The second method uses the measurements. The curve of Part 3 cannot be extended to a crossing: its mean levels off at a constant unless a diagnostic, measured in the same cycle as the capacity, keeps it falling, and the diagnostics of a future cycle are not known. A path for a cell that is still running needs a function of the cycle alone that has no ceiling. The loss of capacity, 100 minus the state of health, is given a power law,6
where is the loss after 500 cycles and is the shape of the decline: linear at 1, decelerating below it and accelerating above it. The path reaches the end-of-life loss of 20 points at
so that every posterior draw of a cell gives a crossing cycle in closed form. The parameters and of a cell are drawn around the mean of its chemistry with a spread that each chemistry estimates, and the noise of the measurement is normal.
Two choices of the model were found by failure and are kept as advice. A reference of 1,000 cycles, outside the early data, made the level and the shape trade off against each other, and one fit took 29 minutes with 15 divergent transitions. A reference of 500 cycles, inside the data, took 33 seconds, but a common parent of the two chemistries with a spread of its own gave 49 divergent transitions, because two groups cannot inform a spread. With a prior of its own for each chemistry the fit takes 28 seconds and has none. Figure 4 shows the fitted paths of each chemistry for a test that stops at 600 cycles.
Figure 4: Fitted loss paths of each chemistry for a test that stops at 600 cycles. Hollow points are the measurements seen, grey points those not seen, dashed lines the paths beyond the stop and diamonds the observed end of life.
Of the nine cells that are running at 600 cycles, none has a shape above 0.99: the shapes lie between 0.57 and 0.99, so the fitted paths decelerate or are linear. The three CS2 cells that have already crossed with a visible knee, CS2_33, CS2_34 and CS2_36, have shapes of 1.6 to 2.2. A path fitted to the first 600 cycles therefore bends less than the cells do later, and the dashed continuation of every running cell reaches 20 points after the cycle at which the cell really crossed. The grey measurements, which the model did not see, fall away below the dashed path. The early loss of capacity is fast and slows, and the knee that follows is not in the data that the model has when the test stops.
Prediction of Running Cells
Both methods predict the end of life of the cells that are still running at the stop, conditioned on the cell being in service then. For the Weibull model that is a draw from the conditional distribution given a life above the stop. For the path model it is the crossing of the path, with the draws at or below the stop dropped, which is at most 6.3% of the draws of a cell. Each prediction is scored by the error of its median, by whether its central 90% interval holds the observed life, by the interval score that adds a penalty to the width of an interval that misses, and by the pinball loss of the 10% quantile as the rated life. Figure 5 shows the intervals for the nine cells that are running at 600 cycles.
Show the code of the figure
for method in ("Weibull", "Path"): show(lambda method=method: eol.intervals(scores[(scores["stop"] ==600) & (scores["method"] == method)], 600, COLOURS))
(a) Weibull model
(b) Path model
Figure 5: Median and 90% interval predicted for each of the nine cells running at 600 cycles by the two methods. A diamond is the observed end of life, and an interval that runs past 2,000 cycles is cut there.
The Weibull intervals carry no information about the cell and are almost the same for every cell of a chemistry: they are wide and cover 7 of the 9 observed lives. The path intervals are narrow, about 100 cycles wide for most cells, and lie to the right of the observed life, so they hold it for one cell only, CX2_16, whose interval is wide because its life is the longest. The path model is nearer to the truth than the Weibull model and sure of the wrong answer. Figure 6 follows the two methods over the five stops.
Show the code of the figure
for value, name, reference in ( ("median_error", "Median absolute error (cycles)", None), ("coverage", "Share of intervals that hold the end of life", 0.9), ("pinball", "Mean loss of the rated life (cycles)", None),): show(lambda value=value, name=name, reference=reference: eol.accuracy(summary, value, name, METHODS, reference))
(a) Median absolute error (cycles)
(b) Coverage of the 90% interval
(c) Loss of the rated life (cycles)
Figure 6: Median absolute error, coverage of the 90% intervals and mean loss of the 10% rated life of the two methods, against the cycle at which the test stops. The dotted line is the intended coverage.
When few cells have failed the path model has the smaller error: the median absolute error is 174 cycles against 914 at 500 cycles, and 175 against 337 at 600. The Weibull model at 500 cycles has seen only censored records, which bound the lives from below, so it predicts lives that are far too long. From 700 cycles the Weibull error is comparable, 64 cycles against 77, and at 800 and 900 cycles the path model is again nearer, 38 against 82 and 42 against 519, on three cells and one. The coverage of the path intervals is 8%, 11% and 25% at the first three stops, against 90% intended, and the error of its median is positive for all 26 predictions at those stops, so it is biased late and over-confident together. The bias is the one of the previous section: a power law fitted to a decline that slows and then accelerates cannot foresee the acceleration. The coverage of the Weibull intervals is 62%, 78% and 75% at the same stops, closer to the intended level because the model does not claim to know the cell.
Rated Life under Each Method
The pinball loss of the rated life separates the methods differently from the error of the median. At 500 cycles the two are costly, 90 for the path model and 101 for the Weibull model, in cycles of loss per cell. At 600 cycles the path model costs 91 and the Weibull model 33, nearly three times less, because the rating of the path model lies above the real life of eight of the nine running cells and each cycle of excess costs nine times as much as a cycle held back. At 700 cycles the methods tie, 24 for the path model and 26 for the Weibull model, for opposite reasons. The path rating exceeds the real life for three of the four running cells and pays nine for each cycle of excess, while the Weibull rating of about 720 cycles is below the real life of three of them and loses a tenth of each cycle. At 800 cycles the path model costs 9 and the Weibull model 24.
At 500 cycles neither rating is good. A manufacturer that stops at 600 cycles is better served by the conservative interval of the Weibull model, and one that stops at 800 cycles or later has a path whose median is 38 cycles from the observed lives of the three cells that remain. The comparison rests on few cells at the later stops, and the evidence for the choice after 700 cycles is weak.
Limits of the Study
The data are 13 cells of two chemistries from one laboratory, and the stops after 700 cycles rest on four, three and one running cells, so differences between the methods at those stops are observations and not estimates. The power law is a single function for a decline that slows and then accelerates, and its bias is not removed by pooling, because the knee is not yet in the data of most cells when the test stops. The model treats the residuals of successive measurements as independent, with a noise of about one point of state of health, whereas the residuals of one cell are strongly correlated along its life, and the intervals are narrow for that reason as well. The Weibull model uses only the chemistry of a cell, its shape grows from 3.0 to 6.5 as cells fail, and at 500 cycles its posterior is the prior moved by the fact that all 13 cells survived, so its wide intervals say little. The rated life takes a ratio of costs of 0.1 for illustration and ignores the cost of running the test longer. A model that adds the knee to the path, or that calibrates its intervals on cells that were left out, is the next step.
Summary of Findings
A test that is stopped early leaves censored lives, and the two methods use them differently. The Weibull model uses the cycle of each crossing and learns nothing about a running cell beyond its chemistry. When no cell has failed, at 500 cycles, its posterior is the prior moved upwards by the fact that every cell survived, and its median error is 914 cycles. Once nine cells have failed, at 700 cycles, it separates the chemistries with a probability of 0.998 that CX2 lives longer, with a scale of 605 cycles for CS2 and 792 for CX2.
The path model uses every measurement and predicts each cell separately. It has the smaller error at most stops, 174 cycles at 500 cycles against 914, and it is over-confident and late: its intervals hold the observed life for 8% to 25% of the cells up to 700 cycles and every one of its 26 predictions at those stops is too long, because a power law fitted to the early decline cannot foresee the knee.
For a manufacturer who rates a life at the 10% quantile, an optimistic prediction costs nine times as much as a cautious one. At 500 cycles neither rating is good, 90 for the path model and 101 for the Weibull model. At 600 cycles the Weibull rating is the cheaper, 33 against 91. At 700 cycles the methods tie, and from 800 cycles the path model is the cheaper on the few cells that remain. The practical rule is to rate from the conservative interval until most cells of the batch have failed, and to use the path once the test is near the knee.
Reproducible Results
The notebook is in the bayesian-modelling repository and runs from the first cell to the last in the uv environment of the repository, with PyMC 5.25, ArviZ 0.22 and lets-plot 4.11, and downloads the feature file when it first runs. The models, the study and the figures are functions of the bayes package, which has unit tests, and the cells of the notebook only call them. The ten fits, a Weibull model and a path model at each of five stops, are stored in cache-eol/ and take about five minutes on a laptop at a target acceptance rate of 0.97; setting the environment variable HIER_FAST=1 runs the whole notebook with a few draws. The study uses the first post of Part 3 only for its data.
Show the numbers quoted in the text
# Numbers that the text quotes. This cell prints them and is hidden on the page.print("prior lifetime percentiles 5, 50, 95:", np.percentile(prior, [5, 50, 95]).round(0), "| observed", table["eol"].min(), "to", table["eol"].max())for stop in (500, 700, 900): fit = eol_study.weibull_fit(table, stop, CACHE, CONFIG) alpha = fit.posterior["alpha"].to_numpy().ravel() delta = fit.posterior["delta"].to_numpy().ravel() scale = fit.posterior["beta_chem"].stack(draw_all=("chain", "draw"))print(stop, "shape", np.percentile(alpha, [5, 50, 95]).round(2), "delta P(>0)", round(float((delta >0).mean()), 3))for name in CHEMISTRIES:print(" scale", name, np.percentile(scale.sel(chemistry=name).to_numpy() *1000, [5, 50, 95]).round(0))fit = eol_study.weibull_fit(table, 700, CACHE, CONFIG)alpha = fit.posterior["alpha"].to_numpy().ravel()scale = fit.posterior["beta_chem"].stack(draw_all=("chain", "draw")).sel(chemistry="CX2").to_numpy() *1000print("remaining life of CX2 at 700:", np.percentile(survival.weibull_remaining_life(alpha, scale, 700.0), [5, 50, 95]).round(0))path = eol_study.path_fit(sample, 600, CACHE, CONFIG)print("path shape b at 600:", path.posterior["b_cell"].mean(("chain", "draw")).to_series().round(2).to_dict())print("noise", np.percentile(path.posterior["noise"].to_numpy().ravel(), [5, 50, 95]).round(2))print(summary.round(2).to_string(index=False))print("largest share of path draws dropped:", round(float(dropped["dropped"].max()), 3))print("share of path predictions that are too long at 500, 600, 700:", int((scores[(scores["method"] =="Path") & (scores["stop"] <=700)]["error"] >0).sum()), "of", int(((scores["method"] =="Path") & (scores["stop"] <=700)).sum()))print("path, stop 600, intervals that hold the life:", scores[(scores["method"] =="Path") & (scores["stop"] ==600)][["cell", "covered"]].to_dict("records"))for stop in (500, 600, 700, 800, 900):for name in ("Path", "Weibull"): rows = scores[(scores["method"] == name) & (scores["stop"] == stop)]print(stop, name, "rated", rows["rated"].round(0).tolist(), "actual", rows["eol"].tolist())
References
[1] C. J. Lu and W. Q. Meeker, “Using degradation measures to estimate a time-to-failure distribution,” Technometrics, vol. 35, no. 2, pp. 161-174, 1993.↩︎
[2] K. A. Severson et al., “Data-driven prediction of battery cycle life before capacity degradation,” Nat. Energy, vol. 4, pp. 383-391, 2019.↩︎
[3] W. Weibull, “A statistical distribution function of wide applicability,” J. Appl. Mech., vol. 18, no. 3, pp. 293-297, 1951.↩︎
[4] J. Gabry, D. Simpson, A. Vehtari, M. Betancourt, and A. Gelman, “Visualization in Bayesian workflow,” J. R. Stat. Soc. A, vol. 182, no. 2, pp. 389-402, 2019.↩︎
[5] The mean remaining life of a cell in service at an age is with and the upper incomplete gamma function. For a shape of 2, a scale of 500 and an age of 300 it is 251.6 cycles. A formula that leaves out the gamma factor gives 416.7.↩︎
[6] C. J. Lu and W. Q. Meeker, “Using degradation measures to estimate a time-to-failure distribution,” Technometrics, vol. 35, no. 2, pp. 161-174, 1993.↩︎
Citation
BibTeX citation:
@online{faustine2026,
author = {Faustine, Anthony},
title = {Time to {End} of {Life} of a {Battery} {Cell:} {Failure}
{Times} and {Degradation} {Paths}},
date = {2026-11-29},
url = {https://sambaiga.github.io/pages/blog/posts/2026/11/2026-11-29-time-to-end-of-life.html},
langid = {en}
}