Introduction

A self-oscillator is a unit with an internal source of energy (to overcome dissipation) that continuously and autonomously performs rhythmic motion. It is stable against perturbations on its amplitude but neutrally stable over perturbations on its phase. The latter allows an array of coupled self-oscillators to undergo phase synchronisation, as individual members affect others’ phases through their nonlinear interactions1. This simple framework has provided a paradigm of immense utility for investigating various synchronisation phenomena, comprising circadian rhythms2,3, neurons4, Josephson junctions5,6,7, a raft of other physical, chemical, social systems8, as well as complex networks9. Plenty of research has been devoted to this area with rigorous mathematical treatments1. In particular, coupled self-oscillators exhibit phase transition: synchronisation emerges if coupling exceeds a critical threshold1,10,11,12,13.

Dynamics of bus bunching, in contrast, is not as extensively studied by a physics approach. Buses arriving at bus stops in bunches forces commuters to face extended waiting times; and whilst indubitably undesirable, such occurrences are stable14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31. Bus bunching is a physical phenomenon of a complex socio-technological system. Hitherto, it is distinct from the concept of oscillator synchrony. Nevertheless, are there correspondences between them? Here, this paper establishes these connections and reveals the entrainment mechanisms of buses serving a loop of bus stops which underlie major bus routes at the heart of cities across the globe. Although many of the previous work on this subject had identified this problem and the inevitable occurrence of bunching14,15,16,18,20, we have not encountered an approach based on a physical mechanism for synchronisation of coupled oscillators. Instead, some research dealt with potential strategies towards nullifying bus bunching by holding or delaying some buses, with some extending to adaptive and dynamic controls according to real-time situations17,19,21,22,23,29,31, as well as exploring the effects of buses with wide doors24,25,30 or engineering the locations of bus stops along the bus routes27.

We present our physical theory of a bus loop system inspired by the Kuramoto model of coupled oscillators10,11 in the next section, followed by extensive simulation results in Section 3. Section 4 is devoted to real data from a university’s bus loop system, which turn out to agree with the predictions of the theory. Some discussion concludes the paper, and technical derivations are given as Supplementary Information.

Analytical Theory

Consider a bus system comprising N buses serving M bus stops in a loop. Each bus i, where \(i\in \{1,\ldots ,N\}\), is a self-oscillator: It has its own engine, fuel, and autonomy to travel along the loop; being human-driven, or driverless in the near future. Motion of bus i is independent of its position or phase \({\theta }_{i}\in [0,2\pi )\) on the loop; it always moves with its natural (angular) frequency \({\omega }_{i}=2\pi {f}_{i}=2\pi \)/Ti. If traffic slows it or if it momentarily accelerates, after that it just continues with \({\omega }_{i}\) without correcting for that phase perturbation (neutral stability). Without bus stops, bus i loops around with \({\omega }_{i}\), oblivious and unaffected by other buses which can overtake. With bus stop j present, where \(j\in \{1,\ldots ,M\}\), each bus i must spend a stoppage \({\tau }_{ij}\) to board/alight passengers. Here, stoppage refers to a bus being interrupted from its motion, as it has to stop at the bus stop to allow passengers to board or alight. We consider loading as the dominant process during \({\tau }_{ij}\), with passengers alighting simultaneously via different doors. So, this stoppage \({\tau }_{ij}\) is due to Pj :\(=\) number of people at bus stop j; and l :\(=\) loading rate onto the bus, i.e. \({\tau }_{ij}={P}_{j}\)/l. The loading rate l is the same for each bus i at each bus stop j. Bunched buses share the load equally, and would leave the bus stop simultaneously when everybody has been picked up. Furthermore, Pj depends on the time headway Δtij between bus i and the bus immediately ahead (temporal phase difference), together with the average rate of people arriving at bus stop j, denoted by sj. This time headway Δtij (Fig. 1) is defined as the time interval between the moment the bus ahead leaves bus stop j (so Pj resets to 0) and the subsequent moment when bus i leaves bus stop j (resetting Pj to 0). Hence \({P}_{j}={s}_{j}{\rm{\Delta }}{t}_{ij}\), and overall:

