- Holly Sennett

# How Artificial Intelligence will shape the fastest race car

### Written By David Massegur

Artificial Intelligence is crucial to aiding motorsport engineers in standing out against the competition. It is bound to become a revolutionary tool within engineering allowing individuals to create concepts that would be unthinkable to the human mind. AI is therefore the key to engineering the fastest race car.

**Engineering design is crucial in motorsport**

Motorsport, and particularly Formula 1, is the pinnacle for engineering. A Formula 1 team shall employ hundreds of engineers with the only mission to design the fastest car of the competition. To achieve this, engineers must excel in their field of expertise. And every discipline is crucial for the ultimate performance: Aerodynamics, Structures, Thermal Management, Mechanical Design, Composite Design, Materials, Vehicle Dynamics, Tyre and Suspension Modelling, Electronics, Production, Race Engineering… In all these fields, the engineer’s challenge is to find the optimal solution in the area they are investigating. For example, the goal for an Aerodynamics Engineer is to design the optimal wing shape that maximizes downforce and minimizes drag. Figure 1 shows an example of a Computational Fluid-Dynamics (CFD) simulation typically undertaken in motorsports to assess the performance of a wing shape. As another example, the task of a Structural Engineer is to find the best material composition capable of sustaining the prescribed loads with the minimum weight possible.

*Figure 1. Computational Fluid-Dynamics simulation of a basic race-car rear wing. The role of the Aerodynamics engineer is to design, model and *analyse* the flow behavior on and around a component to enhance the aerodynamic performance of the car.*

These tasks require on-going development and investigation, where it is crucial to think of new ideas, model them with the best possible software, test them in well-defined experiments, analyze the results and subsequently come up with follow-up ideas to improve the concept. And the engineer does so until the design is mature enough to be manufactured and raced. This requires hours and hours of investigation and simulation until the optimal design of a component or set-up is found.

__The breakthrough of Artificial Intelligence__

Artificial Intelligence (AI) is the development of computer systems able to perform tasks independently and requiring them to think as humans do. This science has been enjoying a major resurgence in recent years thanks to its major outbreak in modern technologies, such as computer vision or speech recognition. Such a breakthrough is thanks to the recent advances in Machine Learning (ML) methods. ML is the study of algorithms that allow a computer to learn and improve from experience. The approach is in essence similar to how humans do: children learn to recognize a cat from a dog after showing them several images of different cats. Thus, we need to train before learning to do a particular task. Similarly, by feeding the computer with example data for their training, ML algorithms are then capable of making predictions when new unseen inputs are provided.

If ML has recently become the real deal is because the success rates on the predictions are significantly higher than what a human is able to perform. This is thanks to recent advances on the most famous ML algorithms: the Neural Networks. NN’s take inspiration in the way brain neurons work: in simple words, a series of neurons are interconnected by layers, each layer of neurons weighs the input data and activates the relevant information; and then this is transferred to the next layer. The last layer computes the target outcome. See Figure 2 for a basic Neural Network architecture.

*Figure 2. Typical Dense Neural Network scheme. The input parameters are interconnected through a series of weighed linear transformations and non-linear activations to compute the target output. The number of layers and neurons in each layer are fine tuned to minimize the outcome error.*

In order to be able to perform predictions in a particular application, the NN must be ‘trained’ (find the weight value in each neuron) using a set of examples containing known input parameters and outcomes, approach known as supervised learning. These methods require a significant amount of training data to perform well. Hence the other reason why only recently NN’s have become successful: nowadays data availability is not a limitation anymore in most applications, thanks to the internet giving access to infinite sources. A detailed description of how NN’s work could be the subject of another text and is beyond the scope of this article.

**Machine Learning for surrogate modeling and optimisation**

So how can Machine Learning make an impact in motorsport engineering? The answer is in many applications. Yet, rather than pointing out all of them, we shall expose the most common application nowadays being successfully used: surrogate modeling to speed up simulation turnarounds, allowing engineers to come up with the optimal solution crucially faster. A surrogate model is an engineering method consisting of constructing an approximation model that provides the outcome of interest more easily and faster than via a classical method, such as experiments or simulations. This is a quite long-dated technique of fitting a mathematical model to a cloud of data. The most elementary surrogate model is fitting a polynomial curve to a Y-X plot. Several regression techniques have been existing for a long time. Yet, these are gradually being replaced by ML algorithms, such as the one shown in Figure 2, thanks to their more powerful success rates.

Thus, starting off with a set of input data, containing input parameters and the respective results taken from experiments, a mathematical model is fit to this data to approximate its behavior. And then, this model is used to predict the outcome given a set of new parameters, without having to undertake another expensive experiment. This model shall therefore be used to undertake a design optimization, design space exploration, or sensitivity analysis. The main advantage is that it will typically take seconds to predict an outcome for a desired configuration, in contrast to hours or days taken by a simulation or experiment. However, the engineer must ascertain that the model is performing satisfactorily, this is ensuring that predictions are within an acceptable margin of error.

__A new revolutionary engineering approach__

To understand how ML makes the difference with surrogate modeling and design optimization, we shall compare three distinct engineering approaches an Aerodynamics engineer can adopt when in charge of a project to design a wing shape using CFD:

