# Application of Monte Carlo Methods to Consider Probabilistic Effects in a Race Simulation for Circuit Motorsport

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Related Work

#### 2.1. Starting Performance

#### 2.2. Variability of Lap Time and Pit Stop Duration

#### 2.3. Accidents and Failures

#### 2.4. Damaged Car

#### 2.5. Full Course Yellow Phases

## 3. Methodology

#### 3.1. Modeling of Starting Performance

#### 3.2. Modeling of Variability of Lap Time and Pit Stop Duration

#### 3.3. Determination of Accident and Failure Probabilities

#### 3.4. Determination of Full Course Yellow Phases in Combination with Accidents and Failures

- Determine SC phases (quantity, start, duration) and derive accidents
- Determine failures (quantity, start) and derive VSC phases (duration)
- Convert race progress to race time

#### 3.5. Modeling of Accidents, Failures, and Full Course Yellow Phases

## 4. Results

#### 4.1. Effect of Full Course Yellow Phases

#### 4.2. Analysis of Monte Carlo Simulations

## 5. Discussion

## 6. Summary

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## Abbreviations

CDF | Cumulative Distribution Function |

DNF | Did Not Finish |

DRS | Drag Reduction System |

FCY | Full Course Yellow |

MCS | Monte Carlo Simulation |

Probability Density Function | |

RNG | Random Number Generator |

SC | Safety Car |

SCG | Safety Car Ghost |

VSC | Virtual Safety Car |

## Appendix A. Parameterization of the Probabilistic Effects in the Race Simulation

**Table A1.**Driver-specific parameterization for accident probability ${P}_{\mathrm{accident}}$, lap time variability ${t}_{\mathrm{lap},\mathrm{var}}$ and starting performance ${t}_{\mathrm{startperf}}$ for all drivers of the 2019 season. ${P}_{\mathrm{accident}}$ is season-specific, the other values are valid for all seasons 2014–2019.

Driver | ${\mathit{P}}_{\mathbf{accident}}$ (2019) | ${\mathit{t}}_{\mathbf{lap},\mathbf{var}}$ in s $\left(\right)open="("\; close=")">\mathcal{N}\left(\right)open="("\; close=")">\mathit{\mu},\phantom{\rule{0.166667em}{0ex}}{\mathit{\sigma}}^{2}$ | ${\mathit{t}}_{\mathbf{startperf}}$ in s $\left(\right)open="("\; close=")">\mathcal{N}\left(\right)open="("\; close=")">\mathit{\mu},\phantom{\rule{0.166667em}{0ex}}{\mathit{\sigma}}^{2}$ |
---|---|---|---|

Alexander Albon | 0.045 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.628}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.050,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.168}2$ |

Antonio Giovinazzi | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.737}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.006,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.148}2$ |

Carlos Sainz Jnr | 0.045 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.606}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.097,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.126}2$ |

Charles Leclerc | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.533}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.042,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.125}2$ |

Daniel Ricciardo | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.517}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.047,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.112}2$ |

Daniil Kvyat | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.586}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.027,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.146}2$ |

George Russell | 0.072 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.759}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.044,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.174}2$ |

Kevin Magnussen | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.608}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.014,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.171}2$ |

Kimi Raikkonen | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.499}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.088,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.245}2$ |

Lance Stroll | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.642}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.095,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.135}2$ |

Lando Norris | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.603}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.003,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.142}2$ |

Lewis Hamilton | 0.045 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.459}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.052,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.098}2$ |

Max Verstappen | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.473}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.001,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.171}2$ |

Nico Hulkenberg | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.548}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.027,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.115}2$ |

Pierre Gasly | 0.045 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.591}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.044,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.154}2$ |

Robert Kubica | 0.045 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.841}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.029,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.128}2$ |

Romain Grosjean | 0.072 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.612}2$ | $\mathcal{N}\left(\right)open="("\; close=")">0.102,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.156}2$ |

