WorksMathematics
A PDE-Based Model of Runner Flow in Mass Participation Events
Abstract
This paper presents a macroscopic approach for modeling pedestrian movement. A convection-diffusion partial differential equation (PDE) is described and used to model the flow of runners along a marathon course. A marathon is a good modeling case study for human movement because the location of runners is only known in sparse locations, so an accurate model is needed to know where people are at all times. As well, marathons offer many safety and logistical problems that can be solved by modeling human movement. Data is obtained from the 2023 Columbus Marathon, and model improvements are made to include a temporally varying convection term. Results show an increase in model accuracy which can allow for better resource allocation and safety measures.
Introduction
Large pedestrian events such as concerts, tourist events, and road running races can cause severe pedestrian congestion and lead to safety problems. The Boston Marathon bomb attack in 2013 provides a striking example of how crucial the management of large-scale events is and how public safety can be significantly improved by understanding and controlling the dynamics of crowd movement [17]. As well, logistical challenges can arise in less severe scenarios such as tourist season in Cinque Terre, where large numbers of people disembark from trains at very small stations, often leading to congestion and delays [5].
In order to model pedestrian movement and flows in large events two types of models are used, microscopic and macroscopic. In microscopic models, the focus is on individual movement among a crowd, with the movement being modeled by an ordinary differential equations (ODEs) [6]. One common type of microscopic pedestrian model is the cellular automaton model in which movement decisions for individuals are based on the state of neighboring cells [1] and the speed at which pedestrians move can be modeled via a probability distribution [19]. Another microscopic model is the social force model [8, 9] which uses attractive and repulsive effects to determine pedestrian behavior. Social force models have also been extended to incorporate the influence of the activity pedestrians are doing, whether that is running a race, leaving a large event, or visiting a popular tourist destination [3, 11]. While microscopic models accurately replicate pedestrian movement, they often suffer from high computational costs [6].
Instead, pedestrian movement can be modeled as a flow of people along a route, or numerous routes, as is done in macroscopic partial differential equation (PDE) models [18]. Macroscopic models were first introduced in Henderson [10] where pedestrian movement equations were derived from fluid flow. This model allowed for pedestrians to choose their own speed, but suffered from the assumption that the crowd was considered homogeneous. Another approach in Helbing [7], based on fluid principles, allowed pedestrians to choose their own desired speed. These fluid dynamic models, though, suffered in that they were only applicable in high density scenarios [12]. Other macroscopic models, such as that presented in Colombo and Rosini [4], aimed at modeling specific panic scenarios, which again were high density events.
This paper presents a novel macroscopic approach for modeling the flow of pedestrians, specifically along a marathon course. Every year in the USA, around 1000 marathons take place, some of them involving a large number of participants, such as the New York City Marathon that had 55,529 participants in 2024 [15], which makes marathons a great case study for model development. The model developed here is an improvement upon the model in [17], which is a convection-diffusion PDE which captures both the forward movement of the runners as well as the dispersion of runners throughout the race. The improved model uses both time and space dependent mean speed to describe runner movement as well as develops a method for determining the dispersion of runners. Often times, data is not available for the entire marathon course, just at certain checkpoints along the course, so being able to accurately model runner flow in parts of the course that don’t have data is paramount for safety and resource allocation. For example, it could be possible to predict critical times at each aid station, enabling the optimal assignment of volunteer tasks. Or, knowing when the last runners will pass through specific roads could allow for them to be reopened earlier and would provide a more accurate timetable. Additionally, choke points could be identified along the course where runners tend to crowd up, and a course reroute could be advised to alleviate this.
This paper is organized as follows. Section 2 presents the convection-diffusion model used. Section 3 showcases the available data from the 2023 Columbus Marathon used to validate the model. Then, Section 4 presents the results of the base model, with a temporally constant mean speed for the convection term. Finally, Section 5 presents an updated calculation for the convection term that includes a variably changing mean speed to incorporate runner slow down and different classes of runners, such as elite marathoners and average, everyday runners.
Convection Diffusion Pedestrian Model
Given that a marathon course is inherently unidirectional, a one-dimensional model is used. The model is formulated as a conservation equation:
where and denote distance and time, respectively, is the density, and is the flow. This model describes pedestrian movement as the combination of two different effects, convective transport and diffusion transport. Marathon dynamics can be seen as particles moving forward, however, rather than modeling the dynamics of individual particles, this model describes the dynamics of the whole runner pack. In this way, similar to the macroscale description of particle dynamics with Fokker–Planck equations [17], the spatial and temporal changes of runner density will be considered instead.
Convection is the mass transfer as a result of the bulk motion of a fluid, or the mass transport due to the average velocity of all molecules. In the case of the marathon, runners move at a certain velocity to reach the finish line causing the convective effects. Diffusion represents the spreading of a non-uniform concentration toward a more uniform distribution over time. In a marathon this is caused by runners having different fitness levels causing them to slow down as the race progresses. The flow relationship, taking into account convective and diffusion terms, can then be written as
where is the diffusion coefficient and is the mean speed. These parameters are initially assumed to be functions of space only. The first term in (2), , represents diffusion, capturing the spreading of runners from high- to low-density regions due to variability in individual speeds. Specifically, if , the diffusion term is negative, reducing the flow as density increases along the course. This reflects the natural behavior of participants that avoid moving toward crowded areas and tend to spread out where the density is lower. The extreme cases are: where people are completely dispersed and where people all move in one pack at the same velocity as if they were one single body.
The second term, , describes the movement of people toward the finish line with a certain speed. It describes the organized motion of the group, as opposed to the random spreading captured by the diffusion term. Regions where either the speed or the density is higher contribute to a greater flow of participants.
The complete set of equations is obtained by substituting (2) into (1)
The model is then simplified assuming that the parameters and are piecewise constant since data is only taken at every checkpoint along the course
For completeness, both initial and boundary conditions for (3) must be defined. The initial condition at , which is the beginning of the race, is defined as an empty course
The boundary condition at the beginning of the course is
where is the feed rate. The feed rate describes how runners enter the course after the starting gun and is examined in the next section. At the end of the course, an open boundary condition is imposed
allowing runners to freely exit once they reach the finish line.
To solve (3), the model is first non-dimensionalized and then discretized using the Crank–Nicolson method, a second-order finite difference scheme in time. The variables are non-dimensionalized to ensure appropriate scaling over the full course length. Specifically, time is scaled by the final time , space by the course length , and and by and , respectively. These transformations define the dimensionless variables , , , and . Substituting these new variables into (4) and isolating the term of the time derivative, the non-dimensional convection-diffusion model is
where is the nondimensionalized diffusion term and is the nondimensionalized speed.
To apply the Crank–Nicolson method, the continuous model must be discretized in both time and space. This involves introducing a temporal grid with time steps of size and a spatial grid with steps of size . The Crank-Nicolson method approximates the derivative of a given variable with respect to with differences as follows:
This approximation is equivalent to assuming that the value of at corresponds to the average of its values at and . In this method the interior nodes and boundary nodes are calculated differently. For interior nodes, the derivative with respect to is approximated via a central difference formula
Then, the second spatial derivative of with respect to in the interior nodes is computed in as
At the boundaries it is not possible to use the central difference formula, so a Taylor series expansion at each boundary is used. At , a forward Taylor series expansion is used, which results in
Combining all equations for the boundary at and computing some substitutions, the Crank-Nicholson update is
where all terms for are on the left-hand side. Following a similar approach, it is now possible to obtain the equation for , the boundary condition at the end of the course, but this time using a backward Taylor series expansion. The Crank-Nicholson update at is thus
After discretizing the interior nodes and applying the boundary conditions, the resulting equations are assembled into a tridiagonal matrix system. This system is solved using a direct Gauss–Jordan elimination method, which applies forward elimination to obtain an upper triangular system, followed by back substitution to solve from the last equation to the first.
Data Analysis
The data provided comes from the 2023 Columbus Marathon [14]. The data includes biographical data as well as race specific data such as chip start time, time to cross race checkpoints, and finish time for the 2967 runners. The chip start time measures when a runner crosses the start line and the race checkpoints occur at 7 km, 15 km, 13.1 m (21.1 km), and 20 m (32.2 km). An example set of data is shown in Figure 1.

