This work is licensed under a Creative Commons Attribution 4.0 International License.
SPPy © 2023 by Moin Ahmed is licensed under Attribution-NonCommercial 4.0 International. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0
Created by Moin Ahmed (moinahmed100@gmail.com)
This repository contains the code for running equivalent circuit model (ECM), single particle model (SPM), single particle model with electrolyte dynamics (eSPM) with thermal and degradation models on Lithium-ion Batteries (LIB). Moreover, the repository contains the tools for visualization, model parameter estimations (e.g., using genetic algorithm), and Kalman filters (using Sigma Point Kalman Filter).
All the code is written in Python programming language, and it is written in a modular fashion. The code is still an ongoing work and the documentation is not yet complete.
The [documentation](https://libsim.readthedocs.io/en/latest/) is available and currently hosted on readthedocs.io.- Single Particle Model with electrolyte dynamics, Single Particle Model (SPM) and Equivalent circuit model with
thermal (lumped thermal) and degradation (reduced-order SEI) models

- Parameter estimation using genetic algorithm

- Visualization tools
- Sigma Point Kalman Filter (for analyzing application' battery management system (BMS))
If you are using the code and results in your code, please cite the following publication into your work.
Ahmed, M., Mao, Z., Liu, Y., Yu, A., Fowler, M., & Chen, Z. (2024). Comparative Analysis of Computational Times of Lithium-Ion Battery Management Solvers and Battery Models Under Different Programming Languages and Computing Architectures. Batteries, 10(12), 439. https://doi.org/10.3390/batteries10120439
- Python 3.10 and above
- numpy
- pandas
- matplotlib
- scipy
- tqdm
- pytests
Either of the two recommended installation procedures can be used and the steps for these installation procedures are listed below.
-
Install external python package dependencies required for this repository. Use the following code
pip install -r requirements.txt -
Clone the repository, for example using git clone git@github.com:m0in92/EV_sim.git using Git Bash.
- Download or clone this repository
- Ensure you are on the repository directory (where the setup.py resides) and run python setup.py sdist on the command line.
- Step 2 will create a dist directory in the repository. Extract the contents tar.gz file in this directory. Move to the directory where the extracted files reside and run pip install EV_sim on the command line. This will install EV_sim on your system (along with the external dependencies) and EV_sim can be imported as any other Python package.
- The unittests on the repository can be performed by running the code below on the command line at the root project
directory.
pytests tests
Example usage are included in the SPPy/examples folder.
parameter_sets - the datasets containing the parameters for the simulations.
Assests - the images used in the documentations.
SPPy - the source code. Some of the subdirectories include:
examples- the example usage under various simulation conditions.battery_components- classes for reading and storing battery cell component (e.g., electrode, electrolyte) parametersmodels- classes with methods pertaining to battery, thermal, and degradation modelssolvers- numerical and simulation solversvisualization- visualization related classes
tests - test files for this repository
- Crank-Nicolson Method
- Eigen Function Expansion [1]
- Two Term Polynomial [2]
- Finite Volume Method (FVM)
- ODE solvers (rk4)
- Crank-Nicolson Method
- Eigen Function Expansion [1]
- Two Term Polynomial [2]
- ODE solvers (rk4)
- Discrete Time Solver
- Discrete Time Solver with Sigma Point Kalman Filter
- Lumped Thermal Model
- ODE solvers (rk4)
- ROM - SEI growth [3]
- ODE solvers (Euler)
- Guo, M., Sikha, G., & White, R. E. (2011). Single-Particle Model for a Lithium-Ion Cell: Thermal Behavior. Journal of The Electrochemical Society, 158(2), A122. https://doi.org/10.1149/1.3521314/XML
- Torchio, M., Magni, L., Gopaluni, R. B., Braatz, R. D., & Raimondo, D. M. (2016). LIONSIMBA: A Matlab Framework Based on a Finite Volume Model Suitable for Li-Ion Battery Design, Simulation, and Control. Journal of The Electrochemical Society, 163(7), A1192–A1205. https://doi.org/10.1149/2.0291607JES/XML
- Randall, A. v., Perkins, R. D., Zhang, X., & Plett, G. L. (2012). Controls oriented reduced order modeling of solid-electrolyte interphase layer growth. Journal of Power Sources, 209, 282–288. https://doi.org/10.1016/J.JPOWSOUR.2012.02.114



