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.
Within your virtual environment, install PyBOP:
pip install pybop
To install the most recent state of PyBOP, install from the
pip install git+https://github.com/pybop-team/PyBOP.git@develop
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.
To create a virtual environment called
pybop-env within your current directory:
Activate the environment:
Later, you can deactivate the environment:
PyBOP has two general types of intended use cases:
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 spm_descent.py 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:
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.
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):
Ferran Brosa Planella
This project follows the all-contributors specifications. Contributions of any kind are welcome! See
contributing.md for ways to get started.