This Project belongs to Nanchang Innovation Institute, Peking University.
The code was developed by P.H. Zhang (2024).
Accurately predicting the temperature fluctuations of lithium-ion batteries has become a crucial challenge in enhancing battery performance and ensuring the safety of electric vehicles. The temperature of lithium-ion batteries are influenced by lots of factors, such as material, charge-discharge and environment. We aims to design AI algorithm to predict the temperature fluctuations under given conditions.
Traditional methods use simulation software to solve the thermodynamic equation. However, simulation software are slow, cumbersome, and having high learning threshold. A new approach is to use neural networks as surrogation of simulation software, which has high computational efficiency, significantly reduce time costs.
We trained GAT-LSTM as AI surrogate model to solve the problem.
This github repository contains the precedent work for paper: The Lithium-Ion Battery Temperature Field Prediction Model Based on CNN-Bi-LSTM-AM doi.org/10.3390/su17052125
- Battery: Lithium-ion battery package composed of several battery cells.
- Datasets: Use ESCAAS to do thermal simulation to make datasets.
- AI model: (./model) GAT-LSTM network, which can simultaneously observe and neatly integrate temporal and spatial information.
Files structure is as follows:
├── model # AI model
├── GL_set.py # Model configuration file
├── graph_edge_index.py # Build graph from point cloud coordinates.
├── data_id_shuffle.py # Shuffle the datasets
├── data_process.py # Preprocess the datasets
├── GL_model.py # Model structure
├── training.py # Train AI model
├── training_v2.py # Train AI model (memory friendly)
├── testing_1.py # Test AI model for one time step
├── testing_2.py # Test AI model for all time steps
└── ...
└── readme.md # This file
- Model the lithium-ion battery package.
- Define sets of current curves and boundary conditions.
- For each set, use thermal simulation software to calculate the temperature field.
The lithium-ion battery package is as follows. 1 battery package contains 36 battery cells.
After mesh the battery package, we get 742,826 nodes and 3,013,738 elements.
We use ESCAAS as the thermal simulation tool: escaas.com.cn.
The temperature fluctuations of lithium-ion batteries follow the thermodynamic equation.
Due to confidentiality requirements, the download permission is restricted.
Download dataset here (restricted). If you are not from Peking University, you cannot visit Peking University Disk.
Input:
In the dataset, the initial temperature of battery is a constant value.
Define
In this project,
Output:
The output is an
We combine Graph Attention Network (GAT) with Long Short-Term Memory (LSTM) to build our AI model. The GAT is responsible for capturing the spatial information while LSTM is reponsible for capturing the temporal information. GAT-LSTM network can observe both temporal and spatial information simultaneously and neatly integrate the information together.
The structure of GAT-LSTM network is as follows. The detailed code is available in ./model.
We set sliding window to process temporal data. The length of sliding window is
Establish python environment.
conda create --name py312 python=3.12
conda activate py312
Download the datasets (if permitted).
Do settings in ./model/GL_set.py.
Build graph from point cloud coordinates. Run the bash code to get edge_index.csv at save_path.
cd model/
python graph_edge_index.py
Then preprocess the dataset. Run the bash code to get shuffle_id.csv at save_path and he preprocessed data.
python data_id_shuffle.py
nohup python data_process.py &
Train AI model.
nohup python training.py &
Test AI model.
python testing_1.py
This code is provided for educational and research purposes.