An open API service indexing awesome lists of open source software.

https://github.com/pybop-team/PyBOP

A parameterisation and optimisation package for battery models.
https://github.com/pybop-team/PyBOP

Last synced: 3 days ago
JSON representation

A parameterisation and optimisation package for battery models.

Awesome Lists containing this project

README

        

logo.svg

# Python Battery Optimisation and Parameterisation

[![Scheduled](https://github.com/pybop-team/PyBOP/actions/workflows/scheduled_tests.yaml/badge.svg)](https://github.com/pybop-team/PyBOP/actions/workflows/scheduled_tests.yaml)
[![Contributors](https://img.shields.io/github/contributors/pybop-team/PyBOP)](https://github.com/pybop-team/PyBOP/graphs/contributors)
[![Python Versions from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fpybop-team%2FPyBOP%2Fdevelop%2Fpyproject.toml&label=Python)](https://pypi.org/project/pybop/)
[![Codecov](https://codecov.io/gh/pybop-team/PyBOP/branch/develop/graph/badge.svg)](https://codecov.io/gh/pybop-team/PyBOP)
[![License](https://img.shields.io/github/license/pybop-team/PyBOP?color=blue)](https://github.com/pybop-team/PyBOP/blob/develop/LICENSE)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pybop-team/PyBOP/blob/develop/)
[![nbviewer](https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg)](https://nbviewer.org/github/pybop-team/PyBOP/tree/develop/examples/notebooks/)
[![Static Badge](https://img.shields.io/badge/https%3A%2F%2Fpybop-team.github.io%2Fpybop-bench%2F?label=Benchmarks)](https://pybop-team.github.io/pybop-bench/)
[![Releases](https://img.shields.io/github/v/release/pybop-team/PyBOP?color=gold)](https://github.com/pybop-team/PyBOP/releases)

[Main Branch Examples](https://github.com/pybop-team/PyBOP/tree/main/examples) [Develop Branch Examples](https://github.com/pybop-team/PyBOP/tree/develop/examples)

PyBOP provides a complete set of tools for parameterisation and optimisation of battery models, using both Bayesian and frequentist approaches, with [example workflows](https://github.com/pybop-team/PyBOP/tree/main/examples/) to assist the user. PyBOP can be used to parameterise various battery models, including electrochemical and equivalent circuit models available in [PyBaMM](https://pybamm.org/). PyBOP prioritises clear and informative diagnostics for the user, while also allowing for advanced probabilistic methods.

The diagram below shows the conceptual framework of PyBOP. This package is currently under development, so users can expect the API to evolve with future releases.


pybop_arch.svg

## Installation

Within your virtual environment, install PyBOP:

```bash
pip install pybop
```

To install the most recent state of PyBOP, install from the `develop` branch,

```bash
pip install git+https://github.com/pybop-team/PyBOP.git@develop
```

To install a previous version of PyBOP, use the following template and replace the version number:

```bash
pip install pybop==v24.3
```

To check that PyBOP is installed correctly, run one of the examples in the following section. For a development installation, see the [Contribution Guide](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md#Installation). More installation information is available in our [documentation](https://pybop-docs.readthedocs.io/en/latest/installation.html) and the [extended installation instructions](https://docs.pybamm.org/en/latest/source/user_guide/installation/gnu-linux-mac.html) for PyBaMM.

## Using PyBOP
PyBOP has two intended uses:

1. Parameter inference from battery test data.

2. Design optimisation under battery manufacturing/use constraints.

These include a wide variety of optimisation problems that require careful consideration due to the choice of battery model, data availability and/or the choice of design parameters.

### Jupyter Notebooks

Explore our [example notebooks](https://github.com/pybop-team/PyBOP/blob/develop/examples) for hands-on demonstrations:

- [Gravimetric design optimisation (SPMe)](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/design_optimisation/energy_based_electrode_design.ipynb)
- [Non-linear constrained ECM parameter identification](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/ecm_trust-constr.ipynb)
- [Optimiser comparison for parameter identification](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/comparison_examples/multi_optimiser_identification.ipynb)
- [Parameter identification for spatial pouch cell model](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/pouch_cell_identification.ipynb)
- [Estimating ECM parameters from HPPC pulse](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb)

### Python Scripts

Find additional script-based examples in the [examples directory](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/):

- [UKF parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/unscented_kalman_filter.py)
- [BPX format parameter import/export](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/simple_BPX.py)
- [Electrochemical Impendence Spectroscopy (EIS) parameter identification](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/battery_parameterisation/simple_eis.py)
- [Maximum a Posteriori parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/maximum_a_posteriori.py)
- [Gradient-based parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/adamw.py)

### Supported Methods
The table below lists the currently supported [models](https://github.com/pybop-team/PyBOP/tree/develop/pybop/models), [optimisers](https://github.com/pybop-team/PyBOP/tree/develop/pybop/optimisers), and [cost functions](https://github.com/pybop-team/PyBOP/tree/develop/pybop/costs) in PyBOP.

| Battery Models | Cost Functions | Optimization Algorithms |
|-----------------------------------------------|------------------------------------|--------------------------------------------------------------------|
| Single Particle Model (SPM) | Sum of Squared Error (SSE) | Covariance Matrix Adaptation Evolution Strategy (CMA-ES)

|
| Single Particle Model with Electrolyte (SPMe) | Root Mean Squared Error (RMSE) | Particle Swarm Optimization (PSO) |
| Doyle-Fuller-Newman (DFN) | Mean Squared Error (MSE) | Exponential Natural Evolution Strategy (xNES) |
| Many Particle Model (MPM) | Mean Absolute Error (MAE) | Separable Natural Evolution Strategy (sNES) |
| Multi-Species Multi-Reaction (MSMR) | Minkowski | Weight Decayed Adaptive Moment Estimation (AdamW) |
| Weppner-Huggins | Sum of Power | Improved Resilient Backpropagation (iRProp-) |
| Equivalent Circuit Models (ECM) | Gaussian Log Likelihood | SciPy Minimize & Differential Evolution |
| Grouped-parameter SPMe (GroupedSPMe) | Log Posterior | Cuckoo Search |
| | Gravimetric Energy / Power Density | Simulated Annealing |
| | Volumetric Energy / Power Density | Random Search |
| | | Gradient Descent |
| | | Nelder Mead |

## Code of Conduct

PyBOP aims to foster a broad consortium of developers and users, building on and learning from the success of the [PyBaMM](https://pybamm.org/) community. Our values are:

- Inclusivity and fairness (those who wish to contribute may do so, and their input is appropriately recognised)

- Interoperability (modularity for maximum impact and inclusivity)

- User-friendliness (putting user requirements first via user-assistance & workflows)

## License

PyBOP is released under the [BSD 3-Clause License](https://github.com/pybop-team/PyBOP/blob/develop/LICENSE).

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Brady Planden
Brady Planden

🚇 ⚠️ 💻 💡 👀
NicolaCourtier
NicolaCourtier

💻 👀 💡 ⚠️
David Howey
David Howey

🤔 🧑‍🏫
Martin Robinson
Martin Robinson

🤔 🧑‍🏫 👀 💻 ⚠️
Ferran Brosa Planella
Ferran Brosa Planella

👀 💻 💡
Agriya Khetarpal
Agriya Khetarpal

💻 🚇 👀
Faraday Institution
Faraday Institution

💵


UK Research and Innovation
UK Research and Innovation

💵
Horizon Europe IntelLiGent Consortium
Horizon Europe IntelLiGent Consortium

💵
Muhammed Nedim Sogut
Muhammed Nedim Sogut

💻
MarkBlyth
MarkBlyth

💻
f-g-r-i-m-m
f-g-r-i-m-m

💡
Dibyendu-IITKGP
Dibyendu-IITKGP

💡 ⚠️ 💻
Noël Hallemans
Noël Hallemans

💡


Pip Liggins
Pip Liggins

💻

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specifications. Contributions of any kind are welcome! See `CONTRIBUTING.md` for ways to get started.