Chapter 36 — Exercises: Weather Analytics

Difficulty: ⭐ concepts · ⭐⭐ calculation or a short script · ⭐⭐⭐ a full analysis · ⭐⭐⭐⭐ open research

Every script referred to is in code/. Run them from the chapter directory. Numbers in the solutions come from the book's data snapshot (OpenF1 2023–2026 R21) and the chapter's own runs.


Part A — Concepts ⭐

A1. List the seven measurements in an OpenF1 weather record, and for each say one thing it cannot tell you about conditions on the racing line.

A2. Why is a track-temperature reading of exactly 0.0 °C in the middle of a 30 °C session almost certainly a dropout and not a measurement? What two checks would you run before setting it to missing?

A3. Explain, using the surface energy balance in Section 36.2, why the track-minus-air excess is near zero just before midnight in Las Vegas and about 17 °C at 13:00 elsewhere.

A4. A colleague says "temperature has no effect on degradation, because the across-circuit regression is not significant". What is wrong with that argument?

A5. In your own words, explain why a fuel correction that is constant within a circuit cannot change a within-circuit slope, while a race-specific correction can.

A6. Why might the station's wind fail to show up in the speed traps even if wind does affect cars on the straights? Give three reasons.

A7. What is the difference between the rain flag and the wetness gauge? Which one should drive a lap-time model, and which one should trigger an analyst to look?

A8. A one-minute Markov chain fits the rain flag's one-minute persistence exactly but under-predicts 30-minute persistence by a factor of six. What feature of real weather does the chain leave out?

A9. Explain the phrase "a per-lap crossover is a necessary condition for switching, not a sufficient one".

Notes on A1–A9
  • A1. Air temperature: not the temperature in the cockpit or the brake ducts. Track temperature: one sensor, so not the shaded or sunny parts of the lap. Humidity: not cloud cover directly. Pressure: not the density on its own (density also needs temperature and humidity; Chapter 3). Rainfall: not the water on the track. Wind speed and direction: not the wind at car height on a given straight.
  • A2. Check the neighbouring readings (34.7, 0.0, 34.7 in the 2026 Bahrain GP in Malaysia race) and the air temperature in the same record (normal). A frozen track at 25 °C air is impossible.
  • A3. At midnight the solar term $(1-a)G$ is zero, so the track only holds stored heat. At 13:00 the track must lose several hundred W/m² of absorbed sunlight, which needs a large temperature difference to drive convection and radiation.
  • A4. The across-circuit regression compares circuits that differ in surface, layout and allocation as well as temperature, and those differences add noise and bias. The within-circuit estimate (+0.017, CI +0.008 to +0.026) is significant.
  • A5. A within-circuit slope uses only differences between stints at the same circuit. A constant added to all of them cancels in every difference. A race-specific correction adds different amounts to different races at the same circuit, so it changes the differences.
  • A6. The station is not on the straight; the traps are not at terminal speed; tow, DRS or Straight Mode and deployment add 7 km/h of noise; and the map may not be north-up.
  • A7. The flag is a station reading; the gauge is the intermediate's excess over dry pace. The gauge drives lap time; the flag is a trigger.
  • A8. Showers: wet minutes cluster into spells tens of minutes long, with short dry gaps inside them. A one-minute chain has no memory of that structure.
  • A9. If intermediates are not faster per lap, switching cannot pay. But even when they are, the switch only pays if the gain over the remaining wet laps beats the stop costs.

Part B — Calculations & Physics ⭐⭐

B1. Extra stint time. Race-day track temperature is forecast 7 °C above Friday's. Using the within-circuit slope (0.00169 s/lap per °C, canonical fuel correction), how much extra time does that add to a 22-lap stint on a new set? To a 35-lap stint?

Solution

$\Delta d = 0.00169 \times 7 = 0.0118$ s/lap. Over $n$ laps the extra time is $\Delta d \cdot n(n-1)/2$. - 22 laps: $0.0118 \times 22 \times 21/2 = 2.73$ s. - 35 laps: $0.0118 \times 35 \times 34/2 = 7.04$ s.

The cost grows with the square of the stint length, so longer stints are more exposed to a hotter day.