Figure 1. Sample of the Columbus Marathon datasets with runner times at multiple checkpoints.
The time at which each runner arrives at the race checkpoints is shown in Figure 2 which presents five lines, one for each checkpoint and the finish line. The fastest runners arrive at the first checkpoint in less than 30 minutes and finish the race in less than 2.5 hours, while it takes the slowest runners close to 7 hours to finish. At 7 km, the gap between the first runner and the last one is about forty minutes, while at the finish line the value increases to more than four hours. From the halfway point to 20 miles, the slower runners start to fatigue, a phenomenon known as ‘hitting the wall’ in which runners begin to exhaust physiologic carbohydrate reserves and start to slow down Rapoport [16]. This behavior is an important factor for the model to capture.

Figure 2. Runner arrival times at each checkpoint.
The flow and density are calculated from the provided data as
where is the flow of runners crossing position at time , is the number of runners crossing within the interval , and represents the number of runners that move in the space interval at time . The space interval is not constant, but is calculated as the difference between consecutive checkpoints. The boundary condition at , or the feed rate , is shown in Figure 3. Figure 3 also shows the cumulative number of runners entering the course.

Figure 3. Cumulative number of runners and corresponding feed rate at the race start.
The line in the top plot assumes an S-shape, creating two waves, separated by 3 minutes. This is done by the race organizers to reduce congestion along the course. The first wave corresponds to about two-thirds of the total number of runners. All runners enter the race in less than 20 minutes.
Base model results
The mean speed of the runner pack is an important parameter of the model which represents convection transport. The mean speed, is first calculated as only a function of space. The speed of each runner at each checkpoint is calculated as
where the index represents a checkpoint and represents the following one, and the index indicates the number of the runner. In Eq. (20), is the distance in kilometers that corresponds to the checkpoint , is the distance in kilometers that corresponds to the checkpoint , is the time after which the runner is at the checkpoint , is the time after which the runner is at the checkpoint , and is the speed of the runner between and .
After calculating all the velocities of all runners, the average over all runners is computed, and a vector of five points is obtained, one for each spatial interval. Figure 4 shows the mean speed of runners as a function of space. As expected, the mean speed is a mostly decreasing function of space, except for the interval between 15 km and 13.1 miles. This is due to marathon runners being influenced by

