On the Friday of the 2025 Mexico City Grand Prix, the teams ran their long runs in second practice on a track at about 37 °C. Two days later the race ran on a track at about 50 °C. Every intuition you have about tyres says Sunday should have been...
In This Chapter
- 36.1 What the Weather Station Records
- 36.2 The Sun, Not the Air: Why Track Temperature Moves
- 36.3 Track Temperature and Tyre Wear: A Small, Real Effect
- 36.4 Wind: Finding the Headwind in the Speed Traps
- 36.5 Weather as a Forecasting Input
- 36.6 Rain and Safety Cars
- 36.7 The Early Switch to Intermediates: An Expected-Value Bet
- 36.8 Anchor C With Weather: What a Shower Forecast Does to the Plan
- 36.9 What the Data Can't See (and What Teams Have)
- Spaced Review
- Project Checkpoint: conditions.py
- Chapter Summary
- What's Next
Chapter 36 — Weather Analytics: Rain Probability, Track Temperature, Wind, and How Conditions Shape Performance
On the Friday of the 2025 Mexico City Grand Prix, the teams ran their long runs in second practice on a track at about 37 °C. Two days later the race ran on a track at about 50 °C. Every intuition you have about tyres says Sunday should have been harder on them: a hotter track, more sliding, more heat in the rubber, faster wear.
The timing data say the opposite. Here is the median degradation slope of the stints on each compound, using raw lap times on both days so that Friday and Sunday are measured the same way:
2025 Mexico City GP (Anchor B):
compound fp_deg race_deg fp_track race_track err err_adj
MEDIUM 0.184 0.007 36.870 50.307 0.177 0.198
SOFT 0.119 0.014 35.944 49.428 0.105 0.127
On Friday the MEDIUM lost 0.184 s per lap of tyre age. On Sunday, with the track 13.4 °C hotter, it lost 0.007 s. The forecast was wrong by 0.177 s/lap. The column err_adj is the same forecast after we "correct" it for temperature with the best within-circuit estimate this book has: it gets worse, because the correction pushes a cooler Friday's wear rate further up.
This is the race that Chapter 22 uses as Anchor B. There, a strategy model fed with practice degradation called the stop seven laps too late. Here we ask a narrower question: was the weather to blame? It was not. Across 39 dry weekends, Friday's long runs overstate Sunday's wear by a median 0.072 s/lap. The Friday-to-Sunday temperature gap explains almost none of that error, as Case Study 2 shows.
That is the theme of this chapter. Weather is real physics, and it does move lap times, tyre wear and safety-car risk. But each weather effect has a size, and the size is what matters on the pit wall. Some effects are large and easy to see in the data: rain more than doubles the chance that a lap starts a safety car. Some are real but small: ten degrees of track temperature add 0.017 s/lap to tyre wear. And some barely show up in our data at all: the station's wind, read against the speed traps, comes out in the noise. A strategist who weighs these three alike will make bad calls in all three directions.
Ray: In my day you looked at the sky over the back of the grandstand and guessed. Aisha: Now we have a weather station logging every minute. 52,954 readings. Ray: And are the guesses better? Aisha: Some of them. Ask me which ones at the end of the chapter.
In this chapter you will: - learn what the OpenF1 weather stream records, and fix its one data-quality problem; - measure how track temperature depends on the sun, the hour and the season, and how much it drifts during a race; - re-fit the track temperature → degradation relationship under three fuel treatments, and turn it into strategy terms; - locate the three speed traps on the lap from telemetry, split the wind into headwind and crosswind, and test whether trap speeds respond; - build rain nowcasts from the station's own history, and measure how much rain raises the safety-car hazard; - price the early switch to intermediates as an expected-value bet; - add weather to the Anchor C Monte Carlo, and see what a shower forecast does to the stop lap.
You will also write conditions.py, the Box Box module that turns weather into simulator inputs.
📊 Analytics Track: This is your chapter. Every section has a regression, a nowcast or a Monte Carlo, and Section 36.4 has an identification problem worth studying for its own sake: the data do not say which way is north.
🎰 Betting Track: Read 36.5 to 36.8. Markets react to forecasts. Here you will learn which weather effects are big enough to move a race outcome and which are noise. Chapter 38 picks up the weather "edge" as a hypothesis.
🔧 Engineering Track: Sections 36.2 (the sun and the track), 36.3 (temperature and wear) and 36.4 (wind and drag) are the physics. Pair them with the aerodynamics of Chapter 3 and the thermal tyre model of Chapter 5.
36.1 What the Weather Station Records
Every OpenF1 session comes with a weather table. It holds one record about once a minute from the circuit's weather station. Our archive has 52,954 records in 470 sessions, including testing. Each record has seven measurements:
| Field | Unit | What it is |
|---|---|---|
air_temperature |
°C | air temperature at the station |
track_temperature |
°C | surface temperature of the asphalt at the station's sensor |
humidity |
% | relative humidity |
pressure |
hPa (mbar) | air pressure |
rainfall |
0/1 | the station's rain flag |
wind_speed |
m/s | wind speed |
wind_direction |
° | wind direction, 0–359 |
📐 Definition: A weather record is one row of the OpenF1 weather table: the station's reading at one moment. The toolkit merges the nearest record (within 10 minutes) onto every lap, so each row of f1data.laps() also carries track_temperature, rainfall, wind_speed and the rest (README §4).
Three limits apply to every result in this chapter, so read them first.
- It is one station. The track temperature is the reading of one sensor at one place on the circuit. A 5 km lap has shaded sections, sunny sections, kerbs and painted lines, and the station sees none of that variety. The same is true for wind: one anemometer, at one height, in one spot.
- The rain flag is not track wetness.
rainfall = 1says the station detected rain. It does not say how much water is on the racing line. A session can show a rain flag with every car on slicks (drizzle), or wet tyres with no flag at all (a track still wet from earlier rain). Chapter 15 builds its wetness gauge from lap times for exactly this reason. - There is no forecast. The archive contains what happened, not what the teams' meteorologists predicted. Every "forecast" in this chapter is a baseline built from the archive itself. A real weather service has radar and models, and it must beat these baselines to be worth paying for.
The one data-quality problem
Run a quick check of the ranges and one field looks wrong:
raw = f1data.table("weather")
bad = raw[raw.track_temperature <= 0]
print(f"Track temperature <= 0 C: {len(bad)} records ({(bad.kind.astype(str).str.startswith('T')).sum()} in testing), "
f"in {bad.session_key.nunique()} sessions; min {bad.track_temperature.min():.1f} C")
Weather records in the archive: 52,954 in 470 sessions
Track temperature <= 0 C: 45 records (1 in testing), in 26 sessions; min -16.5 C
by session kind: {'FP3': 21, 'R': 10, 'FP1': 4, 'Q': 4, 'FP2': 4, 'SQ': 1, 'T3': 1}
Non-testing records kept: 44,877 in 455 sessions; dropouts set to missing: 44
Median spacing between records: 60.0 s (90th pct 60.0 s)
Forty-five readings of the track temperature are 0.0 °C or below. One is −16.5 °C, in testing. None of these sessions ran on a frozen track: the air temperature in the same records is normal, and the readings on either side are normal. These are sensor dropouts. A reading of exactly 0.0 is what a logger often writes when the sensor returns nothing.
⚠️ Common pitfall: Averaging the raw track temperature over a session. One 0.0 °C dropout in a 90-record race pulls the mean down by about 0.4 °C, which is enough to move a stint across a temperature bin. The 2026 Bahrain GP in Malaysia race has two of them; one sits 73 minutes into the weather log, between two readings of 34.7 °C. The fix: set readings of 0.0 °C or below to missing before you do anything else, and use medians rather than means for session summaries. Every script in this chapter does this through ch36_common.weather_clean(), and Box Box does it through conditions.clean_weather().
With the dropouts removed, here are the ranges across the 455 non-testing sessions:
count min 5% 50% 95% max
air_temperature 44877.0 10.7 14.7 24.5 31.9 35.8
track_temperature 44833.0 10.9 18.4 36.9 51.0 62.7
humidity 44877.0 10.5 24.0 53.7 82.9 96.0
pressure 44877.0 778.5 919.6 1006.7 1020.9 1031.0
wind_speed 44877.0 0.0 0.5 1.6 3.9 9.6
The pressure column has a long left tail. The low values (778.5 hPa) come from Mexico City, which sits high above sea level. Thin air there means low air density: Chapter 1 computed 0.909 kg/m³ for 2026 Mexico City qualifying, and Chapter 3 computed 0.904 and 0.905 kg/m³ for 2025 and 2026 with a humidity correction, about 21% below the typical session. Those chapters own the density story, and the lesson they draw is that Mexico's thin air cuts drag and downforce together. We will not repeat it. This chapter takes the other weather variables in turn.
Median wind is gentle, at 1.6 m/s (5.8 km/h), and 95% of readings are below 3.9 m/s. The strongest gust in the archive is 9.6 m/s, in first practice at the 2024 Dutch GP. Keep those numbers in mind for Section 36.4: the wind we have to work with is mostly a breeze.
Race-day track temperature by circuit
For the rest of the chapter, a race-window statistic uses only the records between the start of lap 1 and the end of the last lap. That way a pre-race shower or a post-race cool-down does not count as race weather.