Sebastian Vettel | 0.045 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.458}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.050,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.115}2$ |

Sergio Perez | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.550}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.009,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.152}2$ |

Valtteri Bottas | 0.058 | $\mathcal{N}\left(\right)open="("\; close=")">0,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.482}2$ | $\mathcal{N}\left(\right)open="("\; close=")">-0.028,\phantom{\rule{0.166667em}{0ex}}{\left(\right)}^{0.135}2$ |

**Table A2.**Team-specific parameterization for failure probability ${P}_{\mathrm{failure}}$ and pit stop duration variability ${t}_{\mathrm{pit},\mathrm{var}}$ for all teams of the 2019 season. ${P}_{\mathrm{failure}}$ is season-specific, ${t}_{\mathrm{pit},\mathrm{var}}$ is valid for all seasons 2014–2019. The parameterization of the pit stop duration variability is based on pit stop durations that are at most 4 $\mathrm{s}$ longer than the minimum pit stop duration of a race.

Team | ${\mathit{P}}_{\mathbf{failure}}$ (2019) | ${\mathit{t}}_{\mathbf{pit},\mathbf{var}}$ in s ($\mathcal{F}$(shape, loc, scale)) |
---|---|---|

AlfaRomeo | 0.056 | $\mathcal{F}(5.827,-0.953,2.327)$ |

Ferrari | 0.086 | $\mathcal{F}(2.414,-0.153,0.737)$ |

HaasF1Team | 0.101 | $\mathcal{F}(5.324,-0.667,1.866)$ |

McLaren | 0.117 | $\mathcal{F}(2.639,-0.235,0.980)$ |

Mercedes | 0.041 | $\mathcal{F}(1.563,-0.046,0.480)$ |

RacingPoint | 0.056 | $\mathcal{F}(3.498,-0.249,1.188)$ |

RedBull | 0.071 | $\mathcal{F}(2.045,-0.094,0.598)$ |

Renault | 0.086 | $\mathcal{F}(3.876,-0.419,1.433)$ |

ToroRosso | 0.071 | $\mathcal{F}(4.290,-0.568,1.606)$ |

Williams | 0.071 | $\mathcal{F}(2.562,-0.240,0.966)$ |

**Table A3.**Probabilities for a specified quantity of safety car (SC) deployments in a race (seasons 2014–2019).

Probability | 0 SC | 1 SC | 2 SC | $\ge 3$ SC |
---|---|---|---|---|

${P}_{\mathrm{sc},\mathrm{quant}}$ | 0.455 | 0.413 | 0.099 | 0.033 |

**Table A4.**Probabilities for the start of a safety car phase in one of the six groupings of the race (seasons 2014–2019). The probability of each grouping is divided equally among the laps in it, depending on the total number of laps in the respective race.

Probability | 1st Lap | 2nd Lap to 20% | 20 to 40% | 40 to 60% | 60 to 80% | 80 to 100% |
---|---|---|---|---|---|---|

${P}_{\mathrm{sc},\mathrm{start}}$ | 0.364 | 0.136 | 0.136 | 0.08 | 0.193 | 0.091 |

## References