Figure 4. Mean runner speed as a function of course distance.
the faster half marathon runners who are finishing, since both races occur on the same course.
The diffusion coefficient is the second parameter of the model that is used to represent diffusion transport. As with the mean speed, this parameter is a function of space, but conversely to the mean speed it is expected to be increasing in space because as the marathon goes on the runners spread more along the race course due to their different velocities and aerobic capacities. The diffusivity is described by the following equation
It is not possible to find the diffusion directly from Eq. (21) with the available data; therefore, a parameter identification algorithm is used which finds the diffusivity that minimizes the error between the real flow and the flow generated with the model. The algorithm used is called Particle Swarm Optimization (PSO), as described in (JE and Eberhart, 1995). The function used for diffusivity is a replication of the diffusivity shown in Rodriguez et al., [17], representing the diffusion coefficient of the Chicago Marathon. The function is as follows:
Here , , , and are the parameters to be found. The PSO algorithm aims to minimize the root mean square error (RMSE)
where
and the index represents the different checkpoints and represents the different instants in time. is the real flow that crosses the checkpoint at the instant and is the corresponding estimated flow from the model. This results in Figure 5 where, as expected, is an increasing function of space, which is consistent with what has been observed in the previous analysis. This is due to the fact that runners disperse along the race course.

Figure 5. Diffusivity as a function of course distance.
The comparison of flow rates at each checkpoint and the finish line for the real data and model is shown in Figure 6. The model captures the main trends in the data, including the temporal spreading of flow at each checkpoint as runners disperse over time. Specifically, the curves tend to spread over time at each checkpoint due to the fact that at the beginning the participants run relatively together until they begin to spread out as they tire. The peaks indicate the average arrival time of the main group of runners at each checkpoint. This time is important for race organizers as it lets them know when the majority of runners have crossed a checkpoint so that they can better allocate volunteers or begin to open up closed roads along the route.