$${\tau }_{ij}={k}_{j}{\rm{\Delta }}{t}_{ij}$$
(1)

gives the stoppage of bus i at bus stop j as a function of Δtij. The quantities kj :\(=\)sj/l < 1 are parameters that determine the strength of the coupling amongst buses due to bus stops, as they determine how long a bus has to stop at the bus stop, together with Δtij. In other words, the strength of kj would magnify the effect of Δtij in slowing down the buses. Later in Eq. (2), we see that kj appears in the expression for the average angular velocity for a bus where a higher kj would cause it to experience lower average angular velocity, and vice versa.

Figure 1
figure 1

Time headway Δtij (temporal phase difference) with respect to bus stop j between bus i and the bus immediately ahead: the time interval between the moment the latter leaves bus stop j and the moment bus i leaves bus stop j.

We summarise the dynamics of our model for the bus loop system as follows, where we would also implement in our simulations in Section 3:

  1. 1.

    A bus moves at its natural speed if it is not at a bus stop.

  2. 2.

    A bus would stop to allow alighting and boarding (simultaneously) if it is at a bus stop.

  3. 3.

    Suppose a bus is currently at a bus stop. If there is nobody on the bus who wishes to alight and there is nobody at that bus stop waiting to board, then the bus leaves and moves with its natural speed.

  4. 4.

    People are continually arriving at bus stop j (one person at a time), at a rate of sj people per second. Equivalently, one person arrives at bus stop j every 1/sj seconds. (In our simulations in Section 3, we use the latter.)

  5. 5.

    People board or alight a bus at a rate of l people per second.

  6. 6.

    For every person who boards a bus, we assign its destination to be the bus stop which is antipodally located (or near antipodal, if there is an odd number of buses).

  7. 7.

    Bunched buses share the load equally.

This model describes a ring of discrete-local-unidirectionally coupled self-oscillators for this bus loop system. The coupling is discrete as it only happens at bus stops; local because \({\tau }_{ij}\) only depends on the time headway from the bus immediately ahead; unidirectional due to only the leading bus directly affecting the trailing bus. Nevertheless, during the process where one bus bunches into another, these two buses directly affect each other i.e. bunched buses are bidirectionally coupled, since these buses have their load shared. A group of bunched buses can be regarded as one independent unit, so overall the whole system is viewed as having each independent unit unidirectionally affecting the independent unit directly behind it. In our simulations below in Section 3 based on the model described above, each bus moves autonomously as a self-oscillator. Evidently, the unidirectional effect is manifested by the fact that the number of people at the bus stop depends on how long ago the bus immediately ahead has left the bus stop. On the other hand, bunched buses mutually affect each other via their sharing of the load. This is also how real bus systems behave, for example in Section 4 below on a university campus loop shuttle bus service.

Note that: (1) Δtij and \({\tau }_{ij}\) are directly measurable physical quantities; (2) \({\tau }_{ij}\) depends on Δtij and kj, but not explicitly on \({\omega }_{i}\). Point (2) implies that inevitably present stochasticity of \({\omega }_{i}\) in real systems do not affect the relationship between Δtij and \({\tau }_{ij}\): If \({\omega }_{i}\) is slower, then Δtij and correspondingly \({\tau }_{ij}\) [via Eq. (1)] are increased. In addition, multiple (arbitrarily located) bus stops between bus i and the bus ahead would certainly delay it but not affect the relationship between Δtij and \({\tau }_{ij}\), i.e. this analytical treatment applies to any \(N,M=0,1,2,\ldots \). Hence, we can employ Eq. (1) to empirically determine kj by measuring \({\tau }_{ij}\) and Δtij. Intriguingly, whilst Eq. (1) is linear, the coupling dynamics amongst buses is nonlinear. This is manifested by the average (angular) velocity of bus i over a time interval \(\eta +{\tau }_{ij}\) (where \(\eta \) excludes stoppage) as it traverses bus stop j:

$$\langle \frac{d{\theta }_{i}}{dt}\rangle ={\omega }_{i}\,(1-\frac{1}{1+\eta /{k}_{j}{\rm{\Delta }}{t}_{ij}}),$$
(2)

i.e. \(\langle d{\theta }_{i}/dt\rangle \) has a coupling term −\({\omega }_{i}/(1+\eta /{k}_{j}{\rm{\Delta }}{t}_{ij})\) [a function of phase difference]. This is analogous to the Kuramoto model for synchronisation of an array of coupled self-oscillators whereby Eq. (2) has coupling term of the form \(K\,\sum \,\sin \,{\rm{\Delta }}{\theta }_{ij}\)10,11. Unlike the original Kuramoto model where coupling is a mean field globally contributed by every self-oscillator and is continuous, buses experience discrete coupling at bus stops (pulses), which is local (depending only on the bus immediately ahead) and unidirectional (instead of mutual).

Incidentally, there are various extensions to myriads of systems involving local coupling, different lattice arrangements of the oscillators, selective directional coupling, weighted and time-varying coupling, etc. carrying the name “Kuramoto”4,5,6,7. These mainly still have a sine term in the coupling, highlighting the 2π-periodicity with respect to phase difference. The Kuramoto model, however, assumes weak coupling with several other approximations/simplifications (see for example, ref.1). There are in fact, more general coupling functions32,33. Our derivation for the bus system here is exact.

Buses bunch in two ways: (1) frequency detuning; (2) phase locking. Due to frequency detuning, a fast bus catches a slow one, overtakes, then escapes: The system exhibits periodic bunching. This is always present due to human drivers’ distinct \({\omega }_{i}\). In contrast, strong coupling during high demand causes phase synchronisation where some adjacent pair of buses’ spatial phase difference, Δθ, becomes small and bounded. Hence, we classify the bus system’s dynamics into two phases (note the dual usage of “phase”): (a) lull, where periodic bunching occurs due to frequency detuning; and (b) busy, where phase locking (sustained bunching) forms at high demand. Frequency detuning is a double-edge sword: It is a source of non-synchrony in an ensemble of oscillators (purportedly preferable in undoing clustering), but simultaneously prevents stable constant Δθ (which is inappropriate).

Coupled self-oscillators generally experience phase synchronisation, given sufficiently strong coupling. For instance, the Kuramoto model provides an exact analytical treatment for infinitely many oscillators with natural frequencies given by a unimodal symmetric distribution g\((\omega )\). By considering the density distribution of these oscillators over the loop, the critical transition for synchronisation occurs at \({K}_{c}=2/\pi g(0)\)10,11,12,13. For finite \(N=2,3,\ldots \) buses, we derive an analytic expression for the critical kc where phase transition occurs between complete (CPL) and partial phase locking (PPL). Suppose each of the M bus stops has equal people arrival rate s (so k :\(=\)s/l) and they are perfectly staggered. This kc is:

$${k}_{c}(N)=\frac{1}{M}\,\sum _{i=1}^{N-1}\,(1-\frac{{\omega }_{N}}{{\omega }_{i}}),$$
(3)

where the N buses have natural frequencies \({\omega }_{1} > \cdots > {\omega }_{N}\), respectively [derivation of Eq. (3) in the Supplementary Information]. Buses in CPL would bunch as a single unit at each bus stop. After picking up everybody, they leave simultaneously with the faster ones pulling away, but get bunched completely at the next bus stop due to high demand. They are thus in equilibrium, with this sequence of events repeating at every bus stop. Equation (3) gives a dimensionless quantity, depending on dimensionless ratios \({\omega }_{N}/{\omega }_{i}={f}_{N}/{f}_{i}={T}_{i}/{T}_{N}\).

An N-bus system is CPL if \(k > {k}_{c}(N)\). There is another critical \(\overline{k}\le {k}_{c}(N)\) marking the phase transition between PPL and no phase locking (NPL). If \(k < \overline{k}\), then all buses do not experience phase locking but occasionally bunch due to frequency detuning. PPL is the regime \(\overline{k} < k < {k}_{c}(N)\). The lull phase refers to NPL where bunching only occurs due to frequency detuning; the busy phase includes both PPL and CPL where at least one sustained bunching is present. The case \(N=2\) is special: \(\overline{k}={k}_{c}(2)\) with only NPL (lull) and CPL (busy). In real bus systems, we should never have to encounter CPL where all N buses bunch together, as this would be a highly inefficient system.