📊 Figure (described): One row per circuit, sorted by its median race track temperature. The markers show each year's race median (2023 circle, 2024 square, 2025 triangle, 2026 diamond), and the grey bar shows the coldest and hottest reading across all its races. Las Vegas sits alone at the cold end, around 14–18 °C. The hottest races are at Madring, the Red Bull Ring, the Hungaroring, Catalunya and Monza, at 45–55 °C. Many circuits span 20 °C or more between their coldest and hottest race.
Race-median track temperature: median 35.6 C, range 13.7-54.9; air: median 24.9, range 11.9-34.5
event track_med air_med local_start
2026 Italian GP 54.9 32.5 15.0
2026 Spanish GP 54.0 31.1 15.1
2026 Austrian GP 51.1 34.6 15.0
2026 Las Vegas GP 13.7 11.9 20.0
2024 Las Vegas GP 17.2 17.6 22.0
2025 Las Vegas GP 17.3 16.4 20.1
Largest between-year swings of race-median track temperature (circuits with >= 3 races):
min max count swing
circuit_ref
villeneuve 18.5 49.8 4 31.3
interlagos 24.5 47.5 4 23.0
suzuka 19.6 39.2 4 19.6
catalunya 30.4 49.9 4 19.5
albert_park 19.2 38.6 4 19.4
red_bull_ring 31.9 51.1 4 19.2
The spread between circuits is large: the hottest race (2026 Italian GP, 54.9 °C) ran on a track 41 °C hotter than the coldest (2026 Las Vegas GP, 13.7 °C). The spread within a circuit is large too. The Canadian GP ran at 18.5 °C in one year and 49.8 °C in another. Suzuka spans 19.6 °C because the race moved from September (2023) to spring (2024 onward); Case Study 1 follows that change through the tyre data.
Those numbers set the scale for Section 36.3. To use "weather" as a strategy input, we need to know how much a typical year-to-year change at one circuit does to the tyres. The typical within-circuit standard deviation of race-median track temperature is 6.2 °C (median across the 23 circuits with at least three races; range 0.9–13.4 °C).
36.2 The Sun, Not the Air: Why Track Temperature Moves
The track is not warmed by the air around it. It is warmed by the sun and cooled by the air. Asphalt is dark, so it absorbs most of the sunlight that falls on it. It loses that heat by radiating it back to the sky, by conduction into the ground and by convection into the air above it, which the wind speeds up. The track temperature settles where gains and losses balance.
We can write a one-line energy balance for one square metre of surface:
$$ \underbrace{(1-a)\,G}_{\text{solar gain}} \;=\; \underbrace{h\,(T_{\text{track}} - T_{\text{air}})}_{\text{convection}} \;+\; \underbrace{\varepsilon\sigma\left(T_{\text{track}}^4 - T_{\text{sky}}^4\right)}_{\text{radiation}} \;+\; \underbrace{q_{\text{ground}}}_{\text{conduction}} $$
where $G$ is sunlight (W/m²), $a$ the asphalt's reflectivity (albedo), $h$ a convective coefficient that rises with wind, $\varepsilon\sigma T^4$ the radiated heat, and $q_{\text{ground}}$ the heat flowing down into the road. In plain English: the track runs hotter than the air by however much it takes to throw away the sunlight it absorbs. More sun means a bigger excess, and more wind means a smaller one.
A worked number shows the scale (🧪 the parameters are textbook-style assumptions, not measurements of any circuit): with $G = 800$ W/m², $a = 0.1$ and a convective coefficient of $h = 25$ W/m²K, and if convection alone carried away half of the 720 W/m² absorbed, the excess would be $360/25 \approx 14$ °C. That is about what we measure at midday. At night $G = 0$, the solar term vanishes, and the track can only be as warm as its stored heat allows.
The data show exactly this. Here is the track-minus-air excess binned by the local clock time at the circuit:
Track minus air (C) by local clock hour, all non-testing sessions:
median q25 q75 n
hour_bin
11 12.9 6.3 18.2 1882
12 14.8 8.8 19.9 4490
13 17.3 12.5 20.5 4945
14 15.7 11.1 19.6 5710
15 13.3 9.3 17.9 7019
16 13.0 8.5 17.1 8692
17 9.9 6.1 13.8 5043
18 5.1 4.0 7.6 1681
19 4.8 3.4 6.8 1231
20 4.7 2.9 5.7 1749
21 4.4 2.8 5.2 1315
22 1.9 0.2 4.3 420
23 -0.2 -0.4 1.8 119
Excess after 19:00 local: median 4.3 C (n 5,041); 12:00-16:00: 15.1 C (n 22,164)
Excess while the rain flag is set: median 5.0 C (n 2,093); dry records same hours 12-16: 15.7
Daytime (12-16 h, dry) OLS: excess = 21.0 + 0.07 x air C + -0.149 x humidity % (n 20,974)

📊 Figure (described): The median track-minus-air excess (blue line) and its middle 50% (shaded) by local hour. The excess peaks at about 17 °C at 13:00, falls through the afternoon, and is around 4–5 °C in the evening sessions of Singapore, Bahrain, Jeddah and Qatar. It reaches roughly zero just before midnight (Las Vegas). The track is hotter than the air by an amount set by the sun.
Three readings follow.
- Time of day sets the excess. At 13:00 the median track is 17.3 °C hotter than the air; after 19:00 it is 4.3 °C hotter. A night race is not just cooler air; it is a track that has lost its solar heating.
- Clouds and rain kill the excess. While the rain flag is set, the excess falls to 5.0 °C, against 15.7 °C in dry daytime records. The daytime regression makes the same point through humidity, which stands in here for cloud: each 10 points of humidity takes about 1.5 °C off the excess. (Humidity and cloud are correlated, not the same thing; we have no cloud or sunshine channel.)
- Air temperature matters little once you know the hour. In the daytime regression, a degree of air adds only 0.07 °C to the excess, because the excess is mostly about sunlight.
📺 On the broadcast: When the graphics show "Air 24 °C, Track 41 °C", the 17-degree gap is the sun. When a cloud bank rolls over and the track figure drops five degrees in ten minutes, the asphalt has not been chilled by the air. It has simply lost its heat source, and it is radiating heat away faster than the weakened sun replaces it.
How much does track temperature drift in a race?
A race lasts about 90 minutes, and the sun moves. Here is how much the track temperature changes from the first 10 minutes of racing to the last 10, in the 78 dry Grands Prix with readings at both ends:
Track temperature drift, first 10 min vs last 10 min of the race (dry races, n 78): median -2.0 C, 10th-90th pct -6.6 to +0.1; |drift| >= 5 C in 21%
count 50% min max
slot
afternoon start 58.0 -2.1 -10.5 2.1
evening / night start (>= 17:00) 20.0 -1.6 -2.4 -0.7
event local_start track_start track_end drift
2026 Monaco GP 15.0 43.1 32.6 -10.5
2026 Mexico City GP 14.0 45.1 35.0 -10.1
2023 Australian GP 15.0 34.2 24.4 -9.9
2026 Canadian GP 16.2 17.1 18.7 1.6
2024 Dutch GP 15.0 29.8 31.8 1.9
2026 Belgian GP 15.0 28.6 30.8 2.1

