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 develop
branch,
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:
virtualenv pybop-env
Activate the environment:
source pybop-env/bin/activate
Later, you can deactivate the environment:
deactivate
PyBOP has two general types of intended use cases:
- parameter estimation from battery test data
- 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 spm_pso.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 employing a sum-of-squared errors cost function using the terminal voltage as the observed signal and a particle swarm optimisation algorithm. To run this example:
python examples/scripts/spm_pso.py
Alternatively, spm_CMAES.ipynb provides an example in notebook form. This example estimates SPM parameters based on a sum-of-squared errors cost function and a CMA-ES 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):
This project follows the all-contributors specifications. Contributions of any kind are welcome! See contributing.md
for ways to get started.