Simulations

We carry out extensive simulations to determine the various degrees of local clustering of sustained bunching. This is done for \(N=2,3,4,5,6,7\) buses, respectively, with natural frequencies given in Table 1, serving \(M=1,2,\ldots ,12\) staggered bus stops, respectively, in a loop. From Eq. (3), theoretical values of kc(N) for the transition between PPL and CPL are calculated and compared directly with the simulation results in Figs 2 and 3. Note that Table 1 only shows the analytical values of kc(N) for 12 bus stops, as \(M=12\) is of particular interest with regards to a real bus loop system (see the next section).

Table 1 Table of kc for various N buses with different fi [0.93, 1.39] mHz.
Figure 2
figure 2

Simulation results of \(N=2,3,4,5,6,7\) buses, respectively, serving \(M=1,2,3,4,5,6\) bus stops in a loop, respectively: The number of bunched buses increases stepwise as k increases. CPL is the region \(k > {k}_{c}(N)\), where all \({\rm{\Delta }}{\theta }_{{\rm{\max }}}\sim 0^\circ \). NPL is observed to occur when \(k < \overline{k}\sim {k}_{c}(2)\), where all \({\rm{\Delta }}{\theta }_{{\rm{\max }}}\sim 180^\circ \). PPL for \(N > 2\) lies in between these extremes, as demarcated by the two vertical lines in the graphs. These vertical lines are analytical values from Eq. (3).

Figure 3
figure 3

Figure 2 continued, with \(M=7,8,9,10,11,12\) bus stops, respectively.

For each bus, its Δθ is the phase difference between itself and the bus immediately ahead of it. We run the simulations over a very long time and measure the maximum value of Δθ in the steady state part of the simulation. This maximum value of Δθ is Δθmax. If there are N buses, then there are N such Δθmax. Generally, an N-bus system has N − 1 independent local phase differences. If there is local clustering between a pair of buses, then its Δθmax, is small (~0°); whereas large Δθmax (~180°) signifies no local phase locking since it is able to open up a large phase difference. The number of small Δθmax represents the degree of local clustering. As shown in Figs 2 and 3, increasing k would increase the degree of local clustering stepwise until kc(N) where CPL emerges with all Δθmax ~ 0°. Our simulations register slightly higher kc(N) for the critical transition between PPL and CPL than the analytical results given by Eq. (3). This is because people are discrete. If “0.9 person” is due to arrive, then the bus(es) would leave instead of loading that “0.9 person”. So, slightly stronger coupling is required to keep them bunched.

Whilst we do not have the analytical calculation for the critical \(\overline{k}\) for \(N > 2\) that marks the transition between NPL and PPL (because these are non-equilibria with unbunched buses continually affecting the bunched pair), simulations suggest that this phase transition occurs at \(\overline{k}\sim {k}_{c}(2)\), for that respective M. Thus, \({k}_{c}(2) < k < {k}_{c}(N)\) is a reasonable indication of PPL. In fact, as kc(2) for \(N=2\) represents the critical value where the two buses would exhibit persistent bunching, for \(N > 2\) this same value kc(2) gives an order of magnitude when two of these N buses may begin to experience persistent bunching as well, hence \(\bar{k}\sim {k}_{c}(2)\). In the real world however, other perturbations like non-constant speed, traffic influences, as well as stopping at junctions may play a part in affecting the dynamics. Note that although \(k < \overline{k}\) such that all Δθmax = 180°, simulations reveal transient local clustering periodically appearing.

The simulations with different number of bus stops \(M=1,2,\ldots ,12\) affirms that M only acts as a multiplier of the coupling strength, whilst the qualitative features are essentially identical. Furthermore, we also run separate simulations with \(M=12\) bus stops where the set of frequencies in Table 1 are all doubled, as well as all halved, presented in Fig. 4. Once again, the qualitative features are essentially identical to Figs 2 and 3.

