Code and Data for A generic battery cycling optimization framework with learned sampling and early stopping strategies
This folder contains the code and data for following paper:
Changyu Deng, Andrew Kim, and Wei Lu. "A generic battery-cycling optimization framework with learned sampling and early stopping strategies." Patterns (2022): 100531. Website PDF
Following softwares are used:
- COMSOL Multiphysics 5.5
- Matlab 2020b
- Python 3.7
- Optuna 2.6.0
- Ax 0.2.4 (including BoTorch 0.6.2)
Higher versions should work fine. Lower versions may be compatible.
-
processed_data: Processed experiment dataand generated simulation data.
- exp_dict.pkl: Experiment data file, generated by
preprocess_exp_data.py
. - sim_dict.pkl: Simulation data file, generated by
generate_sim_data.py
.
- exp_dict.pkl: Experiment data file, generated by
-
raw_data: Raw experiment data. Extracted from Fig. 5 of the paper Holistic calendar aging model parametrization concept for lifetime prediction of graphite/NMC lithium-ion cells . File names denote temperature, the number next to "x" denote state of charge (SOC).
-
result: Result files generated by main_exp.py, main_sim.py and main_sim_noprune.py (in current root folder).
- sim_*.db: result file from main_sim.py
- exp_*.db: result file from main_exp.py
- sim_noprune_*.db: result file from main_sim_noprune.py
- data.xlsx: summary of all results
-
preprocess_exp_data.py: The code to preprocess raw data. You'll get exp_dict.pkl (which is already uploaded in processed_data).
-
generate_sim_data.py: Generate simulation data. You'll get sim_dict.pkl (which is already uploaded processed_data).
-
calendar_aging_final.m: A matlab script to generate calendar_aging_final.mph.
-
comsol_api.m: A matlab script to calculate capacity, which serves as the interface bewtween python files (main_*.py) and the COMSOL file ( calendar_aging_final.mph).
-
main_exp.py: Run the fitting algorithm in the experiment case (Case 2).
-
main_sim.py: Run the fitting algorithm in the simulation case (Case 1).
-
postprocess.py: Postprocess result.
- Prepare with connet Python to MATLAB (which has connected to COMSOL server). You need to install MATLAB API for Python (see doc) and then
run
matlab.engine.shareEngine
on MATLAB. Other ways are also feasible, as long as Python can be connected to MATLAB. - [optional] Run generate_sim_data.py to generate sim_dict.pkl, or use the existing file.
- Run main_sim.py; you can add or change arguments of the script; see the file for argument meanings.
- Run main_bo.py and main_sim_noprune.py.
- [optional] Run postprocess.py.
- [optional] Run preprocess_exp_data.py to generate exp_dict.pkl, or use the existing file.
- Prepare with connet Python to MATLAB (which has connected to COMSOL server).
- Run main_exp.py; you can add or change arguments of the script; see the file for argument meanings.
- [optional] Run postprocess.py.