## Bayesian optimisation

**What is Bayesian optimisation?**

Bayesian optimisation is a gradient-free global optimisation strategy. It starts with an initial guess, then uses a mathematical model to make educated decisions about where to explore next. The method keeps improving its understanding of the problem as it collects more data points. It's a bit like a chef continually adjusting the recipe based on previous tastings to arrive at the perfect flavour. Bayesian optimisation is particularly handy when dealing with situations where evaluating the objective function is time-consuming or costly, and when gradient-based optimisation strategies fail.

**What is Bayesian optimisation, a bit more technically?**

Bayesian optimisation sequentially seeks for the extrema of the objective function by constructing a probabilistic surrogate model of it (typically a Gaussian process (GP) model), and by exploring the parameter space with the help of an acquisition function.

A GP model is a non-parametric probabilistic model that is defined by a prior mean function and a covariance function (also known as the kernel). Given a set of objective function observations at the input locations as training data (markers in the figure below), we can compute the posterior mean and variance for a set of new test points. We thus get an estimate (blue curve) of the underlying objective function (black curve) and the corresponding uncertainty (shaded area) for every point in the parameter space. Training a GP model involves determining the values of the kernel hyper-parameters that maximise the marginal likelihood. For a more detailed discussion on GPs, the reader is referred to [Rasmussen, C. E. and Williams, C. K.: Gaussian processes for machine learning, MIT Press, 2006].

The acquisition function (red curve in figure below), which is built on the GP model, determines the next point(s) to be evaluated, by taking into account both the mean and uncertainty for any point of the parameter space, and providing the probability, or amount, by which the point can improve the current optimum. Exploration, which directs the search towards unexplored areas of the parameter space, and exploitation, which focuses the search in the vicinity of known promising solutions, are automatically balanced based on the trade-off between uncertainty reduction and potential improvement.

A GP model is a non-parametric probabilistic model that is defined by a prior mean function and a covariance function (also known as the kernel). Given a set of objective function observations at the input locations as training data (markers in the figure below), we can compute the posterior mean and variance for a set of new test points. We thus get an estimate (blue curve) of the underlying objective function (black curve) and the corresponding uncertainty (shaded area) for every point in the parameter space. Training a GP model involves determining the values of the kernel hyper-parameters that maximise the marginal likelihood. For a more detailed discussion on GPs, the reader is referred to [Rasmussen, C. E. and Williams, C. K.: Gaussian processes for machine learning, MIT Press, 2006].

The acquisition function (red curve in figure below), which is built on the GP model, determines the next point(s) to be evaluated, by taking into account both the mean and uncertainty for any point of the parameter space, and providing the probability, or amount, by which the point can improve the current optimum. Exploration, which directs the search towards unexplored areas of the parameter space, and exploitation, which focuses the search in the vicinity of known promising solutions, are automatically balanced based on the trade-off between uncertainty reduction and potential improvement.

Bayesian optimisation has gained significant popularity in recent years, especially for tuning hyperparameters in machine learning models. Beyond machine learning, Bayesian optimisation is also finding applications in engineering optimisation (continue reading for a few examples).

**An example of practical application:**

Wind farm layout optimization

Wind farm layout optimization

Today, the need for renewable energy sources is more urgent than ever. In the UK, wind power is the largest source of renewable electricity, and the UK government has committed to a further major expansion in capacity by 2030. However, currently installed wind farms do not produce as much power as expected because the majority of the turbines operate within the wake field of other turbines in the farm. A wind turbine operating within a wake field is an issue for two reasons. First, the reduction of its power output due to wind speed deceleration and second, the increase of fatigue loads due to increased wind fluctuations.

Wake effects can be minimised by optimally arranging the wind turbines over the available land. Currently, optimisation of wind farm layout is carried out using low-fidelity flow solvers called wake models as objective function (farm power output) evaluators. Wake models are based on simplified arguments for the wakes of porous disks and do not account for unsteady phenomena, non-linear wake interactions, local acceleration due to blockage, wake meandering, or the interaction of the wakes with the atmospheric flow. As a result, optimisation based on wake models misses out on a number of opportunities for performance gains through manipulation and exploitation of these phenomena.