Figure 4
figure 4

\(M=12\) bus stops, with the entire set of frequencies being doubled (left) and the entire set of frequencies being halved (right).

Data Analytics on the Nanyang Technological University Campus Buses

We can apply our physical theory of buses as a synchronisation phenomenon to our Nanyang Technological University (NTU) Campus Buses34. We collect and process positional data for buses on the Blue route. Live data can be found here: https://baseride.com/maps/public/ntu/. There are \(M=12\) bus stops along a loop within our campus (see Fig. 5), usually served by 3–4 buses (1–2 during off-peak hours), with 7–8 buses over busy periods (weekdays 8.30–10.30 am). These human-driven buses do not have identical natural frequency, but take an average of 12–18 minutes to complete a loop without stoppages, i.e. \({f}_{i}\in [0.93,1.39]\,{\rm{mHz}}\). This frequency range forms the basis for the prescribed fi in Table 1. Bus bunching is a highly observed phenomenon, with 4–5 buses bunching together being a ubiquitous sight in NTU. This perennial and notorious issue on bus bunching affects students, staff and faculty members who live, work and play in NTU.

Figure 5
figure 5

Left: A map of the Blue route of the Nanyang Technological University, Singapore campus shuttle buses. Buses go clockwise. Right: An isometric map (which preserves distance) of the actual route to a circle, showing that the \(M=12\) bus stops are reasonably staggered around the loop.

Since bus stops have heterogeneous people arrival rates, a fair global measure is obtained by averaging quantities over all 12 bus stops, i.e. to obtain loop averages as the system evolves. As time goes on, a bus would move from one bus stop to the next bus stop. (Each bus stop is a location where people board/alight the bus.) At the current bus stop, we take the average over the 12 bus stops in the loop, i.e. from the past 11 bus stops up to that present bus stop. When the bus moves to the next bus stop, we correspondingly shift the average over all 12 bus stops from the past one revolution to that new bus stop, and so on. Therefore, we calculate loop averages of Δtij and \({\tau }_{ij}\) to plot the time series for each bus i, thus deducing the average k via Eq. (1). In doing so, we track these averages for each bus with time as the system evolves, as the bus moves from one bus stop to the next bus stop. This tracking over time as the system evolves would form curves connecting the discrete points \(({\rm{\Delta }}{t}_{ij},{\tau }_{ij})\) in a plot of \({\tau }_{ij}\) versus Δtij as shown in Fig. 6, one curve for each bus being tracked.

Figure 6
figure 6

Graphs of \({\tau }_{ij}\) versus Δtij (loop averages) of our NTU Campus Buses, for the three situations described in the text. Left and middle are in the lull phase; right is in the busy phase. A time series curve tracks one bus throughout the measured period, plotting its loop average values (over all 12 bus stops) of Δtij and \({\tau }_{ij}\) as it moves from one bus stop to the next. Each time series starts from and ends at . The number of time series curves corresponds to the number of buses being tracked. There are 2 buses tracked in the left graph, 5 × 3 = 15 buses tracked in the middle graph, and 10 buses tracked in the right graph.

Figure 6 shows the time series of our NTU buses recorded over the entire working week 16–20th of April, 2018, clearly depicting the two phases lull and busy, as described in Section 2. The first (left panel) is a quintessential example of two initially antipodally-spaced buses, ending up bunching due to frequency detuning. Their average natural frequencies are 0.94 mHz and 1.14 mHz, respectively. These average natural frequencies fluctuate, which effectively contribute towards greater frequency detuning. This event occurred at 9.32–10.33 pm on the 16th. In fact, the two curves corresponding to tracking each of the two buses vividly indicate that for one of them, its time headway Δtij and stoppage \({\tau }_{ij}\) progressively get smaller as time goes on, whilst those for the other bus progressively get larger — which signify imminent bunching between these two buses.

