Skip to main content

Python Battery Optimisation and Parameterisation

Project description

logo

Python Battery Optimisation and Parameterisation

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

PyBOP

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.

pybop_arch.svg

Getting Started

Installation

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.

Prerequisites

To use and/or contribute to PyBOP, first install Python (3.8 — 3.12). 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:

deactivate

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

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)

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Brady Planden
Brady Planden

🚇 ⚠️ 💻 💡 👀
NicolaCourtier
NicolaCourtier

💻 👀 💡 ⚠️
David Howey
David Howey

🤔 🧑‍🏫
Martin Robinson
Martin Robinson

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

👀
Faraday Institution
Faraday Institution

💵
UK Research and Innovation
UK Research and Innovation

💵
Agriya Khetarpal
Agriya Khetarpal

💻 🚇

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybop-24.3.tar.gz (51.4 kB view hashes)

Uploaded Source

Built Distribution

pybop-24.3-py3-none-any.whl (62.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page