To address this, we have introduced a Bayesian optimisation framework aimed at enhancing the efficiency of power production in wind farms, which builds surrogate models based on high-fidelity large-eddy simulations of wind farm flows. The capabilities of the framework have been demonstrated for both small and large wind farms (see below figures for the instantaneous and mean flow fields in a random layout of the large wind farm). The framework can find optimal designs within a few iterations, while leveraging the above flow mechanisms to deliver increased wind farm performance. In the case of the large wind farm, the best layouts found through Bayesian optimisation had ≈7% increased efficiency compared with the efficiency of a standard aligned layout.

Wake effects can be minimised by optimally arranging the wind turbines over the available land. Currently, optimisation of wind farm layout is carried out using low-fidelity flow solvers called wake models as objective function (farm power output) evaluators. Wake models are based on simplified arguments for the wakes of porous disks and do not account for unsteady phenomena, non-linear wake interactions, local acceleration due to blockage, wake meandering, or the interaction of the wakes with the atmospheric flow. As a result, optimisation based on wake models misses out on a number of opportunities for performance gains through manipulation and exploitation of these phenomena.

To address this, we have introduced a Bayesian optimisation framework aimed at enhancing the efficiency of power production in wind farms, which builds surrogate models based on high-fidelity large-eddy simulations of wind farm flows. The capabilities of the framework have been demonstrated for both small and large wind farms (see below figures for the instantaneous and mean flow fields in a random layout of the large wind farm). The framework can find optimal designs within a few iterations, while leveraging the above flow mechanisms to deliver increased wind farm performance. In the case of the large wind farm, the best layouts found through Bayesian optimisation had ≈7% increased efficiency compared with the efficiency of a standard aligned layout.

**Material, activities, and people**

Bempedelis, N. and Magri, L.: Bayesian optimization of the layout of wind farms with a high-fidelity surrogate model, arXiv preprint arXiv:2302.01071, 2023.

Bempedelis, N., Gori, F., Wynn, A., Laizet, S., and Magri, L.: Data-driven optimisation of wind farm layout and wake steering with large-eddy simulations, Wind Energ. Sci. Discuss. [preprint], https://doi.org/10.5194/wes-2023-110, in review, 2023.

Bempedelis, N., Gori, F., Wynn, A., Laizet, S., and Magri, L.: Data-driven optimisation of wind farm layout and wake steering with large-eddy simulations, Wind Energ. Sci. Discuss. [preprint], https://doi.org/10.5194/wes-2023-110, in review, 2023.

**An example of practical application:**

Wake steering optimisation

Wake steering optimisation

Recently, an approach called wake steering was proposed as an alternative strategy to mitigate wake losses [Howland, M. F., Lele, S. K., and Dabiri, J. O.: Wind farm power optimization through wake steering, Proceedings of the National Academy of Sciences, 116, 2019]. In wake steering, upstream turbines are yawed to deflect their wakes away from downstream turbines. Although this results in a reduction in power production from the upstream turbines, the downstream turbines generate more power, leading to an overall increase in the farm’s power output.

We applied the proposed Bayesian optimisation framework to find the optimal steering conditions in a row of the Horns Rev I wind farm. The Bayesian optimisation framework relying on large-eddy simulations outperformed the state-of-the-art wake model-based optimisation by a considerable margin (4% increased efficiency, reaching an overall 28% increase compared with the non-yawed conditions). The increased complexity of the flow in wake steering renders the utilisation of high-fidelity flow models advantageous. This is expected to hold in other scenarios of increased flow complexity, such as wind farms on complex terrain or under stratified conditions.

We applied the proposed Bayesian optimisation framework to find the optimal steering conditions in a row of the Horns Rev I wind farm. The Bayesian optimisation framework relying on large-eddy simulations outperformed the state-of-the-art wake model-based optimisation by a considerable margin (4% increased efficiency, reaching an overall 28% increase compared with the non-yawed conditions). The increased complexity of the flow in wake steering renders the utilisation of high-fidelity flow models advantageous. This is expected to hold in other scenarios of increased flow complexity, such as wind farms on complex terrain or under stratified conditions.

**Material, activities, and people**

Bempedelis, N., Gori, F., Wynn, A., Laizet, S., and Magri, L.: Data-driven optimisation of wind farm layout and wake steering with large-eddy simulations, Wind Energ. Sci. Discuss. [preprint], in review, 2023.