Package: pybop
Python Battery Optimisation and ParameterisationPyBOPPyBOP 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 inPyBaMM. 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 atthis link. This product is currently undergoing development, and users can expect the API to evolve with future releases.Getting StartedInstallationWithin your virtual environment, install PyBOP:pipinstallpybopTo install the most recent state of PyBOP, install from thedevelopbranch,pipinstallgit+https://github.com/pybop-team/PyBOP.git@developTo alternatively install PyBOP from a local directory, use the following template, substituting in the relevant path:pipinstall-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 thecontributing guide.PrerequisitesTo use and/or contribute to PyBOP, first install Python (3.8-3.11). On a Debian-based distribution, this looks like:sudoaptupdate
sudoaptinstallpython3python3-virtualenvFor further information, please refer to the similarinstallation instructions for PyBaMM.Virtual EnvironmentsTo create a virtual environment calledpybop-envwithin your current directory:virtualenvpybop-envActivate the environment:sourcepybop-env/bin/activateLater, you can deactivate the environment:deactivateUsing PyBOPPyBOP has two general types of intended use cases:parameter estimation from battery test datadesign optimisation subject to battery manufacturing/usage constraintsThese 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 ofexample notebooks and scriptswhich can be found in the examples folder.Thespm_descent.pyscript 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:pythonexamples/scripts/spm_descent.pyIn addition,spm_nlopt.ipynbprovides a second example in notebook form. This example estimates the SPM parameters based on an RMSE cost function and a BOBYQA optimiser.Code of ConductPyBOP aims to foster a broad consortium of developers and users, building on and learning from the success of thePyBaMMcommunity. 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🚇⚠️💻💡👀NicolaCourtier💻👀💡⚠️David Howey🤔🧑‍🏫Martin Robinson🤔🧑‍🏫👀Ferran Brosa Planella👀UKRI💵Faraday Institution💵This project follows theall-contributorsspecifications. Contributions of any kind are welcome! Seecontributing.mdfor ways to get started.