- Heilmeier, A.; Graf, M.; Lienkamp, M. A Race Simulation for Strategy Decisions in Circuit Motorsports. In Proceedings of the 2018 21st International Conference on Intelligent Transportation Systems (ITSC), Maui, HI, USA, 4–7 November 2018; pp. 2986–2993. [Google Scholar] [CrossRef]
- Newell, C. Ergast Motor Racing Developer API. Available online: http://ergast.com/mrd (accessed on 8 May 2020).
- Lemieux, C. Monte Carlo and Quasi-Monte Carlo Sampling; Springer Series in Statistics; Springer: New York, NY, USA, 2009. [Google Scholar] [CrossRef][Green Version]
- Bekker, J.; Lotz, W. Planning Formula One race strategies using discrete-event simulation. J. Oper. Res. Soc.
**2009**, 60, 952–961. [Google Scholar] [CrossRef] - Phillips, A. Building a Race Simulator. Available online: https://f1metrics.wordpress.com/2014/10/03/building-a-race-simulator (accessed on 8 May 2020).
- Salminen, T. Race Simulator: Downloadable R Program Code. Available online: https://f1strategyblog.wordpress.com/2019/05/10/race-simulator-downloadable-r-program-code (accessed on 8 May 2020).
- Sulsters, C. Simulating Formula One Race Strategies. Master’s Thesis, Vrije Universiteit Amsterdam, Amsterdam, The Netherland, 2018. [Google Scholar]
- Collantine Media Ltd. RaceFans Race Data 2018. Available online: https://www.racefans.net/2018-f1-season/2018-f1-statistics/2018-f1-race-data (accessed on 8 May 2020).
- The SciPy Community. Documentation on scipy.stats.fisk. Available online: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.fisk.html (accessed on 29 May 2020).
- Collantine Media Ltd. RaceFans Retirements Data 2019. Available online: https://www.racefans.net/2019-f1-season/2019-f1-statistics/2019-f1-retirements-penalties (accessed on 29 May 2020).
- Box, G.E.P.; Muller, M.E. A Note on the Generation of Random Normal Deviates. Ann. Math. Stat.
**1958**, 29, 610–611. [Google Scholar] [CrossRef] - Leemis, L. Document Page of the Math Department of the College of William & Mary. Available online: http://www.math.wm.edu/~leemis/chart/UDR/PDFs (accessed on 8 May 2020).
- Formula One Digital Media Limited. F1 TV. Available online: https://f1tv.formula1.com (accessed on 29 May 2020).

**Figure 1.**Flow chart of a lap-wise discretized race simulation (based on the flow chart presented in [1]). The block “probabilistic effects” contains most of the extensions proposed in this paper.

**Figure 2.**Visualization of the lap time variability of Hamilton in Austin 2019. The deviations are the difference between real lap times and a quadratic polynomial fitted separately for every stint. The first two laps, as well as laps affected by pit stops or full course yellow phases, are not included in this process.

**Figure 3.**Histogram plot showing the differences between the pit stop durations and the minimum pit stop duration of the races for Mercedes and Force India up to a maximum deviation of 4 $\mathrm{s}$ (seasons 2014–2019).

**Figure 4.**Lap times of the drivers on positions 1–3 in Le Castellet 2018. The first laps are affected by a safety car (SC) phase, the last laps by a virtual safety car (VSC) phase. Crosses mark those lap times that are chosen to calculate the average lap time increase during SC and VSC phases. The horizontal lines indicate 140% and 160 % of the fastest lap time of the race ${t}_{\mathrm{lap},\mathrm{min}}$, which is used as a basis.

**Figure 5.**Measured data and reference curve (square root function) for the time between race start and crossing the start line ${t}_{\mathrm{s}}$ as a function of starting grid position ${p}_{\mathrm{g}}$ in the 2019 season.

**Figure 6.**Probability density functions (PDF) of the prior accident probability distribution in comparison to three driver-specific distributions of the 2018 season. Driver abbreviations: HAM–Hamilton, GRO–Grosjean, VET–Vettel.

**Figure 7.**Fraction of races in the seasons 2014–2019 with the specified number of safety car deployments.

**Figure 8.**Real and modeled cumulative distribution functions (CDF) of the start of the safety car phases in the seasons 2014–2019.