B2. The one-stop / two-stop line. Monza: pooled green-flag pit loss 25.409 s, 53 laps, median canonical stint deg 0.042 s/lap. (a) Compute $d^*$. (b) How many degrees of extra track temperature would make a second stop pay, at 0.00169 s/lap per °C? (c) Compare with the chapter's table.

Solution

(a) $d^* = 12 \times 25.409 / 53^2 = 304.9 / 2{,}809 = 0.109$ s/lap. (b) $(0.109 - 0.042)/0.00169 = 40$ °C. (c) The table in code/02_output.txt gives 39.2 °C (the difference is rounding). Monza's race track temperature ranged 43–55 °C across our four races, so no plausible weather makes Monza a two-stop race on wear alone.

B3. Terminal speed and wind. A car's terminal speed in still air is 340 km/h. (a) Using $dv/dw = -2/3$, estimate its terminal speed into a 3 m/s headwind and with a 3 m/s tailwind. (b) The chapter's 95% upper bound on the measured response is 0.24 km/h per m/s. What would the same 3 m/s do at that rate?

Solution

(a) 3 m/s = 10.8 km/h; $\tfrac23 \times 10.8 = 7.2$ km/h. Headwind: about 332.8 km/h; tailwind: about 347.2 km/h. (This is a small-$w$ linearisation; fine at 3 m/s.) (b) $0.24 \times 3 = 0.72$ km/h. The measured response is at most a tenth of the physics benchmark.

B4. Wind components. At 2026 Mexico City qualifying the station wind was 2.9 m/s from 247°. If the main-straight trap's bearing is 97.5° (as project_checkpoint.py computes under the north-up assumption), compute the headwind and crosswind.

Solution

$\theta - h = 247 - 97.5 = 149.5°$. Headwind $= 2.9\cos(149.5°) = 2.9 \times (-0.862) = -2.50$ m/s: a 2.5 m/s tailwind. Crosswind $= 2.9\sin(149.5°) = 2.9 \times 0.507 = +1.47$ m/s from the right. These match the checkpoint output (−2.50 and 1.47), under the north-up assumption the chapter could not confirm.

B5. The early-switch bet. You estimate that fitting intermediates now gains $G$ = 8 s if a heavy shower arrives next lap, and costs $C$ = 36 s if it does not. (a) What is the break-even probability? (b) The forecast says 70%. What is the expected value? (c) How large would $G$ have to be for a 70% forecast to break even?

Solution

(a) $p^* = 36/(36+8) = 81.8\%$. (b) $0.7 \times 8 - 0.3 \times 36 = 5.6 - 10.8 = -5.2$ s. Don't switch. (c) $0.7G = 0.3 \times 36 \Rightarrow G = 15.4$ s. In the chapter's model the mean gain for heavy showers is only 2.4–3.1 s, so a gain of 15 s would need something the model leaves out, such as track position or a pit-lane queue.

B6. Hazard and showers. A shower makes 12 laps of a race wet. The circuit's dry hazard is 0.0247 per lap (Singapore's middle phase with $k = 1.33$). Using the wet multiplier of 2.38, what is the probability of at least one incident during those 12 laps, compared with the same 12 laps dry?

Solution

Wet: $\lambda = 2.38 \times 0.0247 = 0.0588$ per lap; $P = 1 - e^{-12 \times 0.0588} = 1 - e^{-0.705} = 0.506$. Dry: $P = 1 - e^{-12 \times 0.0247} = 1 - e^{-0.296} = 0.256$. The shower roughly doubles the chance of an incident in that window, from about one in four to about one in two.

B7. Nowcast arithmetic. With the per-minute chain $P(\text{rain}\mid\text{dry}) = 0.0055$ and $P(\text{rain}\mid\text{rain}) = 0.8899$, compute by hand the two-minute chance of rain given that it is raining now. Compare with the empirical 0.827.

Solution

$P_2 = p_{11}\cdot p_{11} + (1 - p_{11})\cdot p_{01} = 0.8899^2 + 0.1101 \times 0.0055 = 0.7919 + 0.0006 = 0.7925$. The empirical value is 0.827, so the chain already under-predicts at two minutes, and the gap grows with the lead (0.071 against 0.457 at 30 minutes).

