Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyBaMM_logo

Powered by NumFOCUS Scheduled readthedocs codecov Open In Colab DOI release code style

All Contributors

PyBaMM

PyBaMM (Python Battery Mathematical Modelling) is an open-source battery simulation package written in Python. Our mission is to accelerate battery modelling research by providing open-source tools for multi-institutional, interdisciplinary collaboration. Broadly, PyBaMM consists of (i) a framework for writing and solving systems of differential equations, (ii) a library of battery models and parameters, and (iii) specialized tools for simulating battery-specific experiments and visualizing the results. Together, these enable flexible model definitions and fast battery simulations, allowing users to explore the effect of different battery designs and modeling assumptions under a variety of operating scenarios.

PyBaMM uses an open governance model and is fiscally sponsored by NumFOCUS. Consider making a tax-deductible donation to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.


💻 Using PyBaMM

The easiest way to use PyBaMM is to run a 1C constant-current discharge with a model of your choice with all the default settings:

import pybamm

model = pybamm.lithium_ion.DFN()  # Doyle-Fuller-Newman model
sim = pybamm.Simulation(model)
sim.solve([0, 3600])  # solve for 1 hour
sim.plot()

or simulate an experiment such as a constant-current discharge followed by a constant-current-constant-voltage charge:

import pybamm

experiment = pybamm.Experiment(
    [
        (
            "Discharge at C/10 for 10 hours or until 3.3 V",
            "Rest for 1 hour",
            "Charge at 1 A until 4.1 V",
            "Hold at 4.1 V until 50 mA",
            "Rest for 1 hour",
        )
    ]
    * 3,
)
model = pybamm.lithium_ion.DFN()
sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.CasadiSolver())
sim.solve()
sim.plot()

However, much greater customisation is available. It is possible to change the physics, parameter values, geometry, submesh type, number of submesh points, methods for spatial discretisation and solver for integration (see DFN script or notebook).

For new users we recommend the Getting Started guides. These are intended to be very simple step-by-step guides to show the basic functionality of PyBaMM, and can either be downloaded and used locally, or used online through Google Colab.

Further details can be found in a number of detailed examples, hosted here on github. In addition, there is a full API documentation, hosted on Read The Docs. Additional supporting material can be found here.

Note that the examples on the default develop branch are tested on the latest develop commit. This may sometimes cause errors when running the examples on the pybamm pip package, which is synced to the main branch. You can switch to the main branch on github to see the version of the examples that is compatible with the latest pip release.

Versioning

PyBaMM makes releases every four months and we use CalVer, which means that the version number is YY.MM. The releases happen, approximately, at the end of January, May and September. There is no difference between releases that increment the year and releases that increment the month; in particular, releases that increment the month may introduce breaking changes. Breaking changes for each release are communicated via the CHANGELOG, and come with deprecation warnings or errors that are kept for at least one year (3 releases). If you find a breaking change that is not documented, or think it should be undone, please open an issue on GitHub.

🚀 Installing PyBaMM

PyBaMM is available on GNU/Linux, MacOS and Windows. We strongly recommend to install PyBaMM within a python virtual environment, in order not to alter any distribution python files. For instructions on how to create a virtual environment for PyBaMM, see the documentation.

Using pip

pypi downloads

pip install pybamm

Using conda

PyBaMM is available as a conda package through the conda-forge channel.

conda_forge downloads

conda install -c conda-forge pybamm

Optional solvers

The following solvers are optionally available:

📖 Citing PyBaMM

If you use PyBaMM in your work, please cite our paper

Sulzer, V., Marquis, S. G., Timms, R., Robinson, M., & Chapman, S. J. (2021). Python Battery Mathematical Modelling (PyBaMM). Journal of Open Research Software, 9(1).

You can use the BibTeX

@article{Sulzer2021,
  title = {{Python Battery Mathematical Modelling (PyBaMM)}},
  author = {Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon},
  doi = {10.5334/jors.309},
  journal = {Journal of Open Research Software},
  publisher = {Software Sustainability Institute},
  volume = {9},
  number = {1},
  pages = {14},
  year = {2021}
}

We would be grateful if you could also cite the relevant papers. These will change depending on what models and solvers you use. To find out which papers you should cite, add the line

pybamm.print_citations()

to the end of your script. This will print BibTeX information to the terminal; passing a filename to print_citations will print the BibTeX information to the specified file instead. A list of all citations can also be found in the citations file. In particular, PyBaMM relies heavily on CasADi. See CONTRIBUTING.md for information on how to add your own citations when you contribute.

🛠️ Contributing to PyBaMM

