skillfed

pybamm

Python Battery Mathematical Modelling

pybamm v26.7.1.0 106.1K downloads/30d#12,667 on PyPI1,642
Permissive license Copyright (c) 2018, the PyBaMM team. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are… (full text in the JSON record) Active released

What it is and what it does

PyBaMM (Python Battery Mathematical Modelling) is an open-source framework for simulating battery electrochemistry by solving differential equations. It combines a general-purpose solver framework with a library of pre-built battery models (such as the Doyle-Fuller-Newman model), parameter sets, and experiment definitions. Users can run simple constant-current discharge simulations with default settings or define complex multi-step experiments (discharge, rest, charge cycles) with custom physics, geometry, discretization methods, and solver parameters.

The package is designed for battery research and development, enabling exploration of how design choices and modeling assumptions affect performance under different operating scenarios. It depends on scientific Python libraries (numpy, scipy, sympy, pandas, xarray) for computation and visualization, and includes optional support for JAX-based solvers. The project is actively maintained, fiscally sponsored by NumFOCUS, and follows a CalVer versioning scheme with documented breaking-change policies.

Use it for:

  • Simulate constant-current discharge profiles for lithium-ion cells to predict capacity and voltage curves.
  • Model complex multi-step charge/discharge experiments (e.g., CCCV charging) to validate battery management strategies.
  • Explore the effect of parameter changes (electrode thickness, porosity, conductivity) on battery performance without physical prototyping.
  • Develop and test custom battery models by writing differential equations within the PyBaMM framework.
  • Generate publication-ready plots and data exports for battery performance analysis and research papers.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyBaMM is a Python framework for simulating battery behavior by solving systems of differential equations, providing pre-built battery models, parameters, and tools for running battery-specific experiments and visualizing results.

Yes. PyBaMM is a mature, actively maintained framework (Production/Stable status, recent release) with low installation friction, permissive licensing, and no known vulnerabilities. Install it if you need to simulate battery electrochemistry, validate battery designs computationally, or conduct battery modeling research. The large dependency tree (13 runtime packages) is standard for scientific Python and poses no unusual risk.

Install

pybamm on PyPI

pip

pip install pybamm

uv

uv add pybamm

poetry

poetry add pybamm

Installing pybamm

Before you install

Low friction installation via pip or conda-forge. Active maintenance with a recent release (23 days ago) and ongoing repository activity. Supports modern Python versions (3.10–3.14) and has 13 runtime dependencies including standard scientific libraries.

License in practice

BSD license (permissive). You may use, modify, and distribute PyBaMM freely in proprietary or open-source projects, provided you retain the copyright notice and disclaimer.

Quickstart

pip install pybamm

import pybamm
model = pybamm.lithium_ion.DFN()
sim = pybamm.Simulation(model)
sim.solve([0, 3600])
sim.plot()

Verify before relying

  • Whether the package requires external solvers (e.g., CasADi) to be installed separately for full functionality.
  • Performance characteristics and scalability limits for large-scale battery simulations.
  • Availability and maturity of optional JAX-based solver on Python 3.11+.

Package facts

License Copyright (c) 2018, the PyBaMM team. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are… (full text in the JSON record) (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 13 — anytree, black, numpy, pandas, platformdirs, pooch, posthog, pybammsolvers, pyyaml, scipy, sympy, typing-extensions, xarray
Maintenance actively maintained — 23 days since the last release
Last repo commit
First released
Downloads 106,144/month — #12,667 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pybamm-26.7.1.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering

Tags

battery simulation pythonelectrochemical modelinglithium ion battery modelbattery discharge simulationmathematical battery modeling
battery-simulationelectrochemistryscientific-computing

More Scientific/Engineering packages