Skip to main content

Python Battery Mathematical Modelling.

Project description

PyBaMM_logo

Build readthedocs codecov Open In Colab DOI release black code style

All Contributors

PyBaMM

PyBaMM (Python Battery Mathematical Modelling) solves physics-based electrochemical DAE models by using state-of-the-art automatic differentiation and numerical solvers. The Doyle-Fuller-Newman model can be solved in under 0.1 seconds, while the reduced-order Single Particle Model and Single Particle Model with electrolyte can be solved in just a few milliseconds. Additional physics can easily be included such as thermal effects, fast particle diffusion, 3D effects, and more. All models are implemented in a flexible manner, and a wide range of models and parameter sets (NCA, NMC, LiCoO2, ...) are available. There is also functionality to simulate any set of experimental instructions, such as CCCV or GITT, or specify drive cycles.

๐Ÿ’ป 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 CCCV:

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.

๐Ÿš€ 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

Following GNU/Linux and macOS 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

Thanks goes to these wonderful people (emoji key):


Valentin Sulzer

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿšง ๐Ÿ‘€ โš ๏ธ โœ… ๐Ÿ“

Robert Timms

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿšง ๐Ÿ‘€ โš ๏ธ โœ…

Scott Marquis

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿšง ๐Ÿ‘€ โš ๏ธ โœ…

Martin Robinson

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿ‘€ โš ๏ธ โœ…

Ferran Brosa Planella

๐Ÿ‘€ ๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿšง โš ๏ธ โœ… ๐Ÿ“

Tom Tranter

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿ‘€ โš ๏ธ โœ…

Thibault Lestang

๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿ‘€ โš ๏ธ ๐Ÿš‡

Diego

๐Ÿ› ๐Ÿ‘€ ๐Ÿ’ป ๐Ÿš‡

felipe-salinas

๐Ÿ’ป โš ๏ธ

suhaklee

๐Ÿ’ป โš ๏ธ

viviantran27

๐Ÿ’ป โš ๏ธ

gyouhoc

๐Ÿ› ๐Ÿ’ป โš ๏ธ

Yannick Kuhn

๐Ÿ’ป โš ๏ธ

Jacqueline Edge

๐Ÿค” ๐Ÿ“‹ ๐Ÿ”

Fergus Cooper

๐Ÿ’ป โš ๏ธ

jonchapman1

๐Ÿค” ๐Ÿ”

Colin Please

๐Ÿค” ๐Ÿ”

cwmonroe

๐Ÿค” ๐Ÿ”

Greg

๐Ÿค” ๐Ÿ”

Faraday Institution

๐Ÿ’ต

Alexander Bessman

๐Ÿ› ๐Ÿ’ก

dalbamont

๐Ÿ’ป

Anand Mohan Yadav

๐Ÿ“–

WEILONG AI

๐Ÿ’ป ๐Ÿ’ก โš ๏ธ

lonnbornj

๐Ÿ’ป โš ๏ธ ๐Ÿ’ก

Priyanshu Agarwal

โš ๏ธ ๐Ÿ’ป ๐Ÿ› ๐Ÿ‘€ ๐Ÿšง โœ…

DrSOKane

๐Ÿ’ป ๐Ÿ’ก ๐Ÿ“– โš ๏ธ โœ…

Saransh Chopra

๐Ÿ’ป โš ๏ธ ๐Ÿ“– โœ… ๐Ÿ‘€ ๐Ÿšง

David Straub

๐Ÿ› ๐Ÿ’ป

maurosgroi

๐Ÿค”

Amarjit Singh Gaba

๐Ÿ’ป

KennethNwanoro

๐Ÿ’ป โš ๏ธ

Ali Hussain Umar Bhatti

๐Ÿ’ป โš ๏ธ

Leshinka Molel

๐Ÿ’ป ๐Ÿค”

tobykirk

๐Ÿค” ๐Ÿ’ป โš ๏ธ โœ…

Chuck Liu

๐Ÿ› ๐Ÿ’ป

partben

๐Ÿ“–

Gavin Wiggins

๐Ÿ› ๐Ÿ’ป

Dion Wilde

๐Ÿ› ๐Ÿ’ป

Elias Hohl

๐Ÿ’ป

KAschad

๐Ÿ›

Vaibhav-Chopra-GT

๐Ÿ’ป

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

Project details


Release history Release notifications | RSS feed

This version

