How chueh-ermon/battery-fast-charging-optimization works
Project type and purpose
• This is a Python-based research codebase for closed-loop experimental design and machine-learning-driven optimization of fast-charging protocols for lithium-ion batteries.
• It provides command-line scripts to (a) enumerate protocol (“policy”) spaces, (b) simulate battery lifetimes under a given protocol, (c) run closed-loop optimization (CLO) to propose the next round of experiments, and (d) generate all figures for the associated paper.
File structure
Top-level components:
• policies.py – Defines/generates the policy space
• sim_with_seed.py – Stochastic lifetime simulator
• closed_loop_oed.py – Main closed-loop optimization driver
• data/ – File-based datastore for experimental/simulation results
├─ batch/ – Proposed protocols per round
├─ bounds/ – Model uncertainty/bounds pickle files
└─ pred/ – Early predictions
• figures/ – All code and data to recreate paper figures
• README.md – Project overview and usage examples
• .gitignore – Excludes environment/build artifacts
Patterns & architecture choices:
– A CLI-driven, file-based pipeline.
– Scripts communicate by reading/writing CSVs and pickles under data/.
– A closed-loop control flow: define policies → simulate/observe → optimize → repeat.
– Separate “compute” (simulator, optimizer) from “visualization” (figures/).
README for additional insights
• Describes three core user workflows:
1. python policies.py (policy generation)
2. python sim_with_seed.py (simulation)
3. python closed_loop_oed.py (closed-loop optimization)
• All figure code lives in figures/, organized by paper figure and supplementary figures.
• Dependencies: Python 3.7, standard ML/data libs (NumPy, pandas, scikit-learn, matplotlib, etc.).