If you'd like to help us develop PyBaMM by adding new methods, writing documentation, or fixing embarrassing bugs, please have a look at these guidelines first.

📫 Get in touch

For any questions, comments, suggestions or bug reports, please see the contact page.

📃 License

PyBaMM is fully open source. For more information about its license, see LICENSE.

✨ Contributors

This project follows the all-contributors specification. Contributions of any kind are welcome!

Click here to see a full list of our contributors' profiles.

Metadata

Release files for pybamm 24.5rc2

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

Source distribution (sdist)

Source distribution for pybamm 24.5rc2
File Size Uploaded
pybamm-24.5rc2.tar.gz 575.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pybamm 24.5rc2
File
pybamm-24.5rc2-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pybamm-24.5rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pybamm-24.5rc2-cp312-cp312-macosx_11_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 11.0+ x86-64 Details
pybamm-24.5rc2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pybamm-24.5rc2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pybamm-24.5rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pybamm-24.5rc2-cp311-cp311-macosx_11_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 11.0+ x86-64 Details
pybamm-24.5rc2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pybamm-24.5rc2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pybamm-24.5rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pybamm-24.5rc2-cp310-cp310-macosx_11_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 11.0+ x86-64 Details
pybamm-24.5rc2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
pybamm-24.5rc2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pybamm-24.5rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pybamm-24.5rc2-cp39-cp39-macosx_11_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 11.0+ x86-64 Details
pybamm-24.5rc2-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details

Total release size: 131.7 MB

Release files / pybamm-24.5rc2.tar.gz

Download URL pybamm-24.5rc2.tar.gz
Size 575.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6021d7bbbe78d1871009306a32fef37c0641691806f3e306584bfb2800e4b44e
BLAKE2b-256 checksum
How to use checksums
5ce87f9eb0b282a5c7c5c832b9331752645791d231c5d94a1f5c8ec4851b6e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp312-cp312-win_amd64.whl

Download URL pybamm-24.5rc2-cp312-cp312-win_amd64.whl
Size 2.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
e6fbd944626682da361701f340f465fc43e01e1207711a3e62baf42cea0c3fa2
BLAKE2b-256 checksum
How to use checksums
97d59ae7c786ef1e15fdf20a49ea4a1ab374dee5c900f2c147ead096a45fc9a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pybamm-24.5rc2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
24395b3a3ecde43c3cfa8c4e89dd92f95949ad6489eac99d5178e8e1841255de
BLAKE2b-256 checksum
How to use checksums
5e5d85544dc16915205595eed41e223fba9348f7446042fe83d51255d78868d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp312-cp312-macosx_11_0_x86_64.whl

Download URL pybamm-24.5rc2-cp312-cp312-macosx_11_0_x86_64.whl
Size 7.7 MB
Tags CPython 3.12 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
9a205b2dc54f8885ad5848203370e4e825825ffee8e24a7d500ea511b6be436b
BLAKE2b-256 checksum
How to use checksums
267802e41c243cdfd630a7023bfe537b0dd2d5c8e96ed7adf2e7ea5ee3f547e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp312-cp312-macosx_11_0_arm64.whl

Download URL pybamm-24.5rc2-cp312-cp312-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
22dda72fbb7830a33c1b5208f20863fd38f08fbad5f74d38eed27f33df9f9c1d
BLAKE2b-256 checksum
How to use checksums
b8aa9c0962126e1992a5b570f8fabf6c40efa4870b70d241a9d68d25d43dd2cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp311-cp311-win_amd64.whl

Download URL pybamm-24.5rc2-cp311-cp311-win_amd64.whl
Size 2.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
afa36232f2b45ab9d31cfcc96839e892a1a19e7e66d265e10a223363b687b730
BLAKE2b-256 checksum
How to use checksums
64c89a9810511796500e0d06ae94c37d5f20844e0fd4702d9d4f492f3ab2bc37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pybamm-24.5rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a6f0e6104e48d71c98e0ce0216ea06e84a09b8a2cf2c12b8d4c08edd6d6e266a
BLAKE2b-256 checksum
How to use checksums
4a7c320d4820f8f32e2b908a733415dd34884993bace7724ee017a29c608ee48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp311-cp311-macosx_11_0_x86_64.whl

Download URL pybamm-24.5rc2-cp311-cp311-macosx_11_0_x86_64.whl
Size 7.7 MB
Tags CPython 3.11 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
d1c2ca268d9035b96868f5d0f2760495dd69e49ef5175a9ccccf0cead5b5d414
BLAKE2b-256 checksum
How to use checksums
9037f978d9baf9bde56eb006c0d5f88e7609cd9b49adc453923b612869eb117b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp311-cp311-macosx_11_0_arm64.whl