22.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybamm-22.5.tar.gz (916.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pybamm-22.5-cp39-cp39-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.9Windows x86-64

pybamm-22.5-cp39-cp39-manylinux2010_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

pybamm-22.5-cp39-cp39-manylinux2010_i686.whl (5.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ i686

pybamm-22.5-cp39-cp39-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pybamm-22.5-cp38-cp38-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.8Windows x86-64

pybamm-22.5-cp38-cp38-manylinux2010_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

pybamm-22.5-cp38-cp38-manylinux2010_i686.whl (5.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ i686

pybamm-22.5-cp38-cp38-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pybamm-22.5-cp37-cp37m-win_amd64.whl (2.5 MB view details)

Uploaded CPython 3.7mWindows x86-64

pybamm-22.5-cp37-cp37m-manylinux2010_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

pybamm-22.5-cp37-cp37m-manylinux2010_i686.whl (5.0 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ i686

pybamm-22.5-cp37-cp37m-macosx_10_9_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

Details for the file pybamm-22.5.tar.gz.

File metadata

  • Download URL: pybamm-22.5.tar.gz
  • Upload date:
  • Size: 916.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5.tar.gz
Algorithm Hash digest
SHA256 5a9cfeeafe74eee9778dbba603e075df1c764dbac8f28edf7c19fd9ab2c48e5d
MD5 e40b5200e54982af2ba72b4269cc9333
BLAKE2b-256 ff904b17497a99e3b913900fc74ec41a4faaa5230616a4745797ddd90bcfd24e

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pybamm-22.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 938e9a810489034bedd9c9a98341baa4c186ed3c51a877757481ad90e5f56e4d
MD5 ddd4937e5db4a642bcd60ca0bbd54a4e
BLAKE2b-256 53bd46382fe94f0a376c5f805d15c697e31cb5ba4e5a38e3f0220ae8acacd9ab

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pybamm-22.5-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a1465098d99ac6d8a72dc2bacda77ec932492cdaf13a27634048c7032935433b
MD5 d5e3e3e516170cfe46164f459676c5d9
BLAKE2b-256 09945f9ad9fe0cf485f0445e603c1368726c62bb2731f7760e879686532dd0b9

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp39-cp39-manylinux2010_i686.whl.

File metadata

  • Download URL: pybamm-22.5-cp39-cp39-manylinux2010_i686.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5-cp39-cp39-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 c39e2575dce096a9bef20319acce984d9088c60160c1f6418bb058439ba229c0
MD5 fff829c110cb83a794298a1c79218505
BLAKE2b-256 d3647df63cc7e8a2b26b56775d1801c52e373e0b1a74dd1c5635bfdb4ee3e47a

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybamm-22.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c4435181ecda1ab92b494f171ac3e3c6883faa67ac120dfbba8daba7eceae759
MD5 8aac4411cf6bf379f4cdf61ef9cc38c7
BLAKE2b-256 5be5b4a770e44d0a80286833f181f0e4cfb4601d2290a217ceb61ec3f1f65167

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pybamm-22.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 fff9018fe01e9abfe039deaa1f5384c8f7f173663c91e408de9e4c60880b43df
MD5 45c8d60974cc0e4d9ae549ad8fe1fae2
BLAKE2b-256 31e302fd1942e74eaa9896d8b0b56a86f12b992e8039c0bd47b40356c48454e3

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pybamm-22.5-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 dd34a6057725be64a0f25cf91743cae5d439e6743dc80a5c386879ccd9d85bb8
MD5 6295ddac1f9f33d807aa4ca3637cee86
BLAKE2b-256 3efb3c67ae4ed6bb3438a44f0f33d471ab1b5d9f0c20ce2b60e979606099d56c

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp38-cp38-manylinux2010_i686.whl.

File metadata

  • Download URL: pybamm-22.5-cp38-cp38-manylinux2010_i686.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5-cp38-cp38-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 f03ba36f801178453d65c0659acb1ed461100cedf6d2da117cf3656c8b7fadcf
MD5 91a84e38ceb585b57a47fec0702fa2ab
BLAKE2b-256 8c50cc4640914d1db67f3701586047598d291a94c57a03f120c184bd53420595

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybamm-22.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c533eaf99f2f026e1b895569b6ebbb95ea775b47d3a75cb2bb1bc4b496c863f1
MD5 f59ea0af62846612bf9c8c82376fef22
BLAKE2b-256 18200b5f7a394a14703703b2cc2d4308a837e3650736bf304d5571f0fd1f6540

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pybamm-22.5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a20295cc3e0ca7c2ddea64c45df460609fedff1440a22b119db5db81dfe47c5c
MD5 162f3aa5cce512365a26b6447f0889c8
BLAKE2b-256 4e902264496474334efc29383bfd3c10041d08c1ab1d0c80e79f911741168f20

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pybamm-22.5-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 78a447e9e924a51c5d68bbdf162bf65c9de3d7d8843998e2871200357db81b6e
MD5 131c33c9506baa28bd5d32160f9420c8
BLAKE2b-256 bc0369cfc2c0a9dfe81b03ae0931d2c8de414f22ea96bba167322178ecacdb7a

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp37-cp37m-manylinux2010_i686.whl.

File metadata

  • Download URL: pybamm-22.5-cp37-cp37m-manylinux2010_i686.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.13

File hashes

Hashes for pybamm-22.5-cp37-cp37m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 9992e2ae61b8b1b3f44c8c5711a2c407986411e50ec916e9eb0254406f1409d3
MD5 08e49b6c5b66ba53e04a70a7bfc4f1cd
BLAKE2b-256 0621913266720456fe90fdd4e9a376e910eafc6ccc4f37915f591ffce0d36ed9

See more details on using hashes here.

File details

Details for the file pybamm-22.5-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pybamm-22.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dea22756ff5ba4048d909e326ea0297d80f2c8da8d087ce30aa9e037132d6789
MD5 16b7482c5e5aa3424f303a104b67eaa7
BLAKE2b-256 d41f92228d209af3f792fa558e2794db43739e67e7df44181085bb75e5ba261d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page