B8. Humidity and the track. The daytime regression in Section 36.2 is: excess = 21.0 + 0.07 × air (°C) − 0.149 × humidity (%). (a) Predict the track temperature for a dry 14:00 session with 30 °C air at 40% humidity, and again at 75% humidity. (b) Using the within-circuit deg slope, how much does that humidity difference change the degradation rate?

Solution

(a) At 40%: excess $= 21.0 + 2.1 - 5.96 = 17.1$ °C, so the track is about 47.1 °C. At 75%: excess $= 21.0 + 2.1 - 11.2 = 11.9$ °C, track about 41.9 °C. (b) The difference is 5.2 °C, worth $0.00169 \times 5.2 = 0.0088$ s/lap of degradation. A cloudy, humid afternoon is a slightly gentler tyre day, but only slightly. (Humidity stands in here for cloud; the regression is descriptive, not causal.)


Part C — Data & Code ⭐⭐–⭐⭐⭐

C1. Analyze this session: 2026 Monaco GP, Race. ⭐⭐ The 2026 Monaco race lost 10.5 °C of track temperature between its first and last 10 minutes. Using ch36_common.weather_clean(), plot track temperature, air temperature and the track-minus-air excess against minutes from the start. Mark the laps each car pitted (from f1data.pit). Expected shape: a falling track line from about 43 °C to about 33 °C, a nearly flat air line, and an excess that shrinks through the race. Then say whether the cars' second stints ran in materially cooler conditions than their first, in °C.

C2. Compare these drivers: the hottest and coldest races. ⭐⭐ Extend 02_track_temp_and_deg.py. Select the 2026 Italian GP (race-median track 54.9 °C) and the 2026 Las Vegas GP (13.7 °C). For each, print the median canonical stint deg by compound and the share of stints with a positive slope. Expected shape: a two-row table per compound. Then explain why comparing these two races says almost nothing about the within-circuit temperature effect.

C3. Build the strategy: re-fit the temperature slope by season. ⭐⭐⭐ Rerun the within-circuit regression of Section 36.3 separately for 2023, 2024, 2025 and 2026 (compound + circuit FE, clustered by race), with the canonical fuel correction. Expected shape: four rows of per_10C with CIs, each based on 17–20 races. Is the pooled +0.017 stable across seasons, and does 2026 (new cars and tyres) differ?