📊 Figure (described): Histograms of the start-to-finish change in track temperature, for afternoon starts (blue) and evening or night starts (orange). Almost all races cool. The afternoon races spread from −10.5 to +2.1 °C, and one in five changes by 5 °C or more. The night races are tightly bunched between −2.4 and −0.7 °C.
The median race cools by 2 °C, and one in five changes by 5 °C or more. The biggest drops come in afternoon races where the shadows lengthen or clouds arrive: the 2026 Monaco GP lost 10.5 °C. Night races barely drift, because there is no sun to lose. They start cooled down already.
This matters for strategy because a stint does not run at "the race's" temperature. A driver who starts on the soft at 43 °C and runs the final stint on the hard at 33 °C (as at Monaco 2026) is running the two compounds in different conditions. If you fit degradation by compound without asking when each stint ran, part of what you call "compound" is really "time of day".
🔄 Check your understanding 1. A session shows air 22 °C, track 23 °C at 14:00 local time. What is the most likely explanation? 2. Why do night races drift less than afternoon races?
Answer
- Heavy cloud or rain. At 14:00 the median dry excess is about 16 °C; an excess of 1 °C means the sun is not reaching the track. Check the
rainfallflag and the humidity. A sensor problem is possible too, but dropouts read 0.0 °C, not 23 °C.- Most of the drift in an afternoon race is the sun weakening or going behind cloud. A night race has no solar heating to lose, so the track only cools slowly, as its stored heat leaks away (−0.7 to −2.4 °C in our 20 evening races).
36.3 Track Temperature and Tyre Wear: A Small, Real Effect
Chapter 5 explains the mechanism. A tyre has an operating window, and its wear rate depends on the temperature of its surface and carcass. A hotter track feeds heat in through the contact patch and slows the rate at which the tyre can shed heat to the road. The rubber runs hotter, its hysteresis changes and the surface wears faster. Chapter 5 also measured the effect at +0.017 s/lap per +10 °C and calibrated its thermal model to match. Here we re-fit that estimate, look at how it depends on the fuel correction, and then ask the question a strategist cares about: is it big enough to change a strategy?
The regression
📐 Definition: The degradation rate of a stint is the canonical metrics.degradation() slope: the OLS slope of lap time on tyre age, over clean laps after the first lap of the stint, in s/lap per lap of tyre age (the toolkit README defines it; Appendix B lists it). We use dry races only (no INTERMEDIATE/WET lap and no rain flag on any lap: 76 of 91 races) and stints with at least 8 usable laps. Each stint's track temperature is the mean of its laps' readings, dropouts removed.
The data cover 3,262 stints in 76 races, with stint track temperatures from 13.6 to 55.3 °C. The model is
$$ \text{deg}_{s} = \beta\, T_s + \gamma_{\text{compound}(s)} + \delta_{\text{circuit}(s)} + \varepsilon_s $$
where $T_s$ is the stint's track temperature and the $\gamma$ and $\delta$ terms are compound and circuit fixed effects. In plain English: within one circuit and one compound, does a stint run on a hotter track wear faster? The circuit effect absorbs everything permanent about a circuit, such as its abrasive surface, its high-energy corners and its usual weather. That leaves only the departures from that circuit's normal temperature to identify $\beta$.
There is one more choice to make: the fuel correction. Every degradation number in this book says which correction it uses, because the answer depends on it. In raw lap times the falling fuel load hides most of the wear, so we fit the model three ways:
Median stint slope by compound and fuel treatment (s/lap):
deg_canonical deg_raw deg_datafuel
compound
HARD 0.048 -0.002 0.052
MEDIUM 0.051 0.003 0.054
SOFT 0.064 0.018 0.061
Degradation slope on stint track temperature, s/lap per +10 C (95% CI clustered by race):
fuel model per_10C lo hi stints races
canonical compound FE 0.0103 -0.0013 0.0220 3262 76
canonical compound + circuit FE 0.0169 0.0077 0.0260 3262 76
canonical compound + circuit + season FE 0.0145 0.0054 0.0236 3262 76
datafuel compound FE 0.0068 -0.0065 0.0202 3262 76
datafuel compound + circuit FE 0.0195 0.0104 0.0285 3262 76
datafuel compound + circuit + season FE 0.0181 0.0084 0.0277 3262 76
raw compound FE 0.0130 0.0010 0.0251 3262 76
raw compound + circuit FE 0.0169 0.0077 0.0260 3262 76
raw compound + circuit + season FE 0.0145 0.0054 0.0236 3262 76
The first block reproduces the book's reference rates. They are fuel-corrected at the toolkit's assumed 100 kg start fuel and 0.03 s/kg, and they match the canonical values exactly (SOFT 0.064, MEDIUM 0.051, HARD 0.048 s/lap). Without the correction the MEDIUM and HARD slopes are about zero, which is the lesson Chapter 20 teaches: fuel burn and tyre wear roughly cancel in race trim.
The second block is the one to quote. Within circuit, +10 °C of track temperature adds +0.017 s/lap to the degradation rate (95% CI +0.008 to +0.026), with the canonical fuel correction. With the data-driven fuel correction (each race's own fuel-plus-track-evolution slope from metrics.estimate_fuel_effect) it is +0.020 (+0.010 to +0.029). Adding season fixed effects gives +0.015.
🔍 Why this works: Why do the canonical and raw columns give the same within-circuit slope (0.0169 in both), when their degradation levels differ by about 0.05 s/lap? The canonical correction adds a fixed amount to every stint's slope at a given race: 3.0 s spread over the race distance, or 3.0/N s/lap. Within one circuit, N is almost the same every year, so the correction is close to a constant and the circuit fixed effect absorbs it. Temperature differences within a circuit are therefore estimated from the same lap-time changes either way. The data-driven correction is different. It varies race by race, because each race gets its own estimated fuel-plus-evolution slope, so it can move the temperature estimate (to 0.020). The general rule: a correction that is constant within your fixed-effect groups cannot change a within-group slope; a correction that varies within them can.

📊 Figure (described): Three panels, one per fuel treatment. Each grey dot is a stint, plotted as its degradation rate minus its circuit-and-compound mean, against its track temperature minus that mean. The blue line is the median per 2 °C bin, and the orange line is the fitted slope. In all three panels the bins rise gently, from about −0.03 s/lap at 12 °C colder than usual to about +0.01 at 8 °C warmer. The scatter of individual stints (±0.1 s/lap) is far wider than the temperature effect.
⚠️ Common pitfall: Quoting the across-circuit estimate (first row, +0.010, CI including zero) as "the temperature effect". Hot circuits differ from cool ones in many ways besides temperature: surface, layout, tyre allocation. Comparing Bahrain with Las Vegas mixes all of that with the weather. The fix: for "what does a hotter day do here?", use the within-circuit estimate, and say which fuel correction it carries.
From a regression coefficient to a pit wall number
What does +0.017 s/lap per 10 °C mean in race terms? Take the question every weather preview asks: "how does a 5 °C change in track temperature affect tyre degradation?"
Main estimate (canonical fuel correction, within circuit): +0.0017 s/lap per C = +0.008 per +5 C [+0.004, +0.013]
+5 C over a 20-lap stint (sum of ages 0..19): +1.60 s
+5 C over a 25-lap stint (sum of ages 0..24): +2.53 s
+5 C over a 30-lap stint (sum of ages 0..29): +3.67 s
A degradation increase $\Delta d$ adds $\Delta d \times$ (tyre age) on every lap. Over a stint of $n$ laps on a new set, the extra time is
$$ \Delta t_{\text{stint}} = \Delta d \sum_{a=0}^{n-1} a = \Delta d \,\frac{n(n-1)}{2}. $$
In plain English: extra wear costs nothing on lap one and a little more each lap after, so the total grows with the square of the stint length. Worked number: +5 °C gives $\Delta d = 0.0084$ s/lap. Over 25 laps, $0.0084 \times 25 \times 24/2 = 2.5$ s.
So a five-degree warmer Sunday costs a car about 2.5 s over a 25-lap stint, compared with what Friday's conditions would predict. That is real, but it is a tenth of one pit stop. It changes strategy only when a race is already close to the line between two plans.
How far is each circuit from the one-stop / two-stop line?
Chapter 12 derives the critical degradation rate at which one more stop pays for itself, for equal stints on one compound:
$$ d^* = \frac{2(n+1)(n+2)\,L}{N^2} \quad\xrightarrow{\;n=1\;}\quad d^* = \frac{12\,L}{N^2}, $$
where $L$ is the green-flag pit loss and $N$ the race distance in laps. In plain English: a second stop pays when wear is fast enough that splitting the race into three shorter stints saves more tyre time than one extra pit loss. Worked number: at Suzuka, $L = 22.554$ s (the circuit's pooled green-flag pit loss) and $N = 53$, so $d^* = 12 \times 22.554 / 53^2 = 0.096$ s/lap. The measured Suzuka median, fuel-corrected at the toolkit assumption, is 0.057, so the gap is 0.039 s/lap. At 0.0017 s/lap per °C, closing that gap would take 23 °C of extra track temperature.
02_track_temp_and_deg.py repeats this for every circuit, using its pooled green-flag pit loss and its median canonical stint slope.

📊 Figure (described): One bar per circuit. Blue bars point right: the circuit is in one-stop territory, and the bar is how much hotter the track would have to be before a second stop paid. Orange bars point left: the circuit is already past the line, and the bar is how much colder would make one stop enough. The grey band is ±12 °C, two typical year-to-year standard deviations of race track temperature. Only seven circuits fall inside it: Interlagos, the Hungaroring, Mexico City, Zandvoort, Montreal (
villeneuve), Shanghai and Yas Marina. Losail, Las Vegas, Baku, Madring and Jeddah would need 53–68 °C more, which no weather can deliver.
Within-circuit SD of race-median track temperature (circuits with >= 3 races, n 23): median 6.2 C (range 0.9-13.4)
Circuits within +-12 C (2 typical SDs) of the line: interlagos, hungaroring, rodriguez, zandvoort, villeneuve, shanghai, yas_marina
🧪 Illustrative model: The line $d^* = 12L/N^2$ assumes equal stints, one compound and linear wear, and it ignores warm-up, compound offsets, traffic and track position. The bars are a ruler, not a prediction. They say how much temperature it would take; they do not say what teams would do.
The answer to "does weather change strategy?" is, for temperature alone, rarely. At most circuits the gap between one stop and two is worth 15 °C or more, and a typical year's weather moves the track by 6 °C. The exceptions are circuits already near the line: Mexico City sits 1 °C from it in this model and the Hungaroring 4 °C on the other side. There, a hot or cold Sunday can tip the plan.
🔄 Check your understanding 1. Race day is forecast 8 °C hotter than Friday's long runs. Using the within-circuit slope, how much extra time does that add over a 30-lap stint? 2. Why is the across-circuit estimate (+0.010 s/lap per 10 °C) a worse answer to that question than the within-circuit one (+0.017)?
Answer
- $\Delta d = 0.00169 \times 8 = 0.0135$ s/lap. Over 30 laps: $0.0135 \times 30 \times 29/2 = 5.9$ s (the checkpoint output prints a similar number, −5.53 s, with the sign flipped for −8 °C, from the module's stored slope of 0.00159). That is about a quarter of a pit stop.
- Across circuits, "hot" also means "Bahrain-like surface and layout", and "cold" means "Las Vegas-like". The question is about this circuit on a hotter day, and only the within-circuit comparison holds the circuit fixed.
Tom: So the tyre engineers who talk about temperature all weekend are wasting their breath? Aisha: No. Temperature moves the window, and Chapter 5 shows that's real: preparation laps, warm-up, graining. What it barely moves is the race-average wear rate. That's a different number. Tom: One's about getting the tyre working. The other's about how fast it dies. Aisha: And the pit wall's stop-lap maths only sees the second.
36.4 Wind: Finding the Headwind in the Speed Traps
Wind is where weather meets aerodynamics most directly. A car's drag and downforce depend on its speed through the air, not over the ground. With a headwind of $w$ m/s, the car at ground speed $v$ meets air at $v + w$.
The physics benchmark
On a long straight, a car at full power accelerates until the power the engine delivers equals the power drag absorbs. Ignoring rolling resistance, that terminal speed satisfies
$$ P = \tfrac12 \rho\, C_dA\,(v + w)^2\, v . $$
Differentiate both sides with respect to $w$ at $w = 0$ (power fixed):
$$ 0 = \tfrac12\rho C_dA\left[2(v+w)v\left(1 + \frac{dv}{dw}\right) + (v+w)^2\frac{dv}{dw}\right]_{w=0} \;\Rightarrow\; 2v^2\left(1 + \frac{dv}{dw}\right) + v^2\frac{dv}{dw} = 0 \;\Rightarrow\; \frac{dv}{dw} = -\frac{2}{3}. $$
In plain English: at terminal speed, every metre per second of headwind costs two-thirds of a metre per second of ground speed. The air still has to be pushed aside at nearly the same rate, so the ground speed gives up most of the wind's speed. Worked number: 1 m/s of headwind is 3.6 km/h, so terminal speed falls by $\tfrac23 \times 3.6 = 2.4$ km/h. A tailwind of the same size adds about the same. With a median station wind of 1.6 m/s, a straight that runs into the wind would read about 4 km/h slower than one running with it.
That is a benchmark, not a prediction. Cars rarely reach full terminal speed before they brake. Downforce drag and DRS (in 2023–2025) or Straight Mode (in 2026) change the drag. And a station anemometer measures the wind at its own height and place, while the car sits a few centimetres off the ground, where the boundary layer and the grandstands slow the air. All of these push the real effect below −2.4 km/h per m/s. The data have to tell us by how much.
🧩 Productive struggle: which way is the car pointing?
Before reading on, try to design this test yourself. You have three things:
- the
wind_speedandwind_directionof the station, once a minute; - three speed traps per lap:
i1_speed,i2_speedandst_speed(km/h), with no documented location on the track; - for qualifying sessions, the car's
x, yposition at about 4 Hz, in an undocumented coordinate frame.
To compute a headwind you need the car's heading at the trap, as a compass bearing. What steps do you need, and which of them can fail? Write down your plan, then compare it with ours.
Our plan, and the step that can fail
- Locate each trap on the lap. Put a qualifying lap's speed trace on a normalised distance grid. A trap sits where the trace reads what the trap reads. One lap gives many candidate points, because the car passes 320 km/h twice on most straights. So use a dozen laps and pick the point where the median mismatch across laps is smallest.
- Read the heading from the
x, ypath around that point. - Convert the heading to a compass bearing. This needs to know how the
x, yframe sits relative to north. This is the step that can fail. OpenF1 does not document the frame as north-up, and nothing in our data fixes it. - Split the wind into a component along the heading (headwind positive) and one across it, and regress trap speed on them.
Step 3 is the trap (in both senses). The trick is to fit the model in a way that lets the data choose the frame rotation, and see whether the choice makes physical sense.
Step 1: locating the traps
03_wind_speed_traps.py locates the traps on every qualifying session with location data:
def locate(q, max_laps=12):
lp = f1data.laps(q).dropna(subset=["lap_duration"] + TRAPS)
lp = lp[lp.lap_duration <= 1.03 * lp.lap_duration.min()] # push laps only
best = lp.sort_values("lap_duration").groupby("acronym").head(1).head(max_laps)
... # speed, x, y on a 2,001-point grid
for j, trap in enumerate(TRAPS):
err = np.median(np.abs(V - T[:, [j]]), axis=0) # |trace - this lap's trap| at each point
i = int(np.argmin(err)) # best agreement across laps
psi = heading(i - d, i + d) # direction over +-60 m
turn = abs(((heading(i, i + D) - heading(i - D, i)) + 180) % 360 - 180) # +-150 m: on a straight?
Qualifying sessions with traps located: 90 (traps 270)
Match error (median |trace - trap| at the located point): median 0.5 km/h, 90th pct 1.6
Traps on a straight (turn <= 20 deg over +-150 m) and well matched (<= 4 km/h): 214 of 270
ok v turn
trap
i1_speed 0.78 286.50 6.44
i2_speed 0.66 272.25 9.67
st_speed 0.94 321.00 1.45
Same trap located in >= 2 seasons (60 circuit-traps): median SD of position 0.49% of a lap; median SD of heading 0.4 deg
The method works well. At the located point the traces agree with the traps to a median 0.5 km/h. When the same trap at the same circuit is located independently in different seasons, it lands in the same place to within half a percent of a lap, with the heading stable to 0.4°. The main speed trap (st_speed) is on a straight 94% of the time. The intermediate traps sometimes sit in fast curves, so we keep only the 214 traps that are on a straight (heading change ≤ 20° over ±150 m) and well matched (≤ 4 km/h).

📊 Figure (described): Verstappen's 2025 Monza pole lap drawn as a speed-coloured track map. Black circles mark the three located traps: ST (median 348 km/h) on the main straight before the first chicane, I1 (324 km/h) and I2 (340 km/h) on the straights of the back half. Black arrows show the direction of travel at each one. Each trap matches its readings to within 0.2–0.3 km/h. The blue arrow at the bottom right shows the session's median wind, 1.5 m/s from 177°, drawn on the assumption that the plot is north-up.
Steps 2–4: the regression, with a free frame
For every green, dry, timed lap at those circuits, in every session kind, we take each straight-line trap reading and the station wind at that lap. That gives 249,216 lap-trap readings in 359 sessions at 26 circuits. Practice and qualifying laps within 107% and 103% of the driver's best are included. Pit laps, lap 1, SC/VSC/yellow laps and wet laps are dropped.
Suppose we read the x, y frame as north-up (x east, y north). Call that hypothesis H0. Then the heading gives a bearing $h$, and with wind speed $W$ from direction $\theta$ the components are
$$ A = W\cos(\theta - h) \;\;(\text{headwind}), \qquad B = W\sin(\theta - h) \;\;(\text{crosswind}). $$
If the true frame is rotated by an unknown angle $\phi$, the true headwind is $W\cos(\theta - h - \phi) = A\cos\phi + B\sin\phi$. So we fit
$$ v_{\text{trap}} = \alpha_{\text{driver}\times\text{session}\times\text{trap}} + \beta_A A + \beta_B B + \tau\, t + \varepsilon , $$
where $t$ is minutes into the session. In plain English: within one driver, one session and one trap, are the laps with more headwind (by our reading of north) slower? The fixed effect $\alpha$ absorbs the car, the driver, the engine mode and the trap's own speed. The pair $(\beta_A, \beta_B)$ measures the wind response whatever the frame: its size $\sqrt{\beta_A^2 + \beta_B^2}$ does not depend on $\phi$, and its direction gives the rotation the data prefer. If H0 is right and physics works, $\beta_A$ is negative and $\beta_B$ is about zero.
Lap-trap observations: 249,216 (359 sessions, 26 circuits); by kind: {'R': 172860, 'FP1': 26072, 'FP2': 21865, 'S': 14233, 'FP3': 8443, 'Q': 4753, 'SQ': 990}
Within-group SD: trap speed 7.34 km/h, along-wind A 0.84 m/s, wind speed 0.64 m/s
Pooled, within driver x session x trap, cluster bootstrap by session (400 draws, seed 42):
A (along, headwind under H0): -0.084 km/h per m/s [-0.209, +0.045]
B (across under H0): +0.095 [+0.000, +0.193]
time trend: +0.0142 km/h per min [+0.0008, +0.0246]
amplitude 0.127 km/h per m/s; preferred frame rotation -49 deg (bootstrap 95% -120 to -1)
amplitude bootstrap 95%: 0.043 to 0.240 km/h per m/s (any frame rotation); the physics benchmark is 10x the upper end
Physics benchmark (terminal speed, drag only): dv/dw = -2/3 -> -0.667 km/h per km/h = -2.40 km/h per m/s

📊 Figure (described): Left: trap speed (relative to the driver's own session average at that trap) against the along-track wind component under H0, binned every 0.5 m/s with 95% error bars. Right: the same against the across-track component. Both lines are nearly flat, within ±0.5 km/h across ±2.5 m/s of wind. The orange dotted line on the left is the terminal-speed benchmark of −2.4 km/h per m/s; the data run nowhere near it.
Here is what the data say, plainly.
- The headwind effect under H0 is −0.08 km/h per m/s, with a 95% interval from −0.21 to +0.05. It has the expected sign, but it is not distinguishable from zero.
- Whatever the frame, the response is small. The amplitude, which does not depend on the rotation, is 0.13 km/h per m/s (0.04–0.24). The terminal-speed benchmark is ten times the upper end of that interval.
- The data cannot fix the frame. The preferred rotation is −49°, with a bootstrap interval from −120° to −1°. That interval stops just short of H0 (0°), and it also includes rotations that would make H0 badly wrong. There is too little signal to orient the map.
- The time trend is larger than the wind. Trap speeds rise by 0.014 km/h per minute within a session, about 1.3 km/h over a 90-minute race. That is the falling fuel load and the rubbering-in of the track, and it is why the model includes the trend.
Circuit by circuit, the H0 headwind coefficients scatter around zero:

📊 Figure (described): One row per circuit (number of sessions in brackets), showing the trap-speed change per m/s of H0 headwind with its 95% interval. The estimates spread from −0.7 (Jeddah) to +0.7 (Marina Bay). Twenty-two of 24 intervals include zero. All lie far to the right of the −2.4 benchmark (dotted line).
Circuits whose H0 headwind CI is below 0: 2; above 0: 0; of 24
Preferred rotations: circular mean -35 deg, resultant length R = 0.32 (1 = all identical, ~0.20 expected if random)
Two circuits out of 24 have an interval entirely below zero: Jeddah (−0.68, from −1.41 to −0.19) and Mexico City (−0.19, from −0.47 to −0.02). With 24 independent tests at the 95% level, you would expect about one such result by chance, so two is weak evidence at best. The per-circuit preferred rotations barely cluster: their resultant length is 0.32, against about 0.20 if they were random directions.
Why so small? We can list candidates but cannot separate them with these data:
- The station is not the straight. One anemometer, possibly sheltered or high above the track, does not measure the wind a car meets on a straight a kilometre away between grandstands.
- The traps are not at terminal speed. Most traps sit where the car is still accelerating. A car that has been on the straight for only a few seconds has not yet lost much speed to extra drag.
- Noise swamps it. Within a driver's own session at one trap, speed varies with an SD of 7.34 km/h because of tow, DRS, battery deployment and traffic. Wind varies with an SD of 0.84 m/s along the track. Even the full benchmark would explain only a small share of that variance.
- The frame may be wrong. If the
x, yframe is not north-up, every "headwind" here is partly a crosswind. The free-rotation amplitude rules this out as the whole explanation: even at the best rotation, the response is at most 0.24 km/h per m/s.
What the data can't see: on-car air speed (teams have a pitot sensor; we don't), wind at track level, gusts between the one-minute readings, and crosswind effects on balance in fast corners. The common claim that crosswind in high-speed corners destabilises the car may well be true. Testing it would need steering, yaw rate or lateral acceleration, and the free telemetry has no steering channel.
So, for Box Box: do not model station wind as a lap-time input. The data cannot show an effect, and a simulator that added one would be adding noise. The module still provides wind_component() and locate_speed_traps(), because a reader with better wind data (a track-side anemometer, or a team's own) can use the same pipeline.
📺 On the broadcast: "There's a strong tailwind down the back straight this year, so watch the speed traps." Sometimes there is. But when you hear it, check the trap figures across the field over a few laps. In our data, the lap-to-lap spread from tow and deployment is about thirty times the station-wind effect we can detect.
🔄 Check your understanding 1. Why does the free-rotation fit ($\beta_A A + \beta_B B$) let us bound the wind effect even though we do not know where north is? 2. The time trend (+0.014 km/h per minute) is significant and the wind term is not. Why is it important to include the trend anyway?
Answer
- Any rotation of the frame turns the true headwind into a mix of $A$ and $B$ with weights $\cos\phi$ and $\sin\phi$. The vector $(\beta_A, \beta_B)$ therefore has the same length whatever $\phi$ is; only its direction changes. A short vector (0.13, interval 0.05–0.24 km/h per m/s) means a small effect in every frame.
- Wind speed tends to change through a session (it often picks up in the afternoon), and trap speeds rise through a session for other reasons (fuel burn, rubber). Without the trend, that shared drift could create or hide a wind effect.
36.5 Weather as a Forecasting Input
A strategist does not need to know the weather. They need to know the weather in the next 20 laps, and Sunday's weather on Saturday night. Our archive has no forecasts, but it can tell us how well the simplest forecasts work. These baselines are the bar any real forecast must clear.
Nowcasting rain from the station's own record
📐 Definition: A nowcast is a very short-range forecast (minutes to an hour) made from current observations. The simplest uses only the present state: is it raining at the station now?
04_weather_forecasting.py treats the rain flag as a minute-by-minute sequence in each session and counts what happened $k$ minutes later.
Rain spells (consecutive records with rainfall = 1): 253 in 85 sessions
length in minutes: median 3, 75th pct 9, 90th 21, max 88; single-record spells 26%
Per-minute transitions, all non-testing sessions: P(rain next | dry now) = 0.0055 (n 42,333), P(rain next | rain now) = 0.8899 (n 2,089)
implied mean spell 9.1 min; mean dry gap 182 min; long-run rain share 0.047 vs observed 0.047
P(rain flag k minutes ahead), empirical vs two-state Markov chain:
label dry now dry now, rain in last 30 min raining now
k
1 0.005 0.052 0.890
2 0.009 0.077 0.827
5 0.013 0.106 0.736
10 0.019 0.135 0.621
15 0.022 0.139 0.552
20 0.025 0.140 0.504
30 0.026 0.125 0.457
45 0.030 0.146 0.369
60 0.033 0.172 0.290
The simplest model of the flag is a two-state Markov chain: each minute, a dry minute turns wet with probability $p_{01} = 0.0055$, and a wet minute stays wet with probability $p_{11} = 0.8899$. The chain's $k$-step forecast comes from the matrix power
$$ P^k, \qquad P = \begin{pmatrix} 1 - p_{01} & p_{01} \\ 1 - p_{11} & p_{11} \end{pmatrix}, $$
In plain English: multiply the one-minute odds together $k$ times. Worked number: if it is raining now, the chain says 56% chance of rain in 5 minutes and 7% in 30 minutes.

📊 Figure (described): The chance that the station flags rain $k$ minutes ahead. If it is raining now (orange, solid), it is 74% at 5 minutes and 46% at 30 minutes. The Markov chain (orange, dashed) falls much faster, to 7% at 30 minutes. If it is dry now (blue), the chance is 1–3% at any lead. If it is dry now but rained in the last 30 minutes (green), it stays at 10–17%: three to five times the base rate.
The empirical curve and the chain agree at one minute (both 0.890), because that is what the chain was fitted to. They part company quickly. The chain's memory is one minute; real rain comes in showers that last tens of minutes, made up of wet minutes with dry gaps. So the real persistence is much longer than the chain's. That is a lesson about models, not about weather: a Markov chain that is exactly right at its own time step can be badly wrong at longer leads.
⚠️ Common pitfall: Treating "no rain now" as "safe". A dry minute in a session that rained in the last half hour carries a 12–14% chance of rain 15–30 minutes later, four to five times the 2.6% chance in a session that has been dry all along. The fix: condition on recent history, not just the present state. Box Box's scenario generator does this by drawing whole showers, not single wet minutes.
Does the weekend forecast Sunday?
Grands Prix: 91; race had rain or wet tyres: 21 (23.1%)
condition value races wet_races p lo hi wet_tyre_races p_wet_tyre lo_wt hi_wt
rain/wet tyres in an earlier session 1 37 13 0.351 0.218 0.512 7 0.189 0.095 0.342
rain/wet tyres in an earlier session 0 54 8 0.148 0.077 0.266 4 0.074 0.029 0.176
rain/wet tyres in qualifying 1 18 9 0.500 0.290 0.710 6 0.333 0.163 0.563
rain/wet tyres in qualifying 0 73 12 0.164 0.097 0.266 5 0.068 0.030 0.151
Race track temp forecast from qualifying median: n 91, bias -0.0 C, MAE 4.6 C, 90th pct |err| 9.6 C; implied deg error at +0.0017 s/lap/C: 0.0078 s/lap
Race track temp forecast from last practice median: n 91, bias -2.5 C, MAE 7.3 C, 90th pct |err| 14.7 C; implied deg error at +0.0017 s/lap/C: 0.0124 s/lap
Race track temp forecast from same circuit's other years: n 89, bias -0.0 C, MAE 6.4 C, 90th pct |err| 14.9 C; implied deg error at +0.0017 s/lap/C: 0.0109 s/lap
📐 Definition: A rain session has at least one weather record with rainfall = 1 or at least one INTERMEDIATE/WET lap (the book's definition, used in every weather table). By that definition, 21 of 91 Grands Prix (23.1%) were rain races; 11 of 91 (12.1%) had any running on wet tyres.
Weekend persistence is real. When any earlier session of the weekend was a rain session, the race was one too in 35.1% of cases (13 of 37; Wilson 95% CI 21.8–51.2%). When the weekend had been dry, it was 14.8% (8 of 54; 7.7–26.6%). Rain in qualifying is the stronger signal: the race was wet in half of those weekends (9 of 18), against 16.4% otherwise. Weather comes in systems that last days, and a wet Saturday often means an unsettled Sunday.
For track temperature, qualifying is the best free forecast. Qualifying's median track temperature predicts the race's with a mean absolute error of 4.6 °C and no bias. The last practice session does worse (7.3 °C MAE, and a −2.5 °C bias, because practice often runs earlier in the day or the day before). The same circuit's other years do worse still (6.4 °C). Translated through Section 36.3's slope, a 4.6 °C error is worth 0.007 s/lap of degradation: small beside the other errors in a deg forecast, as Case Study 2 shows.

📊 Figure (described): Left: the share of Grands Prix with rain (blue) or wet-tyre running (green) on race day, split by whether rain or wet tyres appeared earlier in the weekend, with Wilson 95% intervals. Wet weekends produce wet Sundays more than twice as often. Right: the race-minus-forecast error of track temperature. The qualifying forecast (blue) is centred on zero and tighter than the forecast from other years at the circuit (orange).
🎰 Betting Track: A wet qualifying session raises the empirical chance of a wet race from about 16% to about 50%, with a wide interval (29–71%), because only 18 weekends had one. That is the size of effect a weather-aware betting model would start from. Chapter 38 asks whether markets already price it.
36.6 Rain and Safety Cars
Rain takes away grip, and a car with less grip than its driver expects goes off. A crash or a stranded car brings out a safety car or a VSC. That chain is intuitive. Is it measurable?
Chapter 14 built the hazard model: incidents (SC, VSC and red-flag periods, grouped) per lap at risk, from OpenF1 race control. Here we split every race lap from lap 2 onward by its conditions. A wet lap is one on which at least half the cars either carried a rain flag or ran INTERMEDIATE/WET tyres.
Race laps: 5,461 in 91 GPs; wet laps 315 (12 GPs); rain-flag laps 155, wet-tyre laps 283
Incident hazard per lap at risk (OpenF1 race control 2023-2026; Poisson 95% CI):
phase condition value laps_at_risk incidents hazard lo hi sc_or_red hazard_sc
laps 2-N wet True 273 12 0.0440 0.0227 0.0768 8 0.0293
laps 2-N wet False 4810 89 0.0185 0.0149 0.0228 43 0.0089
laps 2-N rain True 136 8 0.0588 0.0254 0.1159 6 0.0441
laps 2-N rain False 4947 93 0.0188 0.0152 0.0230 45 0.0091
laps 2-N, wet: ratio 2.38 (95% CI 1.30-4.34); SC/red only 3.28
laps 2-N, rain: ratio 3.13 (95% CI 1.52-6.44); SC/red only 4.85

📊 Figure (described): Incidents started per lap at risk, laps 2 to the flag, with Poisson 95% intervals and the raw counts above each bar. On wet laps (rain flag or wet tyres) the hazard is 4.4% per lap, against 1.85% on dry laps. On laps with the rain flag set it is 5.9%. All three wet definitions give intervals that sit above the dry rate.
A wet lap is 2.4 times as likely to start an incident as a dry lap (95% CI 1.3–4.3). Counting only full safety cars and red flags, the ratio is 3.3. On laps where the rain flag is actually set, it is 3.1 (1.5–6.4). The base is small: 12 incidents in 273 wet laps, in six races: the 2023 Dutch GP (laps 16 and 64), 2024 Canadian (25), 2024 São Paulo (28, 30, 39), 2025 Australian (47), 2025 British (2, 5, 14, 18) and 2025 Miami (33). But all three definitions point the same way, and none of the intervals includes 1.
The dry-lap rate here (0.0185) sits where Chapter 14's middle-phase hazard does (0.0186). So the right way to use this number is as a multiplier: in a simulation, scale the circuit's dry hazard by 2.38 on wet laps. That is what conditions.WET_HAZARD_RATIO and simulate_weather_race do.
⚠️ Common pitfall: Reading the ratio as "rain causes crashes". Some wet-lap incidents are weather safety cars: race control neutralises the race because of visibility or standing water, not because anyone crashed. Our race-control counts do not separate the two. For strategy the distinction does not matter, because either way the pit loss falls. For a safety argument it matters a lot.
How long is a race shower?
To simulate rain we also need its duration. 05_rain_and_safety_cars.py merges rain-flag records inside the racing windows of Grands Prix and sprints into showers, joining records less than 10 minutes apart:
Showers inside racing windows (GP + sprint): 28 in 14 events
length: median 9 min = 5.7 laps; 75th pct 11.0 laps; 90th 20.2; max 72.5; single-record showers 25%
showers with >= 3 rain records (n 18): median 7.9 laps, IQR 5.9-16.6
The typical race shower lasts about six to eight laps. A quarter are single flagged minutes (a passing drizzle), and the longest (2024 São Paulo) covered 72 laps' worth of the racing window, the whole race. The 18 showers with at least three flagged minutes become conditions.SHOWER_LAPS, the empirical distribution the scenario generator samples from.
🔄 Check your understanding 1. A 62-lap race has a dry middle-phase hazard of 0.0186 per lap. A shower makes 8 laps wet. Roughly how many extra incidents does the shower add, on average? 2. Why do we sample whole showers for the simulator instead of running the per-minute Markov chain?
Answer
- On wet laps the hazard is $2.38 \times 0.0186 = 0.0443$, an extra 0.0257 per lap. Over 8 laps that adds about $8 \times 0.0257 = 0.21$ incidents: roughly a one-in-five chance of an extra SC, VSC or red flag from that shower alone.
- The chain matches the one-minute persistence but forgets too fast: it puts the chance of rain 30 minutes into a shower at 7%, against 46% observed. Drawing whole showers from the observed lengths keeps their real duration.
🪞 Learning check-in Pause and take stock. You have now met five weather effects: track temperature on tyre wear (36.3), wind on trap speed (36.4), weekend rain on race rain (36.5), rain on the safety-car hazard (36.6) and, from earlier chapters, air density on drag and downforce. - Rank them by how much they matter to a race strategy, using the numbers, not your intuition. Which surprised you? - Which of the five would you trust enough to put in a simulator today, and which would you leave out? - Where in the chapter did you most want data we do not have (radar, on-car air speed, tyre temperatures)? Hold that thought for Exercise E1.
36.7 The Early Switch to Intermediates: An Expected-Value Bet
Now the most tempting weather gamble of all. Rain is forecast. If you fit intermediates before it arrives, and it comes, you are on the right tyre while your rivals are still sliding around on slicks. If it does not come, you have thrown away a pit stop. The usual story goes: if you're right, you gain 20 seconds or more; if you're wrong, you lose the race. Let us price it.
The bet in one line
Call $G$ the gain if the rain comes, $C$ the cost if it does not, and $p$ the forecast probability. The expected value of switching early is
$$ \mathbb{E}[\text{gain}] = p\,G - (1-p)\,C, \qquad p^* = \frac{C}{C + G}. $$
In plain English: the switch is worth making when the chance of rain is above $p^*$, the share of the total stake that you risk losing. Worked number: if $G = 20$ s and $C = 36$ s, then $p^* = 36/56 = 64\%$. The usual story is a bet that pays at a two-in-three forecast. But $G$ and $C$ need measured inputs.
The inputs
We build the gain and the cost from pieces the book has already measured, and say plainly where we assume:
- The wet lap-time model is Chapter 15's
WetPenaltyModel. A wetness gauge $w$ (the intermediate's excess over dry pace) sets each tyre class's penalty. The slick/intermediate crossover is at $w = 0.113$, and the slick loses time 1.36 times as fast as the intermediate as the track gets wetter. - The stop costs are Chapter 15's near-field wet pit losses: 19.50 s slick→intermediate (n = 25) and 29.27 s intermediate→slick (n = 23, which includes the cold first lap on slicks).
- The circuit is Singapore, to match Anchor C. Its dry pace is the median clean race lap of 2025–2026, 98.338 s (n = 2,180).
- The showers come from
conditions.sample_weather_scenario: lengths drawn from the 18 observed race showers, peak intensity from Chapter 15's range of race intermediate penalties (7.7–21.6%, mode 13.2%). The shape of a shower (a two-lap climb to the peak, a hold while it rains, then 6–16 laps of drying) is an assumption.
🧪 Illustrative model: parameters are assumptions chosen to be plausible for a current F1 car, not team data. In this section, the assumed parts are the shower shape and the extrapolation of Chapter 15's penalty lines away from their tie points. Everything else is measured.
Singapore dry reference: median clean race lap 2025-26 = 98.338 s (n 2,180)
Wet model (Chapter 15): dry-track gauge w0 = 0.0299; slick/inter crossover at gauge 0.113
intermediate on a dry track: +2.94 s/lap (model lower bound)
gauge 0.080: slick +6.70 s, inter +7.87 s over dry pace
gauge 0.113: slick +11.11 s, inter +11.11 s over dry pace
gauge 0.150: slick +16.06 s, inter +14.75 s over dry pace
gauge 0.200: slick +22.75 s, inter +19.67 s over dry pace
Read the last lines carefully, because they hold the whole answer. Past the crossover, the slick's disadvantage grows slowly: 1.3 s/lap at a gauge of 0.15 and 3.1 s/lap at 0.20. That matches Chapter 15's measured growth of the delta in wetting conditions (1.46 s/lap per lap at Silverstone 2024). So a car that waits for the crossover and then pits loses only a lap or two of a small and growing difference. The pre-emptive car gains that, and no more.
What the simulation says
06_early_inters_ev.py draws 4,000 showers starting on the next lap and drives three cars through each: pre-emptive (fit intermediates now), early (fit them at the end of the first lap with rain falling) and react (fit them at the end of the first lap past the crossover). The question is asked at two moments: lap 20, with the planned dry stop (SOFT→MEDIUM after lap 36) still to come, and lap 45, after it.
lap 20, dry stop still to come (plan SOFT -> MEDIUM after lap 36), 4,000 showers from lap 21:
showers whose peak passes the crossover: 83.1%
pre-emptive vs react if it rains: mean -1.4 s, median +1.0, P(pre-emptive faster) 77.6%; 10th/90th pct -17.3 / +3.1
early (at first rain) vs react if it rains: mean -1.0 s, P(faster) 80.9%
staying on slicks vs react if it rains: mean -6.2 s
if it stays dry: pre-emptive costs 35.7 s (S2I 19.5 + 1 lap on inters + I2S 29.27 - the dry stop it replaces)
break-even rain probability for the pre-emptive stop: 104%
heavy showers only (peak gauge > 17%, n 718): pre-emptive gain +2.9 s; break-even 93%
lap 45, dry stop already made (plan SOFT -> MEDIUM after lap 36), 4,000 showers from lap 46:
showers whose peak passes the crossover: 83.3%
pre-emptive vs react if it rains: mean -4.7 s, median +0.6, P(pre-emptive faster) 69.8%; 10th/90th pct -39.5 / +2.6
if it stays dry: pre-emptive costs 42.1 s (S2I 19.5 + 1 lap on inters + I2S 29.27)
break-even rain probability for the pre-emptive stop: 113%
heavy showers only (peak gauge > 17%, n 741): pre-emptive gain +2.4 s; break-even 95%

📊 Figure (described): Left: the gain of the pre-emptive switch over waiting for the crossover, across 4,000 simulated showers at lap 20. Most outcomes pile up between 0 and +4 s. A second lump sits at −15 to −25 s: showers too light to reach the crossover, in which the reacting car never stops and the pre-emptive car has paid for two stops for nothing. The orange line marks the 36 s cost if no rain comes at all. Right: the expected gain against the forecast probability, for three cases. Every solid line stays below zero all the way to 100%. The dashed lines (heavy showers only) cross zero only above about 92%.
The pre-emptive switch is a lopsided bet. If the rain comes, it usually wins, but by only a second or three (median +1.0 s at lap 20). If the rain does not come, or is too light to need intermediates, it loses 36–42 s. In this model the bet never pays on average, even with a certain forecast, because 17% of showers stay below the crossover. Even restricted to heavy showers, it needs a forecast of 92–95%.
Two cases make a bigger gain plausible, and the model leaves both out:
- Track position. If rain will make everyone pit, the first car to pit takes the free pit lane and may come out ahead of cars that queue behind team-mates. Our single-car model cannot see that.
- A downpour the slicks cannot survive. At gauges well above 0.2, where full wets take over (Chapter 15 puts the inter/wet tie at 0.233), a car stuck on slicks may lose far more than the linear model says, or crash. The sudden-downpour case (peak in one lap) barely changes the answer (break-even 92% for heavy showers), because the model's slick penalty grows linearly.
So the honest reading is: the "20+ seconds" are not in the lap-time physics. If they exist, they come from track position, queueing and the safety car the rain may bring. Section 36.6 showed that the safety car is 2.4 times as likely on a wet lap. That is the next section's job.
📋 Call the pit stop: 2026 Dutch GP, lap 23. The race restarted after a lap-2 red flag. It is now lap 23 of 72. The station has flagged rain on the laps of 70% of the field this lap, as it did on every car's lap 19. Track temperature has dropped from 38.2 °C on lap 21 to 35.7 °C. The median lap of the field over the last three laps: 79.27, 79.29, 79.11 s. You are on slicks, with your one stop still to make. Do you fit intermediates?
The decision, and what the data show
Stay out. The lap times are the wetness gauge, and they have not moved: the median lap on laps 19–26 stayed between 78.9 and 79.4 s, the same as laps 9–17 (78.7–79.1 s). A gauge you can compute from lap times says the track is barely damp, nowhere near the 11% slower lap that marks the crossover. The rain flag stayed on and off until lap 36 and came back on laps 50–52, but the median lap fell steadily to 76.9 s as fuel burned. Nobody in the race ran a lap on intermediates (the book's 2023–2026 weather tables list it as "rain flag, slicks only"). A pre-emptive stop here would have cost about 36 s, and the rain never got heavy enough to give any of it back.
36.8 Anchor C With Weather: What a Shower Forecast Does to the Plan
Anchor C asked whether Singapore's safety-car risk justifies a two-stop plan, and the answer was no. The robust plan was a flexible one-stop: plan one stop, and take an extra one only if a neutralisation makes it cheap (Chapter 14; the full engine is in Chapter 27). Now add weather. Suppose the forecast gives a chance of a shower in the second half of the race. When should a one-stop car make its dry stop?
The model
07_weather_monte_carlo.py uses conditions.simulate_weather_race. Each simulated race draws:
- its weather: with probability $p$, one shower starting on a lap drawn uniformly from a forecast window, with length and peak intensity sampled as in Section 36.7;
- its neutralisations: Singapore's measured phase hazard ($k = 1.33$, Chapter 14), multiplied by 2.38 on wet laps (Section 36.6), with incident types and lengths drawn from the 118 real incidents of 2023–2026.
The car uses Anchor C's measured Singapore inputs: tyre deg and compound offsets from the fixed-effects model, stint caps of 37/43/47 laps, a green pit loss of 23.866 s, 15.258 s under SC and 17.932 s under VSC. It plans one dry stop, either SOFT→MEDIUM or MEDIUM→SOFT, after a given lap. It takes an SC/VSC stop up to 8 laps early if one comes. If rain arrives it reacts at the crossover: intermediates at the end of the first lap past it, back to slicks when the rain stops and the gauge falls back. Once it has run intermediates, the dry two-compound rule no longer applies, and its stop back to slicks replaces the planned dry stop, onto the best compound for the laps left. Every plan drives the same 3,000 races in each scenario (common random numbers, seed 42).
🧪 Illustrative model: parameters are assumptions chosen to be plausible for a current F1 car, not team data. Here the assumed parts are the shower shape and the single-car scoring (no traffic, no track position, no queueing in the pit lane).
Clean dry race: best plan ('SOFT', 36, 'MEDIUM') (Anchor C: SOFT, lap 36 -> MEDIUM); best MEDIUM -> SOFT: lap 26 (+0.00 s)
Summary (gain = how much faster on average the best stop lap is than the clean-race optimum, s):
scenario p rain_share best_plan best_stop gain_vs_clean_opt ci_lo ci_hi p_better p_worse wet_stop_share incidents
no rain 0.000 0.000 MS27 27 0.144 -0.067 0.343 0.639 0.361 0.000 1.666
12% anywhere (base rate) 0.121 0.118 SM37 37 0.044 -0.028 0.120 0.072 0.709 0.090 1.719
30% between laps 30 and 50 0.300 0.301 SM37 37 0.076 -0.031 0.184 0.080 0.692 0.233 1.809
60% between laps 30 and 50 0.600 0.604 SM37 37 0.228 0.105 0.353 0.087 0.616 0.483 1.927
90% between laps 30 and 50 0.900 0.910 SM37 37 0.400 0.254 0.558 0.102 0.570 0.730 2.074
(Columns trimmed; the full table is in code/07_output.txt.) The first line checks the model against Anchor C: in a clean dry race the best plan is SOFT→MEDIUM after lap 36, exactly Anchor C's clean-race one-stop. The 12% scenario uses the measured share of Grands Prix with wet-tyre running (11 of 91), with the shower allowed anywhere in the race.

📊 Figure (described): Left: expected race time against the planned dry stop lap, relative to the clean-race plan, for five forecasts. Circles mark each curve's minimum. With no rain the curve is flat between laps 25 and 37 (within about 0.3 s either side of zero, because a flexible car can use an early safety car either way). As the shower probability rises, early stops get steadily worse (+2 to +2.8 s at laps 25–30 in the 60% and 90% cases), and the minimum moves to lap 37, the latest stop the SOFT's life allows. Beyond lap 37 only a MEDIUM start is possible, and every curve jumps by about 4–6 s. Right: in the 60% scenario, the race-by-race difference between stopping after lap 37 and stopping after lap 30. In dry races it clusters just below zero. In wet races it splits into a large lump at −20 to −25 s (the shower came before the stop, and waiting saved it) and a smaller lump at +3 to +5 s.
Three results.
- A shower forecast pushes the dry stop later, never earlier. In every rain scenario the best plan is SOFT→MEDIUM after lap 37, the latest stop the soft tyre's life allows. The reason is option value. A car that has not yet stopped when rain comes gets its tyre change "for free", because the stop for intermediates replaces the dry stop. A car that has already stopped must pay for a second stop. Waiting keeps the option open.
- The gain is small on average, and large when it matters. With a 60% forecast, the best plan beats the clean-race plan by only 0.23 s on average (95% CI 0.11–0.35 s). But in the 711 races where the shower started by lap 37, stopping after lap 37 rather than lap 30 saved 11.3 s on average.
- Rain brings safety cars. Wet races average 2.11 incidents against 1.65 for dry ones, because of the 2.38 multiplier. That is another reason not to commit to a dry stop early: a wet race has more cheap pit stops in it.
There is a fourth result, and it concerns the reaction rule rather than the forecast. We ran the same races with a car that never fits intermediates:
60% scenario, rain races with peak gauge 0.000-0.113 (n 321): stay - react = +0.0 s, stay better in 0%
60% scenario, rain races with peak gauge 0.113-0.160 (n 1009): stay - react = -17.7 s, stay better in 82%
60% scenario, rain races with peak gauge 0.160-0.250 (n 483): stay - react = -1.0 s, stay better in 59%
In moderate showers (peak gauge just past the crossover), the car that stays on slicks is 17.7 s faster on average than the car that reacts at the crossover. The crossover rule switches as soon as intermediates are faster per lap. It ignores that the switch costs two stops (19.5 + 29.3 s), and that a moderate shower may give back only a few seconds a lap for a few laps. Chapter 15's switch_decision makes the right comparison: switch only if the remaining gain beats the pit loss. A per-lap crossover is a necessary condition for switching, not a sufficient one.
⚠️ Common pitfall: Building a weather simulator in which the car switches tyres at the crossover. It looks physically correct, and it is systematically too eager in short or light showers. The fix: make the decision rule compare the expected remaining gain with the stop cost (Chapter 15's switch_decision), and test it against "never switch" in the same simulated races.
📋 Call the pit stop: 2023 Belgian GP, lap 21. Spa-Francorchamps, lap 21 of 44. The rain flag was set on 79% of the field's laps on lap 20 and is set on every car's lap now. The field's median lap has gone 114.3 → 114.8 → 115.7 → 116.2 s over laps 16, 19, 20 and 21. Track temperature is falling (28.3 → 27.2 °C). Several cars are due their dry stop. Do you fit intermediates, fit fresh slicks, or stay out?
The decision, and what the data show
Fit fresh slicks if your stop is due; do not fit intermediates. The median lap has risen by 1.9 s, about 1.7% of a Spa lap. The slick/intermediate crossover is at an 11.3% excess (Chapter 15), and this shower was a long way from it. The median lap peaked at 116.72 s on lap 22 and was back to 113.3 s by lap 24 and 111.6 s by lap 26, as the track dried and fuel burned. The rain flag cleared after lap 25. The race used no wet tyres at all (the book's 2023–2026 weather tables list it as "rain flag, slicks only"), and cars made their dry stops through the shower: 2, 2, 4 and 3 pit in-laps on laps 22–25. In our model's terms, this was a shower whose peak gauge never reached the crossover. "React" and "stay" were the same plan, and a pre-emptive switch would have been the 36-second mistake.
🔄 Check your understanding 1. Why does a 60% forecast of a shower between laps 30 and 50 move the best dry stop later rather than earlier? 2. In Section 36.7 the pre-emptive switch never paid on average. In Section 36.8 waiting gains 11.3 s when the shower comes early. Are these two results in tension?
Answer
- If the rain comes before you stop, the stop for intermediates doubles as your tyre change, and you save a whole pit loss. Stopping early for dry tyres throws that option away. Late stops lose a little tyre time in dry races (a few tenths) and gain a lot in wet ones.
- No. Both say the same thing: do not spend a pit stop on weather that has not arrived. The pre-emptive switch spends one on a forecast. The early dry stop spends one before the forecast resolves. Waiting is cheap; a wasted stop costs 20–40 s.
36.9 What the Data Can't See (and What Teams Have)
Every analysis in this book ends with its limits. For weather, the gap between what teams have and what we have is wide.
| Teams have (public descriptions) | We have | Consequence |
|---|---|---|
| Weather radar and a meteorologist forecasting rain by sector, minute by minute | One station, a 0/1 rain flag, once a minute | Our nowcasts are persistence baselines. A radar-based forecast should beat them, especially at 15–60 min leads. |
| Track-temperature sensors around the lap, and tyre-surface temperatures from on-car sensors | One track sensor; no tyre temperatures in OpenF1 | We can relate wear to the station's temperature, not to the tyre's. Chapter 5 infers tyre temperature with a 🧪 thermal model. |
| On-car air speed (pitot) and wind at several points | One anemometer | Wind effects could not be detected (36.4); the instrument, not the physics, may be the limit. |
| Water depth and the surface's drainage map | Lap times (the Chapter 15 gauge) | Our wetness is inferred from how fast the cars go, after the fact. |
| Forecast uncertainty (ensemble spread) | None | Our $p$ in 36.7–36.8 is a scenario input, not a calibrated forecast. |
⚠️ Common pitfall: Treating rainfall as "it rained on the track". At the 2026 Dutch GP the flag was set on 32 records and nobody ran a lap on wet tyres. At the 2026 Bahrain GP in Malaysia, the station flagged rain for more than an hour before the start; when the race began the flag was off, and half the field started on intermediates anyway. The fix: use the flag as a trigger to look at the lap times, and the lap times as the measure of wetness.
Spaced Review
Three earlier ideas came back in this chapter. Try each question before you open the answer.
From Chapter 14 (safety cars): In Anchor C, a pre-committed two-stop at Singapore was 10.10 s slower on average than the one-stop and faster in only 18.9% of 10,000 simulated races (Chapter 27's full engine), and the robust answer was the flexible one-stop, which gains 0.84 s on average. What does that have in common with this chapter's finding about waiting for rain?
Answer
Both are about the value of an option. The flexible one-stop keeps the option to stop cheaply under a safety car; the late dry stop keeps the option to let a rain stop replace the dry one. In both cases committing early (to two stops, or to an early dry stop) throws the option away, and the option is worth more than the small amount of tyre time the commitment buys.
From Chapter 15 (wet weather): What is the wetness gauge, and why does this chapter use it instead of the rainfall flag to drive lap times?
Answer
The gauge $w$ is the intermediate's lap time as an excess over the race's own dry pace. It measures track wetness through the cars themselves. The rain flag is a station reading: it can be set with every car on slicks (2026 Dutch GP) and unset with half the field on intermediates (the 2026 Bahrain GP in Malaysia start). Lap-time penalties depend on the water on the track, so the gauge drives them.
From Chapter 22 (degradation): Anchor B's model called the 2025 Mexico City stop 7 laps late with practice deg, and 2 laps late with race deg. After Case Study 2, what is the best explanation for the practice error?
Answer
Not temperature. FP2 at Mexico ran 13 °C cooler than the race and still showed far more wear (MEDIUM 0.184 vs 0.007 s/lap, raw). Across 39 weekends, adjusting practice deg for temperature makes the forecast slightly worse. The practice-race gap comes from how the laps are run: fuel loads and run plans, track rubbering, traffic and engine modes. None of those is in our data directly.
Project Checkpoint: conditions.py
Aisha's Box Box simulator has had perfect weather for 35 chapters. This chapter adds project/boxbox/conditions.py, the module that turns the weather into simulator inputs. It imports Chapter 15's wet.WetPenaltyModel for wet lap times, and its demo uses Chapter 14's neutralisation.sc_hazard.
| Function | What it does |
|---|---|
clean_weather(session=None) |
weather with the ≤ 0 °C dropouts removed, plus track_excess and local_hour |
session_conditions(session) |
median air/track/humidity/pressure/wind, rain share, dropout count |
track_temp_effect(delta_c, stint_laps=None) |
Δdeg (s/lap) and Δstint time for a temperature change (within-circuit slope 0.00159 s/lap per °C by default, from an earlier fit; Section 36.3's refit gives 0.00169, which can be passed as deg_per_c) |
temp_adjusted_deg(base_deg, base_c, forecast_c) |
shifts a compound deg table to a forecast temperature |
wind_component(speed, from_deg, heading_deg) |
headwind and crosswind |
heading_from_xy(x0, y0, x1, y1, north_up=True, rotation_deg=0) |
heading from a location trace (the frame caveat is in the docstring) |
locate_speed_traps(session) |
i1/i2/st positions, headings, match errors |
rain_markov(), nowcast(raining_now, minutes) |
the two-state rain chain |
sample_weather_scenario(n_laps, p_rain, rng, window) |
one race's lap-by-lap rain flag and wetness gauge |
wet_lap_penalty_s(cls, gauge, dry_ref_s) |
wet lap-time penalty over a dry slick lap |
early_switch_ev(p, gain, cost) |
expected value and break-even probability |
simulate_weather_race(...) |
Monte Carlo over weather and SC/VSC for one-stop plans and wet policies |
The demo, code/project_checkpoint.py, runs it on real sessions:
q = f1data.session(2026, "rodriguez", "Q")
tr = cond.locate_speed_traps(q)
w = cond.clean_weather(q)
wd, ws = float(w.wind_direction.median()), float(w.wind_speed.median())
tr["bearing_if_north_up"] = [cond.heading_from_xy(0, 0, np.cos(np.radians(p)), np.sin(np.radians(p))) for p in tr.psi_xy]
hw, cw = cond.wind_component(ws, wd, tr.bearing_if_north_up)
2026 Las Vegas GP race conditions: {'air_c': 11.9, 'track_c': 14.0, 'humidity': 31.5, 'pressure_hpa': 944.9, 'wind_ms': 0.65, 'rain_share': 0.0, 'dropouts': 1, 'records': 148}
Track +5 C: deg +0.0080 s/lap (95% CI +0.0031 to +0.0128); a 25-lap stint +2.39 s
Track -8 C: deg -0.0127 s/lap (95% CI -0.0050 to -0.0206); a 30-lap stint -5.53 s
2026 Mexico City Q: station wind 2.9 m/s from 247 deg; traps located on 12 laps
trap frac dist_m match_err turn_deg v_med bearing_if_north_up headwind_ms crosswind_ms
i1_speed 0.43 1823.36 1.64 2.98 327.5 212.67 2.39 1.64
i2_speed 0.78 3326.57 0.72 5.66 310.5 277.98 2.49 -1.49
st_speed 0.23 960.44 0.56 0.01 350.0 97.49 -2.50 1.47
(bearings assume the location frame is north-up, which Chapter 36 could not confirm)
Monte Carlo, 1,000 Singapore races, 50% chance of a shower in laps 30-50 (rain in 47.4%):
SM30|react mean 147.04 s (vs SM36|react +2.22)
SM30|stay mean 141.75 s (vs SM36|react -3.06)
SM36|react mean 144.81 s (vs SM36|react +0.00)
SM36|stay mean 140.10 s (vs SM36|react -4.71)
The 2026 Las Vegas race shows the cleaning at work: one of its 148 records was a dropout. The Mexico City trap table shows why the frame matters. If the frame is north-up, that afternoon's wind blew 2.4–2.5 m/s against the cars at the two intermediate traps and 2.5 m/s with them on the main straight, where the 350 km/h trap sits. Section 36.4 says we cannot trust that "if". The small Monte Carlo repeats Section 36.8's lessons in miniature: stopping later is better, and the crossover-reacting car loses to the car that stays out.
Aisha: So
conditionsgives the simulator weather it can't control: temperature that nudges the wear, and showers that arrive or don't. Kenji: And wind? Aisha: Wind gets a function and a warning label. No lap-time effect until someone shows me one.
In Chapter 40, simulate will call sample_weather_scenario for every simulated race and track_temp_effect to shift the tyre model to the forecast temperature. Chapter 27's engine can use the same per-lap hazard array, with the wet-lap multiplier applied.
Chapter Summary
The weather effects, ranked by what they do to a strategy (OpenF1 2023–2026 R21):
| Effect | Measured size | Definition / filter | Use in a simulator? |
|---|---|---|---|
| Rain → incident hazard | ×2.38 (1.30–4.34) per wet lap; SC/red only ×3.28 | laps 2–N; wet = ≥ 50% of cars rain-flagged or on INTER/WET; 91 GPs | Yes: multiply the hazard |
| Track temperature → deg | +0.017 s/lap per +10 °C (+0.008 to +0.026), canonical fuel correction; +0.020 data-driven | within circuit, 3,262 dry stints, 76 races | Yes, small: shift the tyre model |
| Track temp → one/two-stop line | median 16 °C needed; only 7 circuits within ±12 °C | $d^* = 12L/N^2$, canonical deg | rarely decisive |
| Weekend rain → race rain | 35% (13/37) vs 15% (8/54); after wet qualifying 50% (9/18) | rain session = any flag or wet-tyre lap | Yes, as a prior |
| Qualifying track temp → race track temp | MAE 4.6 °C, no bias (practice 7.3, history 6.4) | race-window medians | Yes, as the forecast |
| Rain now → rain in 30 min | 46% (Markov chain: 7%) | station flag, per minute | Sample showers, not a 1-min chain |
| Station wind → trap speed | −0.08 km/h per m/s (−0.21 to +0.05); any frame ≤ 0.24 | 249,216 lap-trap readings on straights | No (not detectable) |
| Early inters (pre-emptive) | median +1 s if rain comes; costs 36–42 s if dry; p* > 92% even for heavy showers | 🧪 Chapter 15 wet model, Singapore | Model it as a bet, not a rule |
Formulas
| Quantity | Formula | Reading |
|---|---|---|
| Terminal-speed wind sensitivity | $dv/dw = -2/3$ | −2.4 km/h per m/s of headwind (an upper bound) |
| Extra stint time from a deg change | $\Delta d\, n(n-1)/2$ | +5 °C over 25 laps → +2.5 s |
| One-stop / two-stop line | $d^* = 12L/N^2$ | Suzuka: 0.096 s/lap |
| Wind components | $A = W\cos(\theta - h)$, $B = W\sin(\theta - h)$ | headwind, crosswind |
| Early-switch EV | $pG - (1-p)C$, $p^* = C/(C+G)$ | lopsided when $C \gg G$ |
Decision checklist for a weather-affected race
- Clean the weather (dropouts ≤ 0 °C) and use medians.
- Use the qualifying track temperature as the race forecast, and shift deg by 0.0017 s/lap per °C. Only revisit the stop count if the circuit sits near the one-stop / two-stop line.
- If rain is possible, delay the dry stop to the latest the tyres allow. Do not spend a stop on a forecast.
- When rain arrives, read the lap times, not the flag. Switch only when the remaining gain beats the two stops' worth of pit loss.
- Raise the safety-car hazard ×2.4 on wet laps, and keep the cheap-stop option open.
- Ignore the station wind for lap time unless you have better instruments.
What's Next
Weather and safety cars are random events a team cannot control. Chapter 37 turns to the random events that come from the cars and the rules: retirements, grid penalties and the stewards. There too, the question is how big each risk is, and how to put it into the simulator without letting the noise drive the decisions.