Skip to main content

PyBaMM EIS

PyBaMM EIS rapidly calculates the electrochemical impedance of any battery model defined using PyBaMM, see the documentation

🔋 Using PyBaMM EIS

The easiest way to use PyBaMM EIS is to compute the impedance of a model of your choice with the default parameters:

import pybammeis
import pybamm
import numpy as np

# DFN with capacitance
model = pybamm.lithium_ion.DFN(options={"surface form": "differential"})
eis_sim = pybammeis.EISSimulation(model)
# calculate impedance at log-spaced frequencies
eis_sim.solve(np.logspace(-4, 4, 30))
eis_sim.nyquist_plot()

💻 About PyBaMM

The example simulations use the package PyBaMM (Python Battery Mathematical Modelling). PyBaMM 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.

🚀 Installation

In order to run the notebooks in this repository you will need to install the pybamm-eis package. We recommend installing within a virtual environment in order to not alter any python distribution files on your machine.

PyBaMM is available on GNU/Linux, MacOS and Windows. For more detailed instructions on how to install PyBaMM, see the PyBaMM documentation.

Linux/Mac OS

To install the requirements on Linux/Mac OS use the following terminal commands:

  1. Clone the repository

    git clone https://github.com/pybamm-team/pybamm-eis
    
  2. Change into the pybamm-eis directory

    cd pybamm-eis
    
  3. Create a virtual environment

    virtualenv env
    
  4. Activate the virtual environment

    source env/bin/activate
    
  5. Install the pybammeis package

    pip install .
    

Windows

To install the requirements on Windows use the following commands:

  1. Clone the repository

    git clone https://github.com/pybamm-team/pybamm-eis
    
  2. Change into the pybamm-eis directory

    cd pybamm-eis
    
  3. Create a virtual environment

    python -m virtualenv env
    
  4. Activate the virtual environment

    \path\to\env\Scripts\activate
    

    where \path\to\env is the path to the environment created in step 3 (e.g. C:\Users\'Username'\env\Scripts\activate.bat).

  5. Install the pybammeis package

    pip install .
    

As an alternative, you can set up Windows Subsystem for Linux. This allows you to run a full Linux distribution within Windows.

Developer

To install as a developer follow the instructions above, replacing the final step with

pip install -e .

This will allow you to edit the code locally.

📖 Documentation

API documentation for the pybammeis package can be built locally using Sphinx. To build the documentation, first change into the docs directory, and then execute the following command:

make html

This will generate a number of html files in the docs/_build/html directory. To view the documentation, open the file docs/_build/html/index.html in a web browser.

🛠️ 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.

🎉 Acknowledgments

This code was developed as part of the Oxford Mathematics Summer Project "Efficient Linear Algebra Methods to Determine Li-ion Battery Behaviour".

Student: Rishit Dhoot Supervisors: Prof Colin Please and Dr. Robert Timms

📫 Get in touch

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

📃 License

pybamm-eis is fully open source. For more information about its license, see LICENSE.

Metadata

Release files for pybammeis 0.1.6

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

Built distribution (wheel)

Table of built distributions (wheels) for pybammeis 0.1.6
File Interpreter ABI Platform
pybammeis-0.1.6-py3-none-any.whl Python 3 none any Details

Release files / pybammeis-0.1.6-py3-none-any.whl

Download URL pybammeis-0.1.6-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eab9552de56ea9358ed1a59f3c266579587f56dd7d4fdf2f6a9d2333a4e1fec0
BLAKE2b-256 checksum
How to use checksums
f967468f148db73b3fdd697e593920d3baf9587ded537a43ce8f4dd268086bf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

Security for pybammeis 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for pybammeis-0.1.6-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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