Simulation of distribution of runners on a marathon course. Simulated for full and half marathon only, not for other distances like 1/4 marathon or business run.
- Uses start waves, total number of runners equally distributed over waves.
- Normal distribution or gamma distribution is okay to use, based on the 2017 marathon data. (see distribution_identification.md)
- Assumes pace distribution is the same for all start waves and distances. This is not fully correct, faster runners will start mainly in earlier waves.
- Assumes all runners starts simultaneously, per wave. Number of runners distributed evenly over waves.
- Assumes constant pace during the entire race.
- Generate animation of distribution over runners over the course (moving histogram)
- Show number of runners crossing the finish line as function of time.
- Animated heatmap of runners on the course (I think this is really cool!)
- Combine half and full marathon
- For ASML Marathon Eindhoven 2024:
- Half marathon has 5 start waves with 10 minute intervals, starting at 11:30 (total 17500 runners).
- Full marathon has 1 start wave which lasts around 10 minutes, starting at 10:00 (10:00 - 10:10), 6000 runners. (modelled as 10 waves with 1 minute interval)
- Added event with start times as in previous editions of this even (full at 10:00, half at 14:00). Compared effect of both schedules on number of finishers over time
I estimate the number of finishers at around 260 per minute during the hour after 200 minutes from the start of the full marathon. So for a start at 10:00 this translate to 260 runners per minute from 13:20 - 14:20.
Screenshot from moving histogram (top left) and the number of finishers as function of time for full and half marathon, and for the sum of these distances.
Screenshot from an animated heatmap for full distance.
Number of runners in the simulation is changed to 10% of actual starts to limit the file size. With all runners a >350 Mb html file is created. That runs remarkable smooth on a browser but adds no value to the visualization.
Screenshot from an animated heatmap for both distances
As 260 finishers per minute seems quite a lot to me I made a reference (as suggested by @CanCakiroglu) for a previous marathon in Eindhoven. In 2023 the start for the full marathon was at 10:00 and the half started at 14:00 in the afternoon. I don't exactly know the number of runners for that edition but I used the same numbers as for the 2024 edition. Below graph shows the finishers over time. In the steepest part the number of runners crossing the finishline is approximately 145 per minute. Significantly lower that the predicted number for the 2024 edition.
![](https://private-user-images.githubusercontent.com/149044252/368318682-1eb5fd93-c4e7-48e0-98a8-33b3bc8e909b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTUzMTgsIm5iZiI6MTczOTAxNTAxOCwicGF0aCI6Ii8xNDkwNDQyNTIvMzY4MzE4NjgyLTFlYjVmZDkzLWM0ZTctNDhlMC05OGE4LTMzYjNiYzhlOTA5Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOFQxMTQzMzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yYzc5NDQ3ZmJjZTJiZTBjZDE0NWM0NDcyNzc5YmQxMjdkMDVkNjAyZmIzNjQ5YmJjODA3NDZiMjViYTVmYWZiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2Yo1QnF5oLu3pYUleF_YXGMN40iH9slMxYXW23YFTfg)
Number of finishers over time for the start schedule as used in 2023.
In order to compare the number of finishers over time the growth rate, maximum groth rate, and Full Width at Half Maximum (FWHM) was calcualted. The growth rate essentially tells how fast runners are finishing at any given point in time. The peak growth rate shows the maximum at which runners are crossing the finish line. FWHM shows the time window over which the majority of the runners are finishing, helping race organizers understand congestion patterns at the finish line.
Below graphs show this information for a reference marathon where the half marathon starts 4 hours (240 minutes) after the full marathon. In the 2024 marathon the start between full and half is 90 minutes. For both editions calculation was done with 6000 full marathanon runners in a 10 minute start wave, and 17500 half marathon runners in 5 start waves, every 10 minutes.
2024 Marathon | Reference Marathon |
---|---|
![]() |
![]() |
Note that the y-axis of reference and 2024 marathon are not the same
Several files are located in the source directory. Output of graphs and animation (HTML) are located in the images directory. Filenames of the output is equal to the python file, only a different exetnesion and in some cases additional info.
Function of files in source:
As you see, there is no file with standard parameters like number of runners or some functions. See issue #4
Why is this at the end you may ask? Well, that seems a nice place.
Run pip install -r requirements.txt
to retrieve the packages used in the simulation.
You also need ffmpeg to create the animations. Details on how to do this can be found on stackoverflow.
R 4.3.3. was used with lubridate_1.9.3 and fitdistrplus_1.2-1 for determining the distribution, the mean pace, and the standard deviation.