Next (middle panel) is a collection of time series between 4–5 pm during those 5 days, where 3 buses were serving during this hour (15 time series in total). Before 4 pm and after 5 pm, buses are rested/replaced, i.e. the system is tweaked or non-isolated. This 4–5 pm is an interval where the system is isolated. This and the 2-bus system in the left panel represent real-world examples of the lull phase where bunching occurs periodically with the fast bus pulling off after overtaking. The third (right panel) is a selection of 10 time series throughout those 5 days from 9–10 am, served by 6–7 buses during the morning rush hour. This is a typical situation of the busy phase where clusters of phase-locked buses are recorded. Here, we make a selection because these 6–7 buses often overtake one another constituting a transient state which destroys the loop average sequence. Bunched buses share the load, so the loading rate l gets multiplied — which is not k for a single bus. In addition, these are 10 time series with highest demand, to determine a representative value for peak demand throughout the week. Demand varies during morning rush hour because lectures in NTU start at the half-hour mark, so students travelling from campus residences to faculty buildings are likely to leave at preferred times. For the first two graphs (lull phase), overtaking is not as frequent and no time series is excluded.

The plots in Fig. 6 signify a linear relationship between \({\tau }_{ij}\) and Δtij [Eq. (1)], with expected real-world stochasticity. A source of deviation from Eq. (1) arises from disembarkation: Buses carrying many passengers may stop longer, although the time headway may be relatively small with few boarding. Also, if bus capacity is reached, excess passengers are ignored. Anyway, we can fit a straight line to obtain the gradient k and the \({\tau }_{ij}\)-intercept. The \({\tau }_{ij}\)-intercept is not quite zero, but of the order of +10 seconds for all \({\tau }_{ij}\)tij graphs. Note that buses have to wait for clear traffic before rejoining the road. This could only lead to an increase in measured \({\tau }_{ij}\) and never a decrease in \({\tau }_{ij}\). We wrote a computer programme to regularly probe the website https://baseride.com/maps/public/ntu/ for positional data of the buses. However, the positional data on that website are only updated once in approximately every 10 seconds, i.e these positional data would have a resolution of about 10 seconds. Due to this rather coarse resolution, the increase due to waiting for clear traffic would be recorded as an increase by an order of 10 seconds. More specifically, a bus might have waited for, say for example, either 1 second, 2 seconds, 5 seconds, or 10 seconds. These would all be registered as about +10 seconds, in addition to the actual time taken for boarding/alighting. If a bus waits for, say for example, either 11 seconds, 12 seconds, 15 seconds, or 20 seconds, then these would all be registered as about +20 seconds, in addition to the actual time taken for boarding/alighting. Buses would be waiting for clear traffic over a range of values, depending on the traffic conditions. So the \({\tau }_{ij}\)-intercept in each graph in Fig. 6 gives an average over 12 bus stops, on how long a bus has to spend waiting for clear traffic before rejoining the road.

From the gradients of the fitted lines, \(k=0.024\pm 0.004\) for the first graph, \(k=0.018\pm 0.007\) for the second [breakdowns for the 5 respective days (4–5 pm) are: \(0.021\pm 0.007\), \(0.028\pm 0.005\), \(0.015\pm 0.006\), \(0.011\pm 0.005\), \(0.024\pm 0.004\)], and \(k=0.065\pm 0.017\) for the third. Estimate: Suppose 1 person takes 1 second to board/alight. If 10 people approach a bus stop per minute at busy hours, compared to 1 in 5 minutes during lull times, these translate to \(k\in [0.003,0.167]\). These estimates serve as extreme boundary values for k, and our results lie moderately within this range without being near either extreme ends.

The data analytics strongly suggest a classification of the bus system into distinct lull and busy phases, as mentioned earlier. Frequency detuning allows a fast bus to pull away after overtaking. Although it gets held up at subsequent bus stops, during lull periods its stoppage is short and its higher speed helps widen the spatial phase difference, Δθ. However, when coupling gets beyond a critical value, the bus system transitions from lull to busy where clusters of phase-locked buses appear: whilst the fast bus escapes, it then experiences lengthy stoppage at the next bus stop and gets caught up. This sequence of events repeats at every bus stop. Since frequency detuning causes periodic bunching under weak coupling, they are also periodically staggered: Δθmax = 180°. If coupling gets beyond the critical threshold, phase locking emerges: Δθmax ~ 0°. Periodic bunching and phase locking are the two stable phases of human-driven bus systems, where their natural frequencies are different.