- Problem set-up: every project requires a target (or multiple targets), this could be maximize downforce. And a series of design parameters must be defined, for example, length of the airfoil section, camber, spanwise twist… A possible parametric set-up of a rear wing design is shown in Figure 3.

*Figure 3. Parametric wing shape design. Illustration of a basic parametric set-up for a wing shape design. Parameters are airfoil length, incidence and camber at both centreline and tip. More complex problems typically consist of a larger number of spanwise sections, curvature of the leading edge, slot gap, camber and incidence for each element of the section...*

Each of these parameters can take a certain amount of values. And any given set of parameter values makes a design configuration. Therefore, the total number of possible configurations increases exponentially with the number of parameters. In the case of wing design, it may typically be thousands of configurations. Unfortunately, running them all in CFD to find the best solution is unfeasible, as a CFD simulation typically takes several hours. Consequently, a specific approach shall be adopted instead:

Approach 1: Iterative development. The engineer tests an original shape in CFD, analyses the results, tweaks the wing shape parameters according to their judgment, and runs it again in CFD. And iterations continue until they are happy with the results or the project deadline is passed (Figure 4). With such an approach, not too many configurations will be possible to test and, inevitably, a suboptimal solution will be reached, unless, of course, the engineer is outstandingly genius.

*Figure 4. Manual iterative design development. The engineer iteratively continues testing and manually modifying the design until it is mature enough to be released. *

Approach 2: Gradient-descent optimization. The engineer shall use an optimization algorithm to find the optimal solution. Gradient-descent is the method most commonly applied, which consists of finding the minimum of the target function, in our case the negative downforce as a function of the wing parameters. To do this, the gradients of such function must be computed via perturbations from the starting point in order to generate the derivatives. This means a CFD run for each of the parameters to perturbate. Once the gradients are computed, the optimization algorithm can advance one step downhill. And the gradients must be re-computed again via further CFD runs of the perturbations from the new point. And go on stepping until the gradients vanish, this is the optimum has been found (Figure 5). Despite this method saves you from running all the possible configurations, hundreds of CFD simulations will still be required, which most often is not feasible within the time scales of a motorsports project.

*Figure 5. Gradient descent optimization. From a given set of parameters, N+1 designs are run in CFD by perturbation of each parameter. The gradients of the target as *a *function of the parameters *are* computed. The parameters are then updated in the direction towards the minimum. This process is repeated until the gradients vanish. The optimum has been reached. *

Approach 3: Surrogate model optimization. A Machine Learning method can be used (most likely a Neural Network) to generate a high-fidelity surrogate model. To do this, a set of configurations is chosen randomly or via a Design Of Experiments (DOE) technique, in order to limit the number of CFD runs required. Once the surrogate model is trained with the DOE results, it is used by the optimization algorithm to get faster predictions during the gradient-descent steps; until the optimum is found (Figure 6). As a result, provided the surrogate model is faithful enough, the optimization is completed in a fraction of time and requiring fewer CFD simulations than with the classical optimization approach described above. It is however essential to verify at least the optimal configuration found.

*Figure 6. Surrogate model optimization. The Surrogate Model is trained with an initial set of CFD results from a DOE. The optimization algorithm shall then use the Machine-Learning model to compute the necessary outcomes to reach the optimum. *

__The power of Machine Learning__

Approach 2 is often discarded because of being too costly. And until not long ago, approach 3 was neither a good option due to the traditional interpolation methods available not capable of providing accurate regression models. Consequently, the engineer would commonly have to adopt approach 1, ending up with a non-optimal design and risking to be beaten by the rivals. Fortunately, thanks to the breakthrough of Machine Learning, especially with Neural Networks, the accuracy of the surrogate models can be far beyond expectation. And as a result, adopting approach 3 is becoming crucial to unlock performance and come up with the fastest car of the grid.

However, such great potential does not come for free: for ML models to perform satisfactorily, a large amount of training data (usually CFD runs) is typically required, much more than with older regression models. Therefore, the risk is that approach 3 becomes unfeasible too.

The advantage of ML is that it can be continuously monitored and trained as new information becomes available. And they can even be fed with any sort of data, mixing experimental and simulation or even taking benefit of any old results which otherwise would be forgotten in the team’s databases. In fact, the more data available the better the model will respond, potentially making a larger impact on your design. In addition, on-going research is underway to render these methods fewer data thirsty. Upcoming developments in this matter will make these methods even more powerful.

__The future is bright __

ML will gradually become the crucial tool for engineers to speed up outcomes and find design solutions they would have never come up with via traditional ways. This methodology is not yet universally deployed but it is rapidly spreading throughout many engineering organizations and across different disciplines, thanks to its great potential and the significant advances in recent years which are overcoming its weak points. There are indeed a vast number of applications where AI can be exploited to aid your development. And the problem described above is just one example of them.

In a future where engineering concepts will get more and more complex, blending Machine Learning with other more classical methods will be critical for such investigations to be fruitful, with the potential of opening up development paths that would be unimaginable otherwise. In Motorsport, this will translate into performance gains that will stand out against the competition. The future of engineering is undoubtedly for Machine Learning to shine.

**About the author**

David Massegur is an experienced Formula 1 Engineer with over 12 years of experience within the industry. Most recently David has worked as an Aeroelastician with Williams Racing.