Skip to main content

BATMODS-lite

ci   license   codecov   pypi  

Summary

Battery Analysis and Training Models for Optimization and Design Studies (BATMODS) is a Python package with an API for pre-built battery models. The original purpose of the package was to quickly generate synthetic data for machine learning models to train with. However, the models are generally useful for any battery simulations or analysis. BATMODS-lite includes the following:

  1. A library and API for pre-built battery models
  2. Kinetic/transport properties for common battery materials

Note that the package focuses on phsics-based models like the single-particle (SPM) and pseudo-2D (P2D) model. If you enjoy the interface but are looking to run equivalent circuit models (ECMs), you should check out thevenin, which is distributed separately, but is developed and maintained by the same team. Consequently, the interface to thevenin models is intentionally similar, allowing for a smooth transition between physics-based and ECM approaches.

Installation

BATMODS-lite can be installed from PyPI using the following command:

pip install batmods-lite

If you run into issues with installation due to the scikit-sundae dependency, please submit an issue here. We also manage this solver package, but distribute it separately since it is not developed in pure Python.

For those interested in setting up a developer and/or editable version of this software, please see the directions available in the "Development" section of our documentation.

Get Started

The API is organized around three main classes that allow you to construct simulations, define experiments, and interact with solutions. Two basic examples are given below. These demonstrate a 2C discharge for both the single particle model (SPM) and pseudo-2D (P2D) model. Note that the experiment class interfaces with all simulations. The simulations and their respective solutions, however, will depend on the model subpackage they are loaded from. For more detailed examples, check out the documentation on Read the Docs. Note that while the full name of the package is batmods-lite, the installed module is imported using bmlite.

# Single particle model example
import bmlite as bm

sim = bm.SPM.Simulation()

expr = bm.Experiment()
expr.add_step('current_C', 2., (1350., 10.))

soln = sim.run(expr)
soln.simple_plot('time_s', 'voltage_V')
# Pseudo-2D model example
import bmlite as bm

sim = bm.P2D.Simulation()

expr = bm.Experiment()
expr.add_step('current_C', 2., (1350., 10.))

soln = sim.run(expr)
soln.simple_plot('time_s', 'voltage_V')

Notes:

  • If you are new to Python, check out Spyder IDE. Spyder is a powerful interactive development environment (IDE) that can make programming in Python more approachable to new users.
  • Another friendly option for getting started in Python is to use Jupyter Notebooks. We write our examples in Jupyter Notebooks since they support both markdown blocks for explanations and executable code blocks.
  • Python, Spyder, and Jupyter Notebooks can be setup using Anaconda. Anaconda provides a convenient way for new users to get started with Python due to its friendly graphical installer and environment manager.

Citing this Work

This work was authored by researchers at the National Laboratory of the Rockies (NLR). If you use this package in your work, please include the following citation:

Randall, Corey R. "BATMODS-lite: Packaged battery models and material properties [SWR-25-108]." Computer software, Jun. 2025. url: github.com/NatLabRockies/batmods-lite. doi: 10.11578/dc.20260114.1.

For convenience, we also provide the following for your BibTex:

@misc{randall2025bmlite,
  author = {Randall, Corey R.},
  title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
  url = {github.com/NatLabRockies/batmods-lite},
  month = {Jun.},
  year = {2025},
  doi = {10.11578/dc.20260114.1},
}

Contributing

If you'd like to contribute to this package, please look through the existing issues. If the bug you've caught or the feature you'd like to add isn't already being worked on, please submit a new issue before getting started.

Disclaimer

This work was authored by the National Laboratory of the Rockies (NLR), operated by Alliance for Energy Innovation, LLC, for the U.S. Department of Energy (DOE). The views expressed in the repository do not necessarily represent the views of the DOE or the U.S. Government.

Metadata

Release files for batmods-lite 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for batmods-lite 0.0.2
File Size Uploaded
batmods_lite-0.0.2.tar.gz 73.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for batmods-lite 0.0.2
File Interpreter ABI Platform
batmods_lite-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 169.1 kB

Release files / batmods_lite-0.0.2.tar.gz

Download URL batmods_lite-0.0.2.tar.gz
Size 73.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c05bb78c445eb097470cc879f0e69e9b7d9cfdf34776de7d7baa1bdf508404b9
BLAKE2b-256 checksum
How to use checksums
296df968917651c34b3149b15c7ebfbb39858cbfe25ef1acb796cd803934fa6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / batmods_lite-0.0.2-py3-none-any.whl

Download URL batmods_lite-0.0.2-py3-none-any.whl
Size 95.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e08e8222116f01fd32d0d6fee249945dde30f8dcf3d03363f15851673c51f1e
BLAKE2b-256 checksum
How to use checksums
7f44dbfd9e334e5f0e585fb351c103f0a73d7e82e159f9c001f951afca7ed538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page