Problem
An operator running a battery energy storage system (BESS) needs to know how a dispatch strategy will age the cells: how much capacity is left after one, five and ten years, and when the battery reaches end of life. The lab cycling data a model like this is calibrated on comes from accelerated tests with fast, deep cycles. Real BESS duty is slower and shallower, so a model asked about real operation is often answering outside the data it was fitted to.
Constraints
- A prediction has to say when it is extrapolating, not just return a number.
- Comparing operating policies means many evaluations, so the common questions have to be fast.
- Real dispatch is irregular: small cycles nested inside larger ones, and rest periods of varying length.
- Calibration covers LFP/graphite cells.
What I built
A physics kernel, a trust check, and a fast surrogate that learns only from the kernel.
The kernel is a reduced-order degradation model with three regimes: SEI growth on fresh graphite, a steady phase where SEI and microcracking produce roughly linear fade, and electrode percolation failure, which produces the capacity knee. Temperature enters through Arrhenius terms calibrated against Sandia National Laboratories LFP cycling data. A real dispatch history goes through rainflow cycle counting (ASTM E1049-85), which handles nested cycles and noise.
Every result carries parameter provenance and a trust tier (validated, guarded, extrapolated or unsupported) with machine-readable reasons. For steady-state policy questions, an XGBoost surrogate trained on the kernel's own output answers far faster than the kernel. It is not a replacement for the physics: if the kernel is wrong, the surrogate is wrong, and it learns no corrections of its own. The library also generates PDF reports.
How it was verified
The kernel was cross-validated against Sandia LFP cycling data at 0.88% RMSE under linear-fade conditions. The surrogate was checked against the kernel: across the trusted region its 10-year validation RMSE is 2.91%. In the core BESS operating region, measured over its training and test points together, its 10-year retention RMSE is 0.20%, with 97.8% pairwise ranking concordance. The library has a test suite.
When I ran the four standard BESS service classes (solar shift, peak shaving, frequency regulation and backup) through the trust check, all four came back flagged as outside the calibration domain, which is correct for a model fitted to accelerated lab data. No real-world dispatch trace with periodic capacity checks has been run through the trace path yet.
Outcome
Version 0.8.1, calibrated for LFP cells. The next step is validation against real BESS dispatch data with periodic capacity checks.
Stack
- Python
- NumPy
- XGBoost
- matplotlib
- ReportLab