C4. Analyze this session: locate the traps yourself. ⭐⭐ Run conditions.locate_speed_traps() on 2025 Suzuka qualifying (Anchor A's session). Print the three traps' fractions of the lap, match errors and turn angles. Expected shape: a three-row table like the checkpoint's Mexico City output. Which traps are on straights by the chapter's rule (turn ≤ 20°), and where on the lap does st_speed sit? Plot them on plots.track_map.

C5. Predict the race: rain at the start. ⭐⭐⭐ For every Grand Prix in the archive, compute whether any rain record falls in the 60 minutes before lap 1 starts, and whether the race then used wet tyres on lap 1. Expected shape: a 2×2 table of counts with Wilson intervals on the row shares. Compare the pre-race rain signal with the weekend signal of Section 36.5 (35% vs 15%). Which is the stronger predictor of a wet lap 1?

C6. Analyze this session: the 2025 Belgian GP rain flag. ⭐⭐ The 2025 Belgian GP race had 102 rain records (45.7% of its records) but only 20 laps on intermediates. Using wet.class_pace() and the per-lap rain share, plot the median slick lap and the share of rain-flagged laps by lap. Expected shape: intermediate laps concentrated at the start, then slick laps for the rest of the race with the rain flag still often set. Compute the wetness gauge on the laps after the field moved to slicks, if the race's own dry reference allows it.

C7. Build the strategy: a smarter wet policy. ⭐⭐⭐ Add a policy "smart" to conditions.drive(): at the end of each wet lap, fit intermediates only if the predicted gain over the expected remaining shower beats S2I + I2S. Use the median remaining length from SHOWER_LAPS, conditional on the shower having lasted this long already. Rerun 07_weather_monte_carlo.py with policies react, stay and smart. Expected shape: the scenario table with a smart − react and smart − stay column. In the 60% scenario the chapter found stay − react = −6.1 s overall. Does smart beat both?

C8. Compare these drivers: wind at Jeddah. ⭐⭐⭐ Jeddah was one of two circuits with a significant negative "headwind" coefficient (−0.68 km/h per m/s, CI −1.41 to −0.19). Load code/_cache/wind_long.parquet, take Jeddah alone, and refit per trap and per session kind. Expected shape: a table of coefficients with bootstrap CIs. Is the effect carried by one trap, one season or one session kind? With 24 circuits tested, what is your best estimate of the chance that one or two of them would look like this by chance?

Hints and partial results for Part C
  • C1. The race-window medians from code/_cache/race_conditions.parquet give 43.1 °C at the start and 32.6 °C at the end. Most cars stopped once, so compare each car's two stint means.
  • C2. Both races are in the dry-race set. Las Vegas is one of the low-wear circuits in the chapter's circuit table (its 2026 SOFT stints have a negative median slope). Monza and Las Vegas differ in layout, surface and allocation, so the comparison confounds everything with temperature.
  • C3. Expect wider intervals than the pooled one; with season FE included the pooled slope is +0.014.
  • C4. The chapter's stability check found the same trap located to within 0.49% of a lap across seasons.
  • C5. Remember the 2026 Bahrain GP in Malaysia: rain stopped well before the start, and half the field still started on intermediates.
  • C7. The conditional remaining length can be computed from SHOWER_LAPS directly: for a shower already $j$ laps old, take the median of $(L - j)$ over the observed lengths $L > j$.
  • C8. Two of 24 at the 5% level: the expected number by chance is 1.2, and the probability of at least two is about $1 - 0.95^{24} - 24 \times 0.05 \times 0.95^{23} \approx 0.34$.

Part D — Strategy & Judgment ⭐⭐⭐

D1. Call the pit stop: 2025 Australian GP, lap 44. Chapter 15 records that all 14 slick changes came on laps 33–39 under a safety car, and that rain arrived on lap 44, when the median slick lap went from 84.749 s (lap 43) to 88.332 s (lap 44). You are leading on slicks with 14 laps to go. The station flags rain on lap 44. Do you pit for intermediates at the end of lap 44, wait a lap, or stay out? Write your decision before reading on, using this chapter's tools: the gauge, the stop costs, and the wet-lap safety-car hazard.

What the data show

The median slick lap rose to 93.045 s on lap 45 and 98.086 s on lap 46; intermediates ran 91.718 s on lap 46 (6 cars). Nine cars pitted on lap 44 (Chapter 15). The excess on lap 44 was about 4% over lap 43, but it grew by several seconds a lap: this was a fast-building shower, the case where waiting costs most. With about 14 laps left, ask first whether the rain will last to the flag. If it will, a slick→intermediate stop (19.5 s) is the whole cost, because there is no stop back to slicks to pay. That changes the calculation completely from Section 36.7's two-stop bet, where the 29.3 s return stop made the early switch so expensive. The lesson: the price of an early switch depends on whether you must come back to slicks.

D2. Design the setup: hot Sunday at the Hungaroring. The Hungaroring sits 4 °C past the one-stop / two-stop line in the chapter's model, and its race track temperature has ranged from 31.7 °C (2025) to 50.8 °C (2026). The forecast for Sunday is 10 °C cooler than Friday. Using conditions.temp_adjusted_deg and the Section 36.3 line, argue whether a one-stop becomes viable. Then list what you would want to know from practice that the temperature cannot tell you, citing Case Study 2.

D3. Call the pit stop: a forecast at Singapore. Singapore, lap 30 of 62, dry. You are on the SOFT, planned to stop after lap 36. The team's meteorologist gives a 60% chance of a shower between laps 33 and 45. The safety-car hazard on wet laps is 2.38 times the dry one. Do you (a) stop now, (b) stop on lap 36 as planned, or (c) extend to lap 37? Use Section 36.8's results, and state which of the model's assumptions you are least sure of.

Discussion

The Monte Carlo favours (c): the latest stop the soft allows, here lap 37, which keeps the option of the rain stop doubling as the tyre change. The average gain is small (0.23 s over the clean-race plan at 60%), but it is large in the races where the rain comes before the stop (11.3 s). The weakest assumption is probably the single-car scoring: if rivals pit at lap 36, track position and traffic may matter more than tyre seconds.

D4. Design the setup: wind as a setup variable. A team says it trimmed its rear wing for a forecast tailwind on the main straight. Using Section 36.4, write a short memo on what evidence the free data can and cannot provide for or against that decision, and what extra measurement would settle it.


Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐

M1. (Chapters 3 and 36) Density and wind together. Chapter 3 measured Mexico City's air density at 0.904–0.905 kg/m³, about 21% below the typical session. Drag scales with $\rho$. Re-derive $dv/dw$ at terminal speed and show that it does not depend on $\rho$. Then explain why density changes the terminal speed itself but not its sensitivity to wind.

Solution sketch

$P = \tfrac12\rho C_dA(v+w)^2v$. Differentiating at fixed $P$ gives $2(v+w)v(1+v') + (v+w)^2v' = 0$, and the factor $\tfrac12\rho C_dA$ cancels. At $w = 0$, $v' = -2/3$ regardless of $\rho$. Density sets $v$ through $v^3 = 2P/(\rho C_dA)$: a 21% lower density raises terminal speed by $(1/0.79)^{1/3} - 1 \approx 8\%$. The relative effect of wind is unchanged.

M2. (Chapters 14 and 36) Anchor C's verdict under rain. Anchor C found that a pre-committed two-stop at Singapore is 10.10 s slower on average than the one-stop, and faster in only 18.9% of simulated races (Chapter 27's engine). Using Section 36.6's wet hazard ratio, argue qualitatively whether a 90% shower forecast should make the two-stop more or less attractive. Then check your argument against Section 36.8's finding that the best plan moves later.

M3. (Chapters 5 and 36) Two temperature effects. Chapter 5 found that preparation laps in qualifying become much more common on cold tracks (odds ×2.52 per −10 °C), while this chapter found that race degradation changes by only 0.017 s/lap per 10 °C. Explain how both can be true, using the idea of the tyre's operating window.

M4. (Chapters 15 and 36) Two crossover rules. Chapter 15's switch_decision(delta_s, pit_loss_s) chooses the switch lap that minimises race time for a predicted delta. This chapter's react policy switches at the per-lap crossover. Write a short script that, for one simulated shower from sample_weather_scenario, computes the lap-by-lap delta between slicks and intermediates with wet_lap_penalty_s and feeds it to switch_decision with the two-stop cost. Compare its choice with react's. Expected shape: two switch laps (or "stay out") and the net gain of each.

M5. (Chapters 22 and 36) Anchor B with temperature. Re-run the Chapter 22 Anchor B stop-lap calculation for the 2025 Mexico City GP with the FP2/FP3 degradation shifted to the race temperature using conditions.temp_adjusted_deg (+13.4 °C). Does the predicted stop lap move toward or away from Norris's actual lap 34? Explain the result with Case Study 2.


Part E — Research & Extension ⭐⭐⭐⭐

E1. A real forecast. Find a free historical weather source that has hourly cloud cover, precipitation or radar for the circuits in our data, and that you are allowed to download. Add it as an input to the rain nowcast of Section 36.5 and to the track-temperature model of Section 36.2. Does a cloud-cover forecast predict the track-minus-air excess better than the hour of the day? Report the improvement in MAE, with n. (Keep the downloaded data outside data/processed/ and document its licence.)

E2. Orient the map. The chapter could not confirm that the OpenF1 location frame is north-up. Design a test that could. Ideas: compare the shape of a circuit's x, y trace with its published latitude and longitude (Jolpica's circuits table gives one point per circuit; you would need an outline), or use the sun's position and shadows in onboard video. Write up the method, run it on one circuit if you can, and say what it would change in Section 36.4.

E3. Weather and qualifying. Section 36.3 studied race degradation. Qualifying is shorter and more sensitive to the tyre window (Chapter 5). Using the 2023–2026 qualifying sessions, estimate the within-circuit relationship between track temperature and the pole lap relative to the circuit's median pole, controlling for season. Separate wet sessions. Report the slope in % of lap time per 10 °C with a clustered CI, and discuss track evolution as a confounder.