{'fraction_non_alphanumeric': 0.047528784049424316, 'fraction_numerical': 0.011373209772535805, 'mean_word_length': 4.231178846860081, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An interface-free multi-scale multi-order model for traffic flow

In this paper we present a new kind of model for traffic flow which couples a first-order macroscopic approach with a second-order microscopic approach, avoiding any interface or boundary conditions between them. The Euler-Godunov scheme associated to the model is conservative and it is able to reproduce typical traffic phenomena like stop&go waves.

1. Introduction. In this paper we deal with multi-scale modeling of traffic flow on a single road. In particular, we focus on modeling vehicular traffic adopting both a microscopic (agent-based) and a macroscopic (fluid-dynamics) point of view. Such a multi-scale models are nowadays particularly meaningful since both Eulerian (i.e., flux-based) and Lagrangian (i.e., GPS) traffic data are available as real measurements and can be both used for calibration and validation.
1.1. Related work. Literature about traffic flow is quite large and a comprehensive review is out of the scope of the paper. For a general introduction we refer the reader to the books by Haberman [29] and Garavello and Piccoli [25], as well as to the survey papers by Helbing [30] and Piccoli and Tosin [39].
At a general level, let us just mention the difference between first-and secondorder models, see, e.g., [19,20]: The former kind of models represents a simplification of the reality since assume that accelerations are instantaneous, and the traffic conditions are always at equilibrium. The latter kind of models, instead, is closer to the real dynamics of drivers since considers bounded accelerations. Note also that second-order models are able to reproduce some traffic phenomena which are primarily caused by bounded accelerations, like, e.g., stop & go waves [22,31,34,49].
Many-particle limits. Connections between microscopic and macroscopic traffic flow models are already well established. Aw et al. [1], Greenberg [28], and Di Francesco et al. [17] investigated the many-particle limit in the framework of second-order traffic models, deriving the macroscopic Aw-Rascle-Zhang (ARZ) model [2,48] from a particular second-order microscopic follow-the-leader (FtL) model [30,40]. Instead Colombo and Rossi [9], Rossi [44], Di Francesco and Rosini [18], and Di Francesco et al. [16] investigated the many-particle limit in the framework of firstorder traffic models, deriving the macroscopic Lighthill-Whitham-Richards (LWR) model [37,42] as the limit of a first-order FtL model. Let us also mention the papers by Forcadel et al. [24], Forcadel and Salazar [23] which investigate the many-particle limit exploiting the link between conservation laws and Hamilton-Jacobi equations.
Moving to road networks, analogous connections are rarer. This is probably due to the fact that macroscopic traffic models on networks are in general ill-posed, since the conservation of the mass is not sufficient alone to characterize a unique solution at junctions. This ambiguity makes more difficult to find the right limit of the microscopic model, which, in turn, can be defined in different ways near the junctions. In this context let us mention the paper by Cristiani and Sahu [14] which investigates the many-particle limit of a first-order FtL model suitably extended to a road network. The corresponding macroscopic model appears to be the extension of the LWR model on networks introduced by Hilliges and Weidlich [32] and then extensively studied by Bretti et al. [4] and Briani and Cristiani [6].
Multi-scale models. The connections between micro-and macro-scale are the foundations of multi-scale models. Such a models couple the traffic description at different scale in order to get a new model which inherits the advantages of the single-scale models. Many kinds of couplings were proposed so far: first-order FtL and LWR [8], second-order FtL and LWR [27], second-order FtL and phase-transition model [26], second-order FtL and ARZ [35]. See also, from the engineering literature, the older paper by Bourrel and Lesort [3]. Note that the interface which separates the micro-and macro-model can be either fixed or solution-dependent. In the first case, across the micro-to-macro interface single vehicles (mass particles) are transformed in average density of vehicles, while across the macro-to-micro interface the opposite happens. Obviously, transformation is done preserving the total mass of vehicles.
Fundamental diagram. The fundamental diagram is one the main ingredient of traffic flow models. It defines the relationship between the flux and the density of vehicles [33]. It is plain that the flux of vehicles is null in either the case of empty road (null density) or in the case of fully congested road (maximal density, stopped bumper-to-bumper vehicles). For intermediate density levels, real data show a more complicated dynamics. Indeed, drivers act differently in response of the same traffic conditions and, in addition, accelerations and decelerations are far from being instantaneous. As a consequence, traffic shows some instabilities [38,47].
In first-order traffic models, the fundamental diagram can be defined by means of a single function while second-order traffic models allows the fundamental diagram to be multivalued, in the sense that many values of the flux can be associated to a single value of the density, exactly as it happens in reality. It is interesting to recover the fundamental diagram a posteriori, i.e. by means of the simulated (predicted) traffic conditions. Ideally, a model should be able to reproduce scattered fundamental diagrams similar to those built on real data. This issue was investigated by many authors, like, e.g., Fan and Seibold [20], Fan et al. [19], Fan et al. [21], Klar et al. [34], Puppo et al. [41], Herty and Illner [31], and Visconti et al. [46].

1.2.
Goal. This paper proposes a new kind of model for traffic flow which couples a first-order macroscopic model with a second-order microscopic model, avoiding any interface or boundary conditions between them. The macroscopic model is always running on the whole domain, while the microscopic model, which can be seen as a "correction" of the macroscopic one, appears only when and where the traffic conditions are not in equilibrium. In this way, we make a first-order model like the LWR able to describe second-order effects, like stop & go waves. At the same time, we avoid to singularly track all the vehicles on the road, which would be computationally expensive.
1.3. Paper organization. In Section 2 we recall the classical micro-and macroscopic models which will be used in the rest of the paper. In Section 3 we introduce a new microscopic model derived from the model recently introduced by Zhao and Zhang [49] to reproduce stop & go waves. This model will be used as an ingredient of the multi-scale approach. In Section 4 we describe the multi-scale model, starting from the basic concepts and then moving to the technical details. We also show that the resulting numerical scheme is conservative (i.e. mass-preserving). In Section 5 we present some numerical tests. We conclude the paper with some comments and an overview on future directions.
2. Classical single-scale models. In this section we recall some classical singlescale models and the relations between them.
In the microscopic framework, we assume that N vehicles are moving along a single-lane infinite road where overtaking is not possible. We denote by X k (t) the position of the k-th vehicle at time t > 0, for k = 1, . . . , N . Similarly, we denote by V k (t) its instantaneous velocity. We assume that all vehicles are equal and that the mass and the length of each of them coincide. We denote by N > 0 the length/mass of each vehicle and by M := N N the total mass, which is kept fixed. We assume that vehicles are ordered in such a way that X 1 (0) < X 2 (0) < . . . < X N (0) and, obviously, X k+1 (0) − X k (0) ≥ N for all k = 1, . . . , N − 1.
In the macroscopic framework, we consider the same mass of vehicles, this time indistinguishable from each other, whose average density at point x and time t will be denoted by ρ(x, t) ∈ [0, ρ max ] for some maximal density ρ max > 0. Conservation of mass will imply that Similarly, vehicles' average velocity will be denoted by v(x, t) ∈ [0, V max ] for some maximal velocity V max > 0.
The typical form of a second-order microscopic model of follow-the-leader type is where t > 0, the function A represents the acceleration (to be suitably defined) and p represents the vector of model parameters. Note that the N -th vehicle, termed the leader, must have a special dynamic since there are no vehicle in front of it. Typically, the leader proceeds at maximal velocity V max regardless of the traffic conditions behind. Nonleader vehicles are termed followers.
One of the model we will consider in this paper is a well-known and widely used second-order FtL model [1] defined by i.e. vehicles move as fast as possible in a free road while completely stop when are bumper-to-bumper. As recalled in the Introduction, Aw et al. [1] proved that the many-particle limit of the model (1)-(2) is the ARZ model where w(x, t) := v(x, t) + P (ρ(x, t)) and Roughly speaking, this means that in the limit N → +∞ (and N → 0) the average density and velocity of particles obeying equation (1)-(2) are given, respectively, by the functions ρ and v solution to equation (3).
To our purposes, it is important to observe that if vehicles are able to reach instantaneously their equilibrium velocity, the model (1)-(2) drops to first order, simply reading asẊ Similarly to the second-order case, it is possible to compute the many-particle limit of the model (4), which appears to be the classical LWR model (see the Introduction for references). These relationships suggest and justify the coupling between the models (1)-(2) and (5) which we will detail in Section 4.

A minimal model for reproducing stop & go waves.
Stop & go waves are a typical feature of congested traffic [22,43] and represent a real danger for drivers. Therefore, techniques aimed at reducing them are highly desirable [7,45]. In this section we describe a microscopic second-order model specifically conceived to reproduce stop & go waves. This model is nothing but a minimal version of the model recently introduced by Zhao and Zhang [49] to describe the dynamics of vehicles, bicycles and pedestrians in a unified framework. Our model is 'minimal' in the sense that it is obtained from the Zhao and Zhang's model dropping all the terms which are not strictly necessary to reproduce realistic stop & go waves. It has the form (1) with and Here α > 0 is a parameter and ∆ min > N is the minimum critical spacing distance between the centers of mass of a vehicle and the preceding one. Note that this minimal model, unlike the original one [49], is deterministic. Moreover, one should note that the condition In Figs. 1-2 we show a typical solution to the system (1)-(6)- (7) in the case of a circular road of length L. Initial conditions are X k (0) = kL N +1 and V k (0) = 0, for k = 1, . . . , N . Numerical integration is obtained by the explicit Euler scheme on a road segment [0, L] with periodic boundary conditions. It can be seen that backward stop & go waves are immediately generated by the small perturbation in the initial positions of the vehicles. Indeed, vehicles are initially equispaced with the exception of the couple (N ,1) (first vehicle in X 1 is just in front of the N -th vehicle in X N because of the periodic boundary conditions), for which we have Small perturbations in the initial velocity lead to similar effects as well.
4. The multi-scale approach. In this section, which is the core of the paper, we describe the multi-scale model and its numerical implementation.

General ideas.
Single-scale models are often unsatisfactory for a number of reasons which involve both modeling and numerical considerations. Generally speaking, we can say that: • Second-order models are more realistic and often perform better than firstorder ones [20,21]; • The numerical approximation of second-order macroscopic models is more difficult than that of first-order macroscopic models, especially if high-order numerical schemes are pursued; • Microscopic models require a rather large CPU time if the number of vehicles involved in the simulation is large. Ideally, one would have an easy-to-implement macroscopic model with second-order features. This is the goal which motivated the multi-scale model proposed in this paper.
As recalled in the Introduction, multi-scale models are typically based on the spatial separation of the microscopic and macroscopic parts. On the contrary, the model we propose here is characterized by the fact that no interface (either fixed or mobile) is explicitly defined. More precisely, the macroscopic model is always and everywhere alive, while the microscopic model is activated only where and when it is needed, and it is able to correct (in full or in part) the macroscopic one.
This procedure is expected to be advantageous if one couples an easy-to-use first-order macroscopic model with a more realistic but still easy-to-use secondorder microscopic model. Advantages are complemented by the low computational cost, which comes from the fact that the microscopic model is used only in small parts of the road, therefore the number of vehicles individually tracked is kept low.
The question arises how the need of the second-order model can be detected. In principle, the second-order model should be activated when and where the traffic is not at equilibrium, i.e. the velocity of vehicles is far from the desired one (as for the current traffic conditions). This usually happens when nearby vehicles have very different speeds, since this implies the need of strong accelerations or decelerations which first-order models cannot take into account. On the contrary, the secondorder model can be safely deactivated when vehicles are moving at desired velocity, i.e. their accelerations are close to 0.

4.2.
The multi-scale model with complete information. We are now ready to couple a microscopic model in the form (1) and the model (5). In this section we assume, for illustrative purposes, that both the macroscopic and the microscopic models are alive in the whole space-time domain, i.e. we have a complete information coming from the two models. It is given an initial condition at macroscopic level ρ 0 := ρ(·, 0) ∈ L 1 (R), such that M = R ρ 0 (x)dx and a number N of microscopic vehicles. One can set the initial position of vehicles {X 1 (0), . . . , X N (0)} simply distributing them according to the probability density distribution ρ 0 /M. Initial velocities are set as V k (0) = v * (ρ 0 (X k (0))), for k < N , and V N (0) = V max .
The multi-scale model with complete information reads, in integral form, as where θ ∈ [0, 1] is an additional parameter, x → δ(x−x 0 ) is the Dirac delta function centered in x 0 , and the time derivative ∂ t is intended in the distributional sense. The idea underlying the model (8) is the following: The gain or loss of mass in any space interval [a, b] between time t and t + dt is only given by the flow of vehicles through the boundaries a and b, like in classical conservation laws. In this case, at the macroscopic level the flow is given by the classical LWR flux function f , while at the microscopic level the mass instantaneously (dis)appears at the passage of vehicles through the boundaries. The parameter θ is intended for tuning the contribution of the micro-and macro-scale, in the same spirit of [10,11,12,13,15].

4.3.
Numerical approximation. The system (8) can be approximate by a suitable combination of existing numerical schemes. In the following, we employ the Godunov scheme for the PDE and the explicit Euler scheme for the system of ODEs. To do that, we introduce space and time steps ∆x, ∆t > 0 (with λ := ∆t ∆x ) and a grid in space {x j := j∆x, j ∈ Z} and time {t n := n∆t, n ∈ N}. We denote by C j := [x j− 1 2 , x j+ 1 2 ) the cell centered in x j . As usual, we denote by ρ n j the approximation of ρ(x j , t n ) and by (X n k , V n k ) the approximation of (X k (t n ), V k (t n )), for k = 1, . . . , N .
The numerical scheme reads as follows.
with the classical Godunov's numerical flux (see, e.g., [5,36]) if ρ − > ρ + and ρ + > σ The microscopic flux is simply computed by counting the number of vehicles passing through the boundaries of the cell C j in the time interval [t n , t n+1 ]. Such a numerical scheme comes along with a natural CFL condition for the microscopic and the macroscopic part, in order to guarantee that in one time step both characteristic curves and vehicles themselves do not move more than one cell apart. To get this, we need to impose 4.4. The multi-scale algorithm. One of the main feature of the proposed multiscale model is that the microscopic part of the model is activated only where and when it is needed. This forces us to introduce two important modifications with respect to the model with complete information. First, the number N of microscopic (singularly tracked) vehicles can change in time. To deal with that, we denote by Γ n the total number of vehicles at time t n , and by Γ n j the number of vehicles which, at time t n , fall in the cell C j . Second, vehicle k + 1 is no longer, in general, in front of vehicle k. To overcome this issue, we will denote by next(k) the vehicle in front of the k-th one, with the convection that leaders have next = 0.
Finally, we need some additional positive parameters which rule the activation and deactivation of the second-order microscopic model, which will be denoted by δt, δv and δV . Let us briefly describe their meaning, which will be even clearer after the description of the algorithm.
• δt is the minimal period of time that one microscopic vehicle is active. In other words, if a vehicle is activated at time t n , it cannot be deactivated before time t n + δt. • δv is the minimal variation of the macroscopic velocity function which activates the second-order model. • δV is the maximal difference between the current velocity and the equilibrium velocity of microscopic vehicles which allows the deactivation of the secondorder model. We are now ready to present the main steps of the algorithm which updates the density and the state of the microscopic vehicles (ρ n , X n , V n ) → (ρ n+1 , X n+1 , V n+1 ).
1. Compute Γ n j ∀j. 2. Activation of new vehicles (Fig. 3). For all j, if |v * (ρ n j+1 ) − v * (ρ n j )| > δv, for all i ∈ {j − 1, j, j + 1, j + 2} put new vehicles in cell C i (unless the cell is already occupied, i.e. unless Γ n i > 0) with velocity v * (ρ n i ). The number of vehicles to put in the cell C i is   3. Labeling (Fig. 4). Find next(k) for all k. The rightmost vehicle is labeled as leader (next = 0). Also, all vehicles h such that |X n next(h) − X n h | > ∆x are also labeled as leader. This choice comes from the assumption that every time a vehicle has a free space of length ≥ ∆x in front of it, its dynamics ceases to be dependent on the vehicle in front (if any). We will see, in Step 7, that the dynamics will depend instead on the macroscopic density.
δV . Note that, without the first condition new vehicles would immediately deactivated since their velocity is initially at equilibrium (see Step 2). In this way, instead, vehicles have enough time to fully exploit their second-order dynamics. After that, if and when they get close to the equilibrium velocity again, they are deactivated.
Step 4: Red vehicles are going to be deactivated.

Deactivation of leaders.
Remove all leaders which are not followed by anyone (lonely leaders). 6. Repeat steps 1 and 3 if needed. 7. Update vehicles' positions and velocities. We run the microscopic second-order model where j * (k, n) is the cell occupied by the vehicle k at time t n . Note that leaders' dynamics only depend on the density ρ. Indeed, the velocity of a leader is that of macroscopic vehicles located in the cell in front of it (cf. Colombo and Marcellini [8]). 8. Compute F n j− 1 2 and F n j+ 1 2 as defined in (11). 9. Update vehicles' density. We run the multi-scale model, which reads as follows.
For θ = 0, For θ ∈ [0, 1], The scheme is different from the one with complete information (9) because here microscopic information is not always available. Where microscopic vehicles are present, one can choose a suitable combination of macroscopic and microscopic flux to update the macroscopic density. Where microscopic vehicles are missing, only the macroscopic flux is used, see Fig. 6.

Remark 1.
We stress once again that the macroscopic density ρ is always updated (Step 9), regardless of the value of θ and regardless of the presence of microscopic vehicles. Moreover, the total mass of the system must be evaluated by means on ρ only, as R ρdx. The appearance of new microscopic vehicles should be seen as a temporary correction procedure which does not imply an additional injection of mass in the system. Note also that even if θ = 0 (dynamics fully driven by the microscopic model), the macroscopic dynamics are still used, precisely where microscopic vehicles are not present. Instead if θ = 1 the microscopic model has no effect on the dynamics.

Conservation of mass.
In the framework of conservation laws and traffic flow models the conservation of the total mass is a crucial property which must be preserved at the discrete level. The multi-scale scheme (15) can be easily written in conservative form [36], therefore it preserves the mass.
In order to reduce the number of cases to be considered, it is convenient to proceed as follows: Let us denote by M + n,j (resp., M − n,j ) the mass gained (resp., lost) by a generic cell C j in one time step n → n + 1, i.e., ∀j, ∀n.
5. Numerical tests. In this section we present some numerical results for the multi-scale model described in Section 4.4, with scheme (14) (θ = 0). In the first three tests A is defined as in (2), while in the last test A is defined as in (6). We denote by L the length of the road, by T the final time of the simulation, by N x the number of space steps, by N t the number of time steps, and by Γ max the maximum number of vehicles which can fall in one cell of length ∆x. The latest parameter is the microscopic counterpart of ρ max and it is naturally related to the scaling parameter N , We set θ = γ = 0, V ref = V max = ρ max = 1 and v * (ρ) = 1−ρ. The others parameters used in the simulations are summarized in Table 1.  (Activation and deactivation). In this preliminary test we just check the correctness of the steps 2, 3, 4 of the algorithm. To do this, we consider a step function as initial condition ρ 0 and we plot the result of the classical LWR model (the density coming from the multi-scale is not plotted for better clarity) and the microscopic vehicles along the x-axis. We can see that at the initial time vehicles are correctly activated only around the three discontinuities (Fig. 7a). After some time, the first discontinuity is smoothed enough for allowing the deactivation of vehicles (Fig. 7b).
a. In this test we investigate the effect of the relaxation parameter τ in the second-order model (2). This parameter is related to the reactivity of drivers. More precisely, the smaller τ , the more reactive the drivers are and the more the vehicles are able to accelerate and reach the equilibrium velocity rapidly. We consider the case of a road congested in the first part and totally free in the second part (Fig. 8a). In this case the LWR model shows immediately the classical rarefaction fan around the original discontinuity (Fig. 8bcd). Microscopic vehicles are activated only around the discontinuity (Fig.  8abcd) and are able to take into account the bounded acceleration of vehicles, see especially Fig. 8b where the velocity of microscopic vehicles is also plotted. At time step n = 400 the difference between τ = 0.01 (Fig. 8c) and τ = 3 (Fig. 8d) is quite visible. In the former case (highly reactive drivers) the dynamics of the multi-scale model are very similar to that of the LWR model, while in the latest case (poorly reactive drivers) the multi-scale model differs from LWR and correctly take into account a delay in moving forward. As discussed in Section 1.1, it is interesting to recover the fundamental diagram a posteriori, i.e. by means of the simulated traffic conditions. To do that, we plot the set of 2D points {(ρ n j * (k,n) , ρ n j * (k,n) V n k ) ∀k and ∀n, provided vehicle k is active at t = t n } (16) where j * (k, n) is the cell occupied by the vehicle k at time t n , see Fig. 9. It can be seen that the multi-scale model is indeed able to recover a scattered (multivalued) fundamental diagram. Moreover, the scattering increases with τ , as expected. a.

Test 3 (self-sustained perturbation).
In this test we show the behavior of the model in presence of a perturbation. The perturbation is represented, at time t = 0, by a small region where vehicles are moving slower than elsewhere (and therefore their density is higher). A typical example is given by sags, which are road sections along which gradient changes significantly from downwards to upwards [43]. Microscopic vehicles are immediately activated in the region of perturbation (Fig.  10a), and, for a short time the multi-scale model and the LWR model behave similarly (Fig. 10b). At the microscopic level, it is clear that vehicles decelerates when get closer to the perturbation and then accelerate again (Fig. 10b). After that, the LWR model tends to smear out the perturbation as usual. The multi-scale model, instead, self-sustains the perturbation, which does not disappear, at least for a certain time (Fig. 10c). Around time step n = 900 microscopic vehicles disappear since the perturbation is no longer strong enough to destroy the equilibrium, and the multi-scale model turns to be the LWR one (Fig. 10d)

Test 4 (stop & go waves).
In this test we employ the model introduced in Section 3 specifically designed to reproduce stop & go waves. Similarly to the previous test, a perturbation is created at initial time, but this time microscopic vehicles are forced to be activated everywhere in the domain (Fig. 11a). After time δt, vehicles located in regions at equilibrium are correctly deactivated, while they stay alive around the initial perturbation (Fig. 11b). After that, perturbation increases until vehicles almost stop completely (Fig. 11c), and finally a large stop & go wave is formed (Fig. 11d).
Conclusion and future work. In this paper we have proposed a new way to couple a microscopic and a macroscopic description in the framework of traffic flow modeling. Exploiting this coupling, we have shown how to confine an expensive second-order (acceleration-based) microscopic description in space-time regions where bounded acceleration plays an important role in the dynamics. Regions where the traffic is moving at equilibrium can be instead safely described by simple and a. CPU-saving first-order macroscopic models. The main limitation of the proposed approach is the presence of three additional parameters to be tuned, which rule the coupling. Moreover, it remains to show the invariance of the interval [0, ρ max ], i.e. the fact that ρ 0 ∈ [0, ρ max ] ⇒ ρ ∈ [0, ρ max ]. We claim that this property holds true only under suitable conditions on the discretization and model parameters. Natural extensions of the proposed approach are given by nonconstant modeling parameters. For example, allowing θ to be dependent on ρ itself, one can obtain a smooth passage from the macroscopic to the microscopic description as the traffic conditions become more and more congested. Also the relaxation parameter τ can depend on ρ, in such a way that drivers are described as more reactive if traffic conditions are more dangerous (e.g., in case of large flux characterized by a large number of vehicle moving at high velocity).
Another research direction could be the analytical study of the model (1)-(6)-(7). Despite its simplicity, the model shows very interesting properties and features. One can understand under which conditions stop & go waves arise and disappear and the role of the stochasticity in the original model. One can also investigate the many-particle limit of the model, together with the definition of the macroscopic counterpart of the parameter ∆ min .