From e2072b24d0b22bc0fb0509394723115d54666017 Mon Sep 17 00:00:00 2001 From: David Howey Date: Thu, 12 Dec 2024 14:17:21 +0000 Subject: [PATCH] Update paper.md more of dave's changes; minor things plus removed fig 1 --- joss/paper.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/joss/paper.md b/joss/paper.md index 1317c4e6..d7b29b72 100644 --- a/joss/paper.md +++ b/joss/paper.md @@ -59,11 +59,11 @@ The Python Battery Optimisation and Parameterisation (`PyBOP`) package provides `PyBOP` has a layered structure enabling the necessary functionality to compute forward predictions, process results, and run optimisation and sampling algorithms. The forward model is solved using the battery modelling software `PyBaMM`, with construction, parameterisation, and discretisation managed by `PyBOP`'s model interface to `PyBaMM`. This provides a robust object construction process with a consistent interface between forward models and optimisers. Furthermore, identifiability metrics are provided along with the estimated parameters (through Hessian approximation of the cost functions around the optimum point in frequentist workflows, and posterior distributions in Bayesian workflows). -![PyBOP's interface to supporting funding agencies, alongside a visualisation of the general workflow for parameterisation and optimisation. \label{fig:high-level}](figures/PyBOP-high-level.pdf){width=80%} +`PyBOP` formulates the inference process into four key classes: model, problem, cost (or likelihood), and optimiser (or sampler), as shown in \autoref{fig:classes}. Each of these objects represents a base class with child classes constructing specialised functionality for different workflows. The model class constructs a `PyBaMM` forward model with a specified set of equations, initial conditions, spatial discretisation, and numerical solver. By composing `PyBaMM` directly into `PyBOP`, specialised models can be constructed alongside the standard models that can also be modified for different inference tasks. One such example is spatial re-discretisation, which is required when one or more geometric parameters are being optimised. In this situation, `PyBOP` rebuilds the `PyBaMM` model a minimum number of times while maintaining the problem, cost, and optimiser objects, providing improved performance. Alongside construction of the forward model, `PyBOP`'s model class provides methods for obtaining sensitivities from the prediction, enabling gradient-based optimisation. A forward prediction, along with its corresponding sensitivities, is provided to the problem class for processing and exception control. A standardised data structure is then provided to the cost classes, which then computes a distance, design, or likelihood-based metric for optimisation. For deterministic optimisation, the optimisers minimise the cost function or the negative log-likelihood if a likelihood class is provided. Bayesian inference is provided by sampler classes, which accept the LogPosterior class and sample from it using `PINTS`-based Monte Carlo algorithms at the time of submission. In the typical workflow, the classes in \autoref{fig:classes} are constructed in sequence, from left to right in the figure. -`PyBOP` formulates the inference process into four key classes: model, problem, cost (or likelihood), and optimiser (or sampler), as shown in \autoref{fig:classes}. Each of these objects represents a base class with child classes constructing specialised functionality for different workflows. The model class constructs a `PyBaMM` forward model with a specified set of equations, initial conditions, spatial discretisation, and numerical solver. By composing `PyBaMM` directly into `PyBOP`, specialised models can be constructed alongside the standard models that can also be modified for different inference tasks. One such example is spatial re-discretisation, which is required when one or more geometric parameters are being optimised. In this situation, `PyBOP` rebuilds the `PyBaMM` model a minimum number of times while maintaining the problem, cost, and optimiser objects, providing improved performance. Alongside construction of the forward model, `PyBOP`'s model class provides methods for obtaining sensitivities from the prediction, enabling gradient-based optimisation. A forward prediction, along with its corresponding sensitivities, is provided to the problem class for processing and exception control. A standardised data structure is then provided to the cost classes, which then computes a distance, design, or likelihood-based metric for optimisation. For deterministic optimisation, the optimisers minimise the cost function or the negative log-likelihood if a likelihood class is provided. Bayesian inference is provided by sampler classes, which accept the LogPosterior class and sample from it using `PINTS`-based Monte Carlo algorithms at the time of submission. In the typical workflow, the classes in \autoref{fig:classes} are constructed in sequence. +In addition to the core architecture, `PyBOP` provides several specialised inference and optimisation features. One example is parameter inference from electrochemical impedance spectroscopy (EIS) simulations, where PyBOP discretises and linearises the EIS forward model into a sparse mass matrix form with accompanying auto-differentiated Jacobian. This is then translated into the frequency domain, giving a direct solution to compute the input-output impedance. In this situation, the forward models are constructed within the spatial re-discretisation workflow, allowing for geometric parameter inference from EIS simulations and data. -In addition to the core architecture, `PyBOP` provides several specialised inference and optimisation processes. One such instance is parameter inference from electrochemical impedance spectroscopy (EIS) simulations. PyBOP discretises the EIS forward model into a sparse mass matrix form with accompanying auto-differentiated Jacobian. These objects are then translated into the frequency domain with a linear solution used to compute the battery model impedance. In this situation, the forward models are constructed within the spatial re-discretisation workflow, allowing for geometric parameter inference from EIS simulations. Furthermore, `PyBOP` builds on the `JAX` [@jax:2018] numerical solvers provided by `PyBaMM` by providing `JAX`-based cost functions for automatic forward model differentiation with respect to the parameters. This functionality provides a performance improvement, and allows users to use many other JAX-based inference packages in order to optimise their cost function, such as `Numpyro` [@numpyro:2019], `BlackJAX` [@blackjax:2024], and `Optax` [@optax:2020]. +A second specialised feature is that `PyBOP` builds on the `JAX` [@jax:2018] numerical solvers used by `PyBaMM` by providing `JAX`-based cost functions for automatic forward model differentiation with respect to the parameters. This functionality provides a performance improvement and allows users to harness many other JAX-based inference packages to optimise cost functions, such as `Numpyro` [@numpyro:2019], `BlackJAX` [@blackjax:2024], and `Optax` [@optax:2020]. ![The core `PyBOP` architecture with base class interfaces. Each class provides a direct mapping to a step in the optimisation workflow. \label{fig:classes}](figures/PyBOP_components.drawio.png){ width=80% }