In summary, data from our NTU buses turn out to fit well according to our physical theory’s predictions:

  1. 1.

    A 2-bus scenario on Monday, 16th of April, 2018 (9.32–10.33 pm) is in the lull phase where they are not phase locked, with measured \(k=0.024\pm 0.004\) being less than \({k}_{c}(2)=0.028\).

  2. 2.

    The cumulative 3-bus scenarios for an entire working week, 16–20th of April, 2018 (4–5 pm, before the evening rush hour) is also in the lull phase, with measured \(k=0.018\pm 0.007\) being less than \({k}_{c}(3)=0.045\). This measured value is also less than \(\overline{k}={k}_{c}(2)=0.028\). No clustering is observed.

  3. 3.

    The cumulative 6 to 7-bus scenarios for an entire working week, 16–20th of April, 2018 (9–10 am, morning rush hour) is in the busy phase, with measured \(k=0.065\pm 0.017\). Although less than \({k}_{c}(6)=0.091\) and \({k}_{c}(7)=0.108\) (thankfully, otherwise this would be a ridiculously inefficient system), it is much higher than \(\overline{k}={k}_{c}(2)=0.028\), indicating the presence of clusters of phase-locked buses.

Figure 7 supports the theoretical deduction of these scenarios based on their measured k, by showing how Δθ between adjacent pairs of NTU buses evolve with time, with the loop isometrically (distance-preserving) mapped to a circle (Fig. 5). Recall that Δθ for each bus is measured with respect to the bus immediately ahead of it. In each graph, there are N curves, one for each of the N buses being tracked. These Δθ for each bus always add up to 360°, at every point in time. Note that there are jumps in the curves corresponding to overtakings amongst the various buses. When overtaking between two buses occurs, the corresponding two curves experience vertical jumps since the bus immediately ahead would change to a different bus. If a bus overtakes the bus immediately ahead of it, then before overtaking its Δθ goes to zero. After overtaking, its Δθ is measured with respect to a different bus that is now immediately ahead of it. This new bus immediately ahead of it could be anywhere around the loop, and so its Δθ would jump from 0° to that value corresponding to measuring with respect to the new bus immediately ahead. Similarly for the bus that is being overtaken, its Δθ could be any value from 0° to 360° before being overtaken, depending on how far away the bus immediately ahead of it is. After it is overtaken, its Δθ drops to 0° because the bus immediately ahead of it is the one that has just overtaken it.

Figure 7
figure 7

Graphs of Δθ between adjacent NTU campus buses versus time elapsed. Each curve represents the spatial phase difference Δθ of a bus, as measured from the bus immediately ahead of it. Top: 2 buses serving at 9.32–10.33 pm on the 16th; middle: 3 buses serving at 4.32–5.07 pm on the 20th; bottom: 7 buses serving at 8.56–10.13 am on the 19th of April, 2018. The first two are in the lull phase with frequency detuning causing a fast bus to chase, overtake, then pull away from a slow bus. The third is in the busy phase where clusters of sustained phase-locked buses are visible. In the bottom graph, bunched buses are represented by thick coloured curves where Δθ is small, whilst other buses’ Δθ are large (grayscale thin curves). Videos for these are given as Supplementary Information.

Discussion

Let us now consider N initially staggered buses with identical \(\omega =2\pi f=2\pi \)/T serving M bus stops, as we anticipate a future when self-driving buses are programmed. It turns out that although this is an equilibrium where they can remain staggered, stability bifurcates from neutrally stable (upon perturbations, the system does not return to the original configuration nor deviate away further) to unstable (upon perturbations, the system deviates away from the original state) at a critical \(k={k}_{c^{\prime} }\):

