A parameterisation and optimisation package for battery models.

Python Battery Optimisation and Parameterisation

Scheduled contributors last update forks stars codecov open issues license open In colab releases


PyBOP offers a full range of tools for the parameterisation and optimisation of battery models, utilising both Bayesian and frequentist approaches with example workflows to assist the user. PyBOP can be used to parameterise various battery models, which include electrochemical and equivalent circuit models that are present in PyBaMM. PyBOP prioritises clear and informative diagnostics for users, while also allowing for advanced probabilistic methods.

The diagram below presents PyBOP's conceptual framework. The PyBOP software specification is available at this link. This product is currently undergoing development, and users can expect the API to evolve with future releases.

Data flows from battery cycling machines to Galv Harvesters, then to the     Galv server and REST API. Metadata can be updated and data read using the web client, and data can be downloaded by the Python client.

Getting Started


Within your virtual environment, install PyBOP:

pip install pybop

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

pip install git+

To alternatively install PyBOP from a local directory, use the following template, substituting in the relevant path:

pip install -e "path/to/pybop"

To check whether PyBOP has been installed correctly, run one of the examples in the following section. For a development installation, please refer to the contributing guide.


To use and/or contribute to PyBOP, first install Python (3.8-3.11). On a Debian-based distribution, this looks like:

sudo apt update
sudo apt install python3 python3-virtualenv

For further information, please refer to the similar installation instructions for PyBaMM.

Virtual Environments

To create a virtual environment called pybop-env within your current directory:

virtualenv pybop-env

Activate the environment:

source pybop-env/bin/activate

Later, you can deactivate the environment:


Using PyBOP

PyBOP has two general types of intended use cases:

  1. parameter estimation from battery test data
  2. design optimisation subject to battery manufacturing/usage constraints

These general cases encompass a wide variety of optimisation problems that require careful consideration based on the choice of battery model, the available data and/or the choice of design parameters.

PyBOP comes with a number of example notebooks and scripts which can be found in the examples folder.

The script illustrates a straightforward example that starts by generating artificial data from a single particle model (SPM). The unknown parameter values are identified by implementing a sum-of-square error cost function using the terminal voltage as the observed signal and a gradient descent optimiser. To run this example:

python examples/scripts/

In addition, spm_nlopt.ipynb provides a second example in notebook form. This example estimates the SPM parameters based on an RMSE cost function and a BOBYQA optimiser.

Code of Conduct

PyBOP aims to foster a broad consortium of developers and users, building on and learning from the success of the PyBaMM 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)


Thanks goes to these wonderful people (emoji key):

Brady Planden
Brady Planden


David Howey
David Howey

Martin Robinson
Martin Robinson

Ferran Brosa Planella
Ferran Brosa Planella

This project follows the all-contributors specifications. Contributions of any kind are welcome! See for ways to get started.

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.