Download URL pybamm-24.5rc2-cp311-cp311-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1efe151f283f6d9f6de32959830ca063556849fe334205aaaf1d658577076ff4
BLAKE2b-256 checksum
How to use checksums
f5e3864c2ed0e286aeb1ad79856f07f1e9aa94f3a89878c6d9808ddcb5d86bb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp310-cp310-win_amd64.whl

Download URL pybamm-24.5rc2-cp310-cp310-win_amd64.whl
Size 2.6 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
fc1e62954aba741821c1a20bb6fa99efd64e7e84083b84db0c00f3f6b37c2f39
BLAKE2b-256 checksum
How to use checksums
c7b79860de2e25b584f30f13256673eccbba6a32c714765bd00deb2a7da34855
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pybamm-24.5rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.5 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8926c3672f8d6b9c9b1a000e51206322bd28ea1428e07f801c37170633f8263f
BLAKE2b-256 checksum
How to use checksums
fafc70454b5a91c3c793e0dfa7b1cd6e891197e3a86c938a61154700d571425f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp310-cp310-macosx_11_0_x86_64.whl

Download URL pybamm-24.5rc2-cp310-cp310-macosx_11_0_x86_64.whl
Size 7.7 MB
Tags CPython 3.10 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
1325d1b79593b027b5e6f2230512da5c716bd0e66bf9628d0ee269de7bd82261
BLAKE2b-256 checksum
How to use checksums
81320cbaef45157a759624d024dd68feb6ca5ce934a5c3b1f0866ddcfaf616e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp310-cp310-macosx_11_0_arm64.whl

Download URL pybamm-24.5rc2-cp310-cp310-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9d7da839734d6f7d861431f3c977c3fbdcf48aed19bf7d4d61903fd5d7b7c3d4
BLAKE2b-256 checksum
How to use checksums
534d506688c46f8daaf187681d484a9711e84a6a052edd93713fb76419c98538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp39-cp39-win_amd64.whl

Download URL pybamm-24.5rc2-cp39-cp39-win_amd64.whl
Size 2.6 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e0a66cbad78223421faa20330244396e5d577b245e63721038188c764fd6e721
BLAKE2b-256 checksum
How to use checksums
674af92196fdaeb22b7daaede075e210f80f9a43a6adc62786cce7ca9474d38c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pybamm-24.5rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 16.5 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8e63026a1c60ea47fcd4fce12f0928f681f0fb8ed2d379291d7f7e5fa95e150d
BLAKE2b-256 checksum
How to use checksums
a670dd11b4ae4ffcfdf9c64483104736b2af1c9fe0841f3f7c1f083cfda3570e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp39-cp39-macosx_11_0_x86_64.whl

Download URL pybamm-24.5rc2-cp39-cp39-macosx_11_0_x86_64.whl
Size 7.7 MB
Tags CPython 3.9 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
747fa51ddac0a03670120e7c024eb74a41bb43500dbf07df99d8ef69d7c1c499
BLAKE2b-256 checksum
How to use checksums
760100f7de0a898df59a8d4da68e90f5255092a477dd3f63ab928b55c2d298bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / pybamm-24.5rc2-cp39-cp39-macosx_11_0_arm64.whl

Download URL pybamm-24.5rc2-cp39-cp39-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
779b254d2a22373dfd2dd7d10672d00f7709d4544896bc6573caccadc5daf4f5
BLAKE2b-256 checksum
How to use checksums
8240391b7d99c2ec0787fc4c2f8faf881f16df40bb4d79a27de6ae7832ec4b26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

26.5.0

2 release files

26.4.4

2 release files

26.4.3

2 release files

26.4.1

2 release files

26.4.0

2 release files

26.3.1

2 release files

26.3.0

2 release files

25.6.0

2 release files

25.4.2

2 release files

25.4.1

2 release files

25.1.1

2 release files

25.1.0

2 release files

24.5

17 release files

This release

24.5rc2 This release

17 release files

24.1

16 release files

23.9

15 release files

23.5

19 release files

23.4

9 release files

23.3

9 release files

23.2

9 release files

23.1

9 release files

22.12

9 release files

22.11

9 release files

22.10

9 release files

22.9

13 release files

22.8

13 release files

22.7

13 release files

22.6

13 release files

22.5

13 release files

22.4

1 release file

22.3

14 release files

22.2

18 release files

22.1

18 release files

21.12

18 release files

21.11

19 release files

21.9

19 release files

0.4.0

17 release files

0.3.0

7 release files

0.2.4

6 release files

0.2.3

6 release files

0.2.2

3 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

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