**Figure 9.**Illustration of the safety car ghost (SCG) concept. For reasons of illustration, the lap-wise discretization is disregarded here. The circle symbolizes a lap on the race track starting and ending at the finish line (FL). During normal driving (left), a race driver drives with his calculated lap time ${t}_{\mathrm{lap}}$. As soon has his race time ${t}_{\mathrm{race}}$ exceeds the start of a safety car phase, he is slowed down to ${t}_{\mathrm{lap},\mathrm{vsc}}$ and his SCG starts driving on the finish line with a lap time of ${t}_{\mathrm{lap},\mathrm{sc}}$. This is the run-up stage (center). After some time, the driver will catch up with his SCG due to its slower lap time. As he is not allowed to overtake the SCG, he will follow it and keep the minimum temporal spacing $p\phantom{\rule{0.166667em}{0ex}}\xb7\phantom{\rule{0.166667em}{0ex}}{t}_{\mathrm{gap},\mathrm{sc}}$, even though his “free” lap time would still be ${t}_{\mathrm{lap},\mathrm{vsc}}$. This is the following stage (right). At the end of a safety car phase, the SCG always disappears at the finish line.

**Figure 10.**Actual (upper graph) and simulated (lower graph) race time gaps to a virtual driver with a constant lap time in the 2018 Chinese Grand Prix. The yellow boxes mark the laps affected by a safety car phase. Driver abbreviations: VET–Vettel, BOT–Bottas, VER–Verstappen, RAI–Räikkönen, HAM–Hamilton, RIC–Ricciardo.

**Figure 11.**Resulting position distributions for three of the six simulated drivers in an exemplary race without using Monte Carlo simulation (MCS) (w/o MCS) and with using MCS (w/MCS, 10,000 simulation runs). The pit stop of Verstappen was postponed from lap 14 (strategy 1) to lap 19 (strategy 2) in this example. Driver abbreviations: HAM–Hamilton, VET–Vettel, VER–Verstappen.

**Table 1.**Overview and evaluation of the modeled probabilistic effects in motorsport published in the literature.

Modeled Effect | Bekker et al. [4] | Phillips [5] | Salminen [6] | Sulsters [7] |
---|---|---|---|---|

Starting performance | ◔ | ◑ | ◑ | ◔ |

Variability of lap time | ○ | ● | ● | ● |

Variability of pit stop duration | ◔ | ● | ○ | ○ |

Accidents and failures | ◔ | ◑ | ◑ | ◕ |

Damaged car | ○ | ○ | ◑ | ○ |

Full course yellow phases | ○ | ◑ | ◑ | ◔ |

**Table 2.**Number of accidents and (technical) failures for the drivers of Mercedes and Ferrari in the 2019 season (data from [10]).

Driver | Team | Accidents | Failures |
---|---|---|---|

Lewis Hamilton | Mercedes | 0 | 0 |

Valtteri Bottas | Mercedes | 1 | 1 |

Sebastian Vettel | Ferrari | 1 | 2 |

Charles Leclerc | Ferrari | 2 | 1 |

**Table 3.**Exemplary race times ${t}_{\mathrm{race}}$ for three drivers at the end of laps 20–22 to explain a modeling difficulty arising from the lap-wise discretization.

Lap | ${\mathit{t}}_{\mathbf{race}}$ (driver 1) | ${\mathit{t}}_{\mathbf{race}}$ (driver 2) | ${\mathit{t}}_{\mathbf{race}}$ (driver 3) |
---|---|---|---|

20 | 2000$\mathrm{s}$ | 2010$\mathrm{s}$ | 2102$\mathrm{s}$ |

21 | 2100$\mathrm{s}$ | 2120$\mathrm{s}$ | 2204$\mathrm{s}$ |

22 | 2200$\mathrm{s}$ | 2230$\mathrm{s}$ | 2306$\mathrm{s}$ |

Probability | 2 Laps | 3 Laps | 4 Laps | 5 Laps | 6 Laps | 7 Laps | 8 Laps |
---|---|---|---|---|---|---|---|

${P}_{\mathrm{sc},\mathrm{duration}}$ | 0.182 | 0.25 | 0.227 | 0.193 | 0.057 | 0.068 | 0.023 |