Figure 6. Measured and modeled flow rates at each checkpoint using the constant speed model.
Table 1 compares average checkpoint times from data and model. The values in the first column are calculated using the arithmetic mean:
| Checkpoint | Real Data [hr] | Model [hr] | RMSE | |
| 7 km | 0.7339 | 0.7503 | -2.2339 | 11.27 |
| 15 km | 1.5211 | 1.5174 | 0.2460 | 6.57 |
| 13.1 miles | 2.1113 | 2.1061 | 0.2460 | 6.11 |
| 20 miles | 3.2704 | 3.2043 | 2.0203 | 4.61 |
| Finish | 4.3462 | 4.1562 | 4.3714 | 3.94 |
Table 1. Mean times at each checkpoint.
where is the index of the checkpoint, is the index of the runner, is the total number of runners, and is the time after the gunshot at which the runner reaches the checkpoint . The second column is computed from the model results using a weighted average, where the flow acts as a weight
where is the index of the discrete time step, is the total number of time steps in the model, is the modeled flow at checkpoint and at time , and is the time elapsed since the gunshot at step . The percentage difference is then computed as:
The model overestimates the time to cross the first checkpoint as shown in Table 1, but in the back half of the race the error grows to an almost 4.4% underestimation of the finishing time.
Improved Model Results
In this section, instead of a spatially varying mean speed, , the model is extended to incorporate also a temporally varying mean speed, . Intuitively, mean speed varies over both time and distance as runners passing through earlier in the race will be faster and shouldn’t influence the mean speed of the following runners. This effect is know as hitting the wall ([2, 16]) and is caused by runners’ previous training and nutrition. In the former approach in the previous section, the mean speed was averaged over all runners, but this results in an underestimation of the lead runners and an overestimation of the speed of the runners at the back.
In order to implement the new mean speed function, that is , which varies over space and time, a time interval must be defined which in this case is h. Then, the approach consists of ordering from the fastest runner to the slowest each column of the dataset containing the time after which each runner reaches each checkpoint. Once the columns are sorted, runners are separated into groups based on the hour in which they reach each checkpoint. The mean speed is determined by computing the average of the velocities of the runners in each group.
Figure 7 shows the new mean speed function, where the x-axis is the distance of the race in kilometers, and the y-axis is still the mean speed in km/h. This graph shows seven different curves, one for each hour of the race. The plots go to zero where no one is running. For example, no runner runs more than about 20 km in the first hour. The second hour is the most spread function, where some people have already ran 35 kilometers, and some others are still running at the tenth kilometer.

Figure 7. Mean runner speed as a function of space and time.
Earlier runners exhibit higher mean speeds, while later groups reflect fatigue effects. In addition, fast runners finish the race within the first 2.5 hours, so they are no longer considered in the computation of the mean speed. Once the new mean speed is found, it is possible to use it as an input to the model, where at each hour a different mean speed vector is chosen. Figure 8 shows the resulting modeled flow rate at each checkpoint, compared against the data. As in Figure 6, the model represents the data well.

