Transparent empirical battery capacity-fade fitting and bounded EOL projection
View the Project on GitHub mohammadrezwankhan/battery-cycle-life-analyzer
Fit transparent empirical capacity-fade models, compare diagnostics, and project battery end of life inside an explicit extrapolation limit.
View the source and documentation | Open the Colab notebook

git clone https://github.com/mohammadrezwankhan/battery-cycle-life-analyzer.git
cd battery-cycle-life-analyzer
python -m pip install .
python -m bcla --model all
For the separately licensed real-data workflow:
python examples/oxford_energy_trading.py --cell BMR_cell1
For normalized capacity Q(n) at cycle n:
Q(n) = Q0 - k nQ(n) = Q0 - alpha n^betaQ(n) = Q0 - a ln(1 + b n)The default multi-model workflow selects the model with the lowest RMSE on the latest chronological holdout, then refits that family on all observations. The validation fraction counts observation rows; repeated cycle indices are kept together and therefore cannot straddle the chronological split. Lowest training RMSE remains available only as an explicit in-sample diagnostic. Unsupported threshold crossings return no estimate, and bootstrap intervals are withheld whenever a replicate falls outside the bounded projection horizon or fails to fit.
This is an empirical research and educational baseline, not an electrochemical, pack-safety, or production BMS model. The bundled data are synthetic. Engineering conclusions require representative laboratory data and explicit consideration of chemistry, protocol, temperature, time metadata, and uncertainty. The residual bootstrap is conditional on the selected empirical model and assumes exchangeable, constant-variance residuals. It does not cover model-form error, protocol shifts, serial or cycle-dependent residual structure, or unrecorded measurement uncertainty.