Probability | 1 Lap | 2 Laps | 3 Laps | 4 Laps |
---|---|---|---|---|

${P}_{\mathrm{vsc},\mathrm{duration}}$ | 0.479 | 0.396 | 0.021 | 0.104 |

**Table 6.**Time loss when driving through the pit lane under normal conditions, during a virtual safety car (VSC) phase, and during a safety car (SC) phase. The values were measured using videos from the cockpit perspective in the 2018 and 2019 seasons, which are available on F1 TV [13].

Race Track | ${\mathit{t}}_{\mathbf{pit},\mathbf{in}-\mathbf{lap}/\mathbf{out}-\mathbf{lap}}$ | ${\mathit{t}}_{\mathbf{pit},\mathbf{in}-\mathbf{lap}/\mathbf{out}-\mathbf{lap},\mathbf{vsc}}$ | ${\mathit{t}}_{\mathbf{pit},\mathbf{in}-\mathbf{lap}/\mathbf{out}-\mathbf{lap},\mathbf{sc}}$ |
---|---|---|---|

Catalunya | $19.04$$\mathrm{s}$ | $10.03$$\mathrm{s}$ | $7.88$$\mathrm{s}$ |

Melbourne | $17.85$$\mathrm{s}$ | $12.95$$\mathrm{s}$ | $12.61$$\mathrm{s}$ |

Monza | $20.60$$\mathrm{s}$ | $15.42$$\mathrm{s}$ | $10.16$$\mathrm{s}$ |

Suzuka | $19.48$$\mathrm{s}$ | $15.05$$\mathrm{s}$ | $13.60$$\mathrm{s}$ |

**Table 7.**Comparison between actual (seasons 2014–2019 for safety car (SC), 2015–2019 for virtual safety car (VSC)) and simulated (10,000 simulation runs of an exemplary race with 20 drivers) full course yellow phase fractions.

0 Phases | 1 Phase | 2 Phases | 3 Phases | |
---|---|---|---|---|

SC (actual) | 0.455 | 0.413 | 0.099 | 0.033 |

SC (simulated) | 0.462 | 0.416 | 0.091 | 0.031 |

$\Delta $ SC | 0.007 | 0.003 | −0.008 | −0.002 |

VSC (actual) | 0.637 | 0.294 | 0.040 | 0.029 |

VSC (simulated) | 0.618 | 0.304 | 0.067 | 0.011 |

$\Delta $ VSC | −0.019 | 0.010 | 0.027 | −0.018 |

**Table 8.**Mean rank positions and deviations (95 % confidence) for Hamilton in an exemplary race after 20 simulation batches.

Simulation Runs Per Batch | Mean Position | Deviation (95%) |
---|---|---|

100 | 2.115 | $\pm 0.309$ |

1000 | 2.126 | $\pm 0.082$ |

10,000 | 2.107 | $\pm 0.029$ |

100,000 | 2.107 | $\pm 0.011$ |

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Heilmeier, A.; Graf, M.; Betz, J.; Lienkamp, M.
Application of Monte Carlo Methods to Consider Probabilistic Effects in a Race Simulation for Circuit Motorsport. *Appl. Sci.* **2020**, *10*, 4229.
https://doi.org/10.3390/app10124229

**AMA Style**

Heilmeier A, Graf M, Betz J, Lienkamp M.
Application of Monte Carlo Methods to Consider Probabilistic Effects in a Race Simulation for Circuit Motorsport. *Applied Sciences*. 2020; 10(12):4229.
https://doi.org/10.3390/app10124229

**Chicago/Turabian Style**

Heilmeier, Alexander, Michael Graf, Johannes Betz, and Markus Lienkamp.
2020. "Application of Monte Carlo Methods to Consider Probabilistic Effects in a Race Simulation for Circuit Motorsport" *Applied Sciences* 10, no. 12: 4229.
https://doi.org/10.3390/app10124229