$${k}_{c^{\prime} }(N)=\frac{N{\tau }_{{\rm{\min }}}}{T}.$$
(4)

To derive Eq. (4), note that a bus must spend at least some minimum amount of time to board even one passenger. Let \({\tau }_{{\rm{\min }}}\) denote this minimum duration. If \(l{\tau }_{{\rm{\min }}}\) is at least Pmax :\(=\) maximum number of people accumulated at each bus stop, then all buses would only spend the minimum stoppage \({\tau }_{{\min }}\) to board them. When the N buses are staggered, we have \({\rm{\Delta }}{t}_{ij}\sim T/N\). Therefore, \({P}_{{\rm{\max }}}=sT/N\) and the critical transition is given by \(l{\tau }_{{\rm{\min }}}={P}_{{\rm{\max }}}=sT\)/N, i.e. Eq. (4). For \(k < {k}_{c^{\prime} }\), the system is neutrally stable since all stoppages are \({\tau }_{{\rm{\min }}}\) even with small perturbations — the buses do not end up bunching, and do not return to its original configuration. If all buses only spend the minimum time of \({\tau }_{{\rm{\min }}}\) at the bus stop, then a small perturbation on the phases of an initially staggered system of buses does not change the fact that they would all still spend the same \({\tau }_{{\rm{\min }}}\) at the bus stop. On the other hand, if \(k > {k}_{c^{\prime} }\), the staggered configuration is generally unstable and all buses end up bunching. Moreover, we have run simulations on several configurations of N buses serving M bus stops in a loop to test this and indeed observed in each case that the buses can remain staggered if \(k < {k}_{c^{\prime} }\), but would bunch if \(k > {k}_{c^{\prime} }\). These stability properties of an initially staggered configuration of buses are analogous to those of the original Kuramoto model12. Reference12 provided a rigorous mathematical treatment on the incoherent solution to the Kuramoto system (i.e. where the infinitely many oscillators are randomly distributed around the loop), concluding that it is neutrally stable if the coupling strength is less than the critical value, but is unstable if the coupling strength exceeds the critical value. Intriguingly and unlike the original Kuramoto model, our simulations also show that the system can remain in staggered equilibrium for some values of \(k > {k}_{c^{\prime} }\) due to the wide-doors effect allowing multiple passengers boarding simultaneously24,25,30: If a bus can pick up l people per time step, then picking up \(1,2,\ldots ,l\) people all require one time step, i.e. tiny perturbations are tolerable.

Let us compare the efficacy against bunching for bus systems with identical \(\omega \) versus non-identical \({\omega }_{i}\). With \(N=5\), \(T=15\,{\rm{minutes}}\) (\(\omega =1.11\,{\rm{mHz}}\)) and \({\tau }_{{\rm{\min }}}=5\,{\rm{seconds}}\) (which includes deceleration and acceleration), then \({k}_{c^{\prime} }(5)=0.028\). This is similar to kc(2) for \(M=12\) bus stops with frequency detuning (Table 1), but requires 5 buses. With \(N=2\), \({k}_{c^{\prime} }(2)=0.011\) implies that a coupling strength with, say \(k=0.020\), would cause bunching. Unlike with frequency detuning, bunched buses with identical \(\omega \) stay bunched.

In conclusion, we can model complex real bus systems by a simple physical theory of self-oscillators coupled via Eq. (1), where the latter successfully captures essential underlying features of the former. Perhaps the most significant takeaway from this physical theory is, since self-oscillators can be entrained, buses can be kept staggered by a system of periodic driving forces. As lucidly described in ref.1, ordinary clocks these days need not be very accurate. A high-precision central clock can send periodic pulses (via radio signals) to entrain those clocks, safeguarding their accuracy. Similarly, we can design a set of central oscillators for the bus system that dictates the N ideal phases for the N buses, whereby signals are sent out periodically to entrain them to remain staggered. In the real world, such central oscillators must continuously adapt to varying demands and traffic conditions. Hence, we are presently developing a smart central system using data science and artificial intelligence feeding on live demand, real-time traffic data, etc.17,29, thereby inhibiting bus bunching by driven entrainment.