Figure 8. Measured and modeled flow rates at each checkpoint using the time-varying speed model.
As shown in Table 2, the improved model provides a more accurate estimate of the average runner. In the first checkpoint the error is decreased by roughly 2% and the average finishing time error is also decreased by 2%. For the other checkpoints, the new model estimates the average crossing time almost exactly.
| Checkpoint | Real Data [hr] | Model [hr] | RMSE | |
| 7 km | 0.7339 | 0.7296 | 0.5889 | 12.31 |
| 15 km | 1.5211 | 1.5120 | 0.6012 | 7.01 |
| 13.1 miles | 2.1113 | 2.1104 | 0.0408 | 6.19 |
| 20 miles | 3.2704 | 3.2679 | 0.0749 | 5.05 |
| Finish | 4.3462 | 4.2433 | 2.3670 | 4.61 |
Table 2. Time comparison at every checkpoint using variable mean speed.
Conclusion
This paper presented a way of modeling flow during a mass event, such as a city marathon. First, a PDE model of pedestrian flow was presented and then real world data was taken from the Columbus Marathon and analyzed. This data was then used to validate the base model. Finally, model improvements were made by defining a spatially and temporally varying mean speed to better capture the characteristics of the event, such as runners slowing down as they get towards the end of the race. The improvements to the mean speed calculation were able to better model the movement of runners along the course, reducing average time to reach checkpoints along the course by up to 2%.
Future work will look at using this model to reduce areas of high runner density along the course, to analyze the impact of changing how runners start the race, and to better plan the assignment of aid stations and resources along the course. As well, this approach will be extended to model other large events such as concerts, fairs, parades, and festivals such that organizers can create better plans for crowd control and safe evacuation.
References
- [1]Blue, V.J. and Adler, J.L. (1998). Emergent fundamental pedestrian flows from cellular automata microsimulation. Transportation Research Record, 1644(1), 29–36.DOI
- [2]Buman, M.P., Brewer, B.W., and Cornelius, A.E. (2009). A discrete-time hazard model of hitting the wall in recreational marathon runners. Psychology of Sport and Exercise, 10, 662–666.DOI
- [3]Campanella, M., Hoogendoorn, S., and Daamen, W. (2014). The nomad model: Theory, developments and applications. Transportation Research Procedia, 2, 462–467.DOI
- [4]Colombo, R. and Rosini, M. (2005). Pedestrian flows and non-classical shocks. Math. Methods Appl. Sci., 28, 1553–1567.DOI
- [5]del Cacho Estil-les, M.A., Bersani, C., Sacile, R., and Zero, E. (2023). Optimal travel planning of short stays in mass tourist destinations. IEEE Access, 11, 89152–89163.DOI
- [6]Duives, D.C., Daamen, W., and Hoogendoorn, S.P. (2013). State-of-the-art crowd motion simulation models. Transportation Research Part C: Emerging Technologies, 37, 193–209.DOI
- [7]Helbing, D. (1998). A fluid dynamic model for the movement of pedestrians. Complex Systems, 6, 391–415.DOI
- [8]Helbing, D., Buzna, L., Johansson, A., and Werner, T. (2005). Self-organized pedestrian crowd dynamics: Experiments, simulations, and design solutions. Transportation Science, 39(1), 1–24.DOI
- [9]Helbing, D. and Molnár, P. (1995). Social force model for pedestrian dynamics. Phys. Rev. E, 51, 4282–4286.DOI
- [10]Henderson, L.F. (1971). The statistics of crowd fluids. Nature, 229, 381–383.pubmed.ncbi.nlm.nih.gov/16059256
- [11]Hoogendoorn, S. and Bovy, P. (2004). Pedestrian route-choice and activity scheduling theory and models. Transportation Research Part B: Methodological, 38(2), 169–190.DOI
- [12]Hughes, R.L. (2002). A continuum theory for the flow of pedestrians. Transportation Research Part B: Methodological, 36(6), 507–535.DOI
- [14]Results, M. (2023). Nationwide children’s hospital columbus marathon 2023 results. https://doi.org/www.mtecresults.com/event/show/5003/2023_Columbus_Marathon
- [15]Runners, N. Y. R. (2024). Tcs new york city marathon 2024 results. <a href="https://doi.org/https://results.nyrr.org/event/M2024/finishers" rel="noopener noreferrer" target="_blank">https://doi.org/https://results.nyrr.org/event/M2024/finishers</a>
- [16]Rapoport, B.I. (2010). Metabolic factors limiting performance in marathon runners. PLoS Computational Biology, 6(10).DOI
- [17]Rodriguez, E., Espinosa-Paredes, G., and Alvarez-Ramirez, J. (2014). Convection–diffusion effects in marathon race dynamics. Physica A: Statistical Mechanics and its Applications, 393, 498–507.DOI
- [18]Shiwakoti, N., Sarvi, M., and Rose, G. (2008). Modelling pedestrian behaviour under emergency conditions: State-of-the-art and future directions. 31st Australasian Transport Research Forum, ATRF 2008, 457–473.
- [19]Song, Weiguo, Yu, Yanfei, Fan, Weicheng, Zhang, and Heping (2005). A cellular automata evacuation model considering friction and repulsion. Science in China Ser. E Engineering & Materials Science, 48, 403–413.DOI