1 Continuous Second-Order Models

In order to overcome the weaknesses of first-order models of continuous type (see Sect. 3.2), second-order traffic flow models were developed and appeared approximately 20 years later. These models, besides considering the dynamics of the traffic density, explicitly introduce a dynamic equation for the mean speed. The first continuous second-order traffic flow model was proposed by Payne [1] and Whitham [2], in the 70s and is generally known as the Payne–Whitham (PW) model. This model received some critiques, the major one being formulated by Daganzo [3], showing that classical second-order models can exhibit non-physical solutions. This critique led to the development of new second-order models, such as those developed by Aw and Rascle [4], on the one side, and Zhang [5], on the other side. This latter model is often known as Aw–Rascle–Zhang (ARZ) model. These models are briefly described in the following subsections, the interested reader can find more mathematical details in books specifically dedicated to continuous traffic models, for example, in [6, 7].

1.1 The PW Model

The PW model is a continuous traffic flow model of macroscopic type, i.e. it represents the dynamics of aggregate variables referred to the traffic flow. As described in Sect. 3.1.1, the main variables considered in continuous macroscopic models are the traffic density \(\rho (x,t)\) [veh/km], the mean speed v(xt) [km/h], and the traffic flow q(xt) [veh/h], with x representing the location and t indicating time.

The PW model is based on the two basic equations of traffic flow models, i.e. the hydrodynamic equation and the continuity equation, described in Sect. 3.1.1 and reported in the following:

$$\begin{aligned} q(x,t)=\rho (x,t)v(x,t) \end{aligned}$$
(4.1)
$$\begin{aligned} \frac{\partial {\rho (x,t)}}{\partial {t}}+\frac{\partial {q(x,t)}}{\partial {x}}=0 \end{aligned}$$
(4.2)

In the PW model, (4.1) and (4.2) are coupled with a partial differential equation describing the dynamics of the mean speed, analogously to the momentum equation of fluid dynamics. This equation is derived from a car-following rule, by applying Taylor expansion, and it yields

$$\begin{aligned} \frac{\partial {v(x,t)}}{\partial {t}}+v(x,t)\frac{\partial {v(x,t)}}{\partial {x}}=\frac{1}{\tau }\left[ V(\rho (x,t))-v(x,t)\right] +\frac{1}{2\tau \,\rho (x,t)}\frac{d V(\rho )}{d \rho }\frac{\partial {\rho (x,t)}}{\partial {x}} \end{aligned}$$
(4.3)

where \(\tau >0\) is a constant called speed adaptation time. The speed equation (4.3) is composed of convection, relaxation and anticipation terms, which are now analysed in detail.

The convection term given by

$$\begin{aligned} v(x,t)\frac{\partial {v(x,t)}}{\partial {x}} \end{aligned}$$
(4.4)

describes the fact that the vehicles travelling along the freeway do not adjust their speed instantaneously. More specifically, let us consider the case in which vehicles are travelling very fast and need to decrease their speed to adapt to a lower downstream traffic mean speed. They do this gradually, which implies that a higher upstream speed tends to increase the traffic speed downstream (and the opposite holds in case of lower upstream speed). In other words, this term describes how the upstream speed influences the downstream one.

The relaxation term expressed as

$$\begin{aligned} \frac{1}{\tau }\left[ V(\rho (x,t))-v(x,t)\right] \end{aligned}$$
(4.5)

models the fact that all the vehicles tend to adjust their speed to the steady-state speed \(V(\rho (x,t))\). The speed relaxation time \(\tau \) is related to the reaction times of the drivers.

The anticipation term given by

$$\begin{aligned} \frac{1}{2\tau \,\rho (x,t)}\frac{d V(\rho )}{d \rho }\frac{\partial {\rho (x,t)}}{\partial {x}} \end{aligned}$$
(4.6)

describes the capability of the drivers to look ahead and to adjust their actual speed to the speed compatible with the density downstream. Note that this term can also be written as

$$\begin{aligned} -\frac{1}{\rho (x,t)}\frac{d p(\rho )}{d \rho }\frac{\partial {\rho (x,t)}}{\partial {x}} \end{aligned}$$
(4.7)

where \(p(\rho )=-\frac{1}{2\tau }V(\rho )\) is the pressure term, in analogy with fluid dynamics. By virtue of the non-increasing nature of the steady-state relation between mean speed and density (see Sect. 3.1.1), the traffic pressure is a non-decreasing function of density.

It is worth noting that sometimes a diffusive acceleration term, or viscosity term, is added at the second member of (4.3). Such term is given by

$$\begin{aligned} \upsilon \frac{\partial ^2{v(x,t)}}{\partial {x^2}} \end{aligned}$$
(4.8)

where \(\upsilon \ge 0\) represents a diffusion coefficient, again by analogy with the fluid theory.

1.2 The ARZ Model

The continuous macroscopic models, and in particular the PW model described in Sect. 4.1.1, rely on the equivalence between traffic and fluids. Yet, as observed in [3], there are major differences between them, which need to be correctly captured by traffic models. For instance, in contrast with fluids, vehicles are anisotropic particles that mostly respond to frontal stimuli, i.e. they are influenced mainly (or only) by the traffic dynamics ahead of them. Moreover, differently from molecules, drivers have their own personality. These differences motivate the presence of inconsistencies in the PW model, corresponding to an unrealistic behaviour, such as negative speeds, the violation of the anisotropy principle, and the propagation of the information faster than the speed of vehicles, as highlighted in [3].

Aw and Rascle in [4] proposed a simple modification of the PW model in order to overcome its inconsistencies. Specifically, they consider a version of the PW model in which both the relaxation term and the diffusive term are neglected and the traffic pressure is defined as a smooth increasing function of the density \(\rho \), i.e.

$$\begin{aligned} p(\rho )=\rho ^\gamma \end{aligned}$$
(4.9)

with \(\gamma >0\).

Then, instead of adopting the Eulerian point of view, i.e. the one of an external observer placed in a fixed spatial position x, the Aw–Rascle model rely on the Lagrangian point of view, i.e. the one of an internal observer flowing through x with speed v, as a single vehicle in the traffic flow does. Hence, in the Aw–Rascle model, the authors suggest to correct the anticipation factor involving the derivative of the pressure with respect to x with the so-called convective derivative (or material derivative) of the pressure term. Mathematically, this implies to use the convective derivative operator \(D_t:=\partial _t + v \partial _x\), where v is the actual fluid speed, to derive the anticipation term of the model. This term can be expressed as

$$\begin{aligned} D_t\left( p(\rho )\right) =\frac{\partial p(\rho )}{\partial t} + v(x,t) \frac{\partial p(\rho )}{\partial t} \end{aligned}$$
(4.10)

so that the Aw–Rascle model is given by (4.1), (4.2) and

$$\begin{aligned} \frac{\partial }{\partial {t}}\left( v(x,t)+p(\rho (x,t))\right) +v(x,t)\frac{\partial }{\partial {x}}\left( v(x,t)+p(\rho (x,t))\right) =0 \end{aligned}$$
(4.11)

with the pressure \(p(\rho (x,t))\) expressed as in (4.9). Note that, as highlighted by the same authors in [4], the model can create some difficulties from the mathematical point of view when the density is close to zero, since the model is not well-posed near the vacuum.

An interesting paper dealing with the controversy on Daganzo’s criticism against second-order models and the proposal by Aw and Rascle to overcome such drawbacks is [8]. In this paper, the linear stability of these traffic models is analysed, by mainly focusing on the characteristic speeds. One of the theoretical inconsistencies associated with second-order macroscopic traffic models is related to the fact that they predict two characteristic speeds, one of which is faster than the average speed. In [8], arguments for and against this view are discussed, by comparing the PW model with the Aw–Rascle model.

The Aw–Rascle model was extended by introducing relaxation terms, as can be found, for example, in [9, 10]. Moreover, a model similar to the one proposed by Aw and Rascle was developed independently and following a different rationale by Zhang [5]. To correctly consider all the contributors, this model is now often referred to as the Aw–Rascle–Zhang model or by its acronym ARZ, as for instance in [11].

Analogously to the application of the LWR model to networks (see Sect. 3.2.3), also the ARZ model has been considered for modelling road networks. In this case, the traffic dynamics on roads is given by the ARZ model, while specific conditions or rules must be defined for junctions, in order to determine a unique solution. One of the first works considering the second-order ARZ model applied to networks is [12], where the Riemann problem at junctions is solved by specifying suitable rules on traffic distributions and the maximisation of flows and other quantities. In [13], a road network is considered as well, with the roads modelled by the ARZ model, in which a different model for the junctions is taken into account in order to ensure the conservation of all moments. A further extension of these two junction models can be found in [14], where the solutions guarantee that all the moments are conserved and, at the same time, the total flow at the junction is maximised.

1.3 Phase-Transition Models

As discussed in Sect. 2.1.3, a very relevant peculiarity of traffic flow is associated with the form of the Fundamental Diagram, which is obtained from experimental data. While the left side of this relation (corresponding to the free-flow case) can be easily approximated with a straight line, the left part of the curve (corresponding to the congested regime) is more difficult to be approximated with a single line, since real data are often very sparse. First-order traffic flow models, which assume that the speed of vehicles instantaneously adapts to its steady-state value, cannot capture the aforementioned phenomenon, and this is one of the reasons that have motivated researchers to introduce second-order models.

By following the three-flow phase theory developed by Kerner [15], reporting that three different behaviours can be observed in traffic flow (free-flow, synchronised flow, and wide moving jams), some phase-transition models appeared in the literature. In [16], free-flow and congestion are seen as two different phases, governed by different dynamic equations. In particular, in free-flow conditions, a classical LWR model, of first-order type, is used, while the congested case is represented through a second-order model with dynamic equations defined for the density and for the linearised momentum.

A generalisation of the model proposed in [16] can be found in [17], where a different Fundamental Diagram form is used for the free-flow phase and a variety of possible Fundamental Diagrams is allowed for the congested case, depending on the shape resulting from real data. The accuracy and practicality of this phase-transition model were assessed in [18]. Another phase-transition model was proposed in [19], where the first-order LWR model is coupled with the second-order ARZ model and a transition dynamics from the free-flow to the congested behaviour is introduced. Such model well fits the experimental data and is able to overcome some of the drawbacks of the ARZ model.

The extension of phase-transition models to road networks was addressed for the first time in [20], where, specifically, the phase-transition model presented in [16] is taken into account. In [20], the existence of solutions is proved, without any restriction on the network geometry. The same phase-transition model was also adopted in [21], where a specific model for junctions is considered, also including the presence of precedences among different incoming and outcoming flows.

2 Discrete Second-Order Models

The first discretised versions of the PW model appeared in the literature in the late 80s [22, 23], with applications to the Boulevard Périphérique in Paris. In particular, in [22, 23], the PW model is discretised in space and time, considering new terms to model the influence of on-ramp and off-ramp flows on the mainstream dynamic behaviour. This model was then extended to consider a freeway network [24, 25], by means of the simulation program called METANET, which is an acronym for ‘Modèle d’Écoulement de Trafic sur Autoroute NETworks’. Even if the name METANET was firstly associated with the simulation tool for the freeway network, it is now normally used to indicate the second-order traffic flow model in the discretised version. This latter is the meaning of METANET adopted in this book.

In the remainder of this chapter different versions of the METANET model are reported, for a freeway stretch and for a freeway network, both in the single-class case and in the multi-class version.

2.1 METANET for a Freeway Stretch

Let us consider the METANET model for a freeway stretch with on-ramps and off-ramps, as proposed in [22, 23] and reported here with a slightly different mathematical notation in order to adapt to the notation adopted in this book.

As aforementioned, this model is discrete in space and time, i.e. the freeway stretch is divided into a given number of road portions, called sections, and the time horizon is partitioned into time intervals of equal length. Let N be the number of sections, each one having length \(L_i\) [km], \(i=1, \ldots , N\), and K be the number of time intervals, with sample time T [h]. In the METANET model, on-ramps and off-ramps are assumed to be present within the sections, differently from the case considered in the CTM, where ramps are assumed to be at the interface between subsequent cells (see Sect. 3.3).

Fig. 4.1
figure 1

Sketch of the division of the freeway stretch into sections and the relative notation in METANET

Figure 4.1 shows a sketch of the subdivision of the freeway stretch into sections, with the main variables of the METANET model. For each section \(i=1, \ldots , N\), and for each time step \(k=0, \ldots K\), the following quantities are defined:

  • \(\rho _{i}(k)\) is the traffic density in section i at time kT [veh/km];

  • \(v_{i}(k)\) is the mean traffic speed in section i at time kT [km/h];

  • \(q_{i}(k)\) is the traffic flow leaving section i during time interval \([kT, (k+1)T)\) [veh/h];

  • \(r_{i}(k)\) is the on-ramp traffic flow entering section i during time interval \([kT,(k+1)T)\) [veh/h];

  • \(s_{i}(k)\) is the off-ramp traffic flow exiting section i during time interval \([kT,(k+1)T)\) [veh/h].

The parameters of the model are as follows: \(v^{\mathrm{f}}_{i}\) is the free-flow speed [km/h] of section i, \(\rho ^{\mathrm{cr}}_i\) is the critical density [veh/km] of section i, \(\rho ^\mathrm{max}_i\) is the jam density [veh/km] of section i, \(i=1, \ldots , N\), \(\tau \), \(\nu \), \(\chi \), \(\delta _{\text {on}}\) are model parameters present in the speed equation, while a is a parameter present in the steady-state speed–density relation.

The METANET model is given by the following finite difference equations:

$$\begin{aligned} \rho _i(k+1) = \rho _i(k) + \frac{T}{L_i} \left[ q_{i-1}(k) - q_i(k) + r_i(k) - s_i(k) \right] \end{aligned}$$
(4.12)
$$\begin{aligned} v_i(k+1) = v_i(k) + \frac{T}{\tau } \left[ V \left( \rho _i(k) \right) - v_i(k) \right] + \frac{T}{L_i} v_i(k) \left[ v_{i-1}(k) - v_i(k) \right] \nonumber \\ - \frac{\nu T \left[ \rho _{i+1}(k) - \rho _i(k) \right] }{\tau L_i \left[ \rho _i(k) + \chi \right] }-\delta _{\text {on}} T \frac{v_i(k)r_i(k)}{L_i\left[ \rho _i(k)+\chi \right] }\qquad \end{aligned}$$
(4.13)

where \(i=1,\ldots ,N\), \(k=0,\ldots ,K-1\), while the traffic flow to be used in (4.12) is

$$\begin{aligned} q_i(k) = \rho _i(k) v_i(k) \end{aligned}$$
(4.14)

and the steady-state speed–density relation adopted in (4.13) is given by

$$\begin{aligned} V(\rho _i(k)) = v^{\mathrm{f}}_{i} \exp \left[ -\frac{1}{a} \left( \frac{\rho _i(k)}{\rho ^{\mathrm{cr}}_i} \right) ^a \right] \end{aligned}$$
(4.15)

Equation (4.12) represents the conservation of vehicles, while (4.13) is a discretisation of the speed equation of the PW model, with an additional term. Hence, as in the speed equation (4.3) of the PW model, relaxation, convection and anticipation terms can be identified, as well as a fourth term to model the influence of cars entering from the on-ramp.

The relaxation term, i.e. \( \frac{T}{\tau } \left[ V \left( \rho _i(k) \right) - v_i(k) \right] \), models the fact that vehicles tend to reach the steady-state speed depending on the experienced density \(\rho _i(k)\), according to a parameter \(\tau \), which represents the swiftness of drivers. Hence, vehicles accelerate if their actual speed is lower than the steady-state value, and they decelerate otherwise.

The convection term, i.e. \( \frac{T}{L_i} v_i(k) \left[ v_{i-1}(k) - v_i(k) \right] \), represents the fact that vehicles arriving in section i from section \(i-1\) cannot adapt immediately their speed. If vehicles travel in section \(i-1\) at a higher speed than in section i, they decelerate when they reach section i but this change of speed is not instantaneous. A similar argument applies in case of acceleration from section \(i-1\) to section i.

The anticipation term, i.e. \(- \frac{\nu T \left[ \rho _{i+1}(k) - \rho _i(k) \right] }{\tau L_i \left[ \rho _i(k) + \chi \right] }\), takes into account that drivers adjust their speed also on the basis of the situation they see downstream, hence there is a deceleration if a higher density is seen ahead, and an acceleration in the opposite case.

Finally, the fourth term \(-\delta _{\text {on}} T \frac{v_i(k)r_i(k)}{L_i\left[ \rho _i(k)+\chi \right] } \) was introduced in [22] to model the direct impact of the on-ramp entering flow \(r_i(k)\) on the speed dynamics (note that a similar term was also proposed in [26]). Indeed, vehicles entering from the on-ramps normally have a lower speed than vehicles in the mainstream, inducing a deceleration on these latter vehicles, which is more relevant if the entering flows are high. In [22], the authors suggest to use a similar term with \(s_i(k)\) replacing \(r_i(k)\) and \(\delta _{\text {off}}\) replacing \(\delta _{\text {on}}\), to model the speed reduction due to the exit of vehicles through the off-ramps.

In the METANET model for a freeway stretch, given by (4.12)–(4.15), the boundary conditions are the traffic flow entering the first road section, i.e. \(q_{0}(k)\), the on-ramp and off-ramp traffic flows \(r_{i}(k)\) and \(s_{i}(k)\), \(i=1, \ldots , N\), the mean traffic speed in the section before the first one, i.e. \(v_{0}(k)\), the traffic density in the section after the last one, i.e. \(\rho _{N+1}(k)\), \(k=0, \ldots , K\).

Note that the variables referred to on-ramps and off-ramps are defined for all the sections and are imposed to be equal to 0, i.e. \(r_i(k)=0\), \(s_i(k)=0\), \(k=0, \ldots , K,\) in case section \(i \in \{1, \ldots , N\}\) is not equipped with ramps.

2.2 METANET with On-Ramp Queue Dynamics

The METANET model reported in Sect. 4.2.1 describes the dynamic evolution of the traffic density and the mean speed in a freeway stretch with on-ramps and off-ramps, but it does not model the possible queues at the on-ramps. This latter aspect is particularly relevant when ramp metering control approaches are studied, as, for instance, in [27, 28].

Fig. 4.2
figure 2

Sketch of freeway stretch in case of on-ramp queues and the relative notation in METANET

As shown in Fig. 4.2, the following dynamic quantities are added to the model in order to include the dynamics of the queues at the on-ramps and the possible presence of a ramp metering controller:

  • \(l_{i}(k)\) is the queue length of vehicles waiting in the on-ramp of section i at time kT [veh];

  • \(d_{i}(k)\) is the flow accessing the on-ramp of section i during time interval \([kT, (k+1)T)\) [veh/h];

  • \(r^\mathrm{{C}}_i(k)\) is the ramp metering control variable, i.e. the flow computed by the ramp metering controller that should enter section i from the on-ramp during time interval \([kT, (k+1)T)\) [veh/h].

Besides the parameters of the model described in Sect. 4.2.1, another parameter is considered. This parameter is \(r^{\mathrm{max}}_{i}\), which represents the capacity of the on-ramp of section i, \(i=1, \ldots , N\).

The dynamic equation of the on-ramp queue length, for \(i=1, \ldots , N\), \(k=0, \ldots , K-1\), is given by

$$\begin{aligned} l_i(k+1)=l_i(k)+T\left[ d_i(k)-r_i(k)\right] \end{aligned}$$
(4.16)

In this model, the flow \(r_i(k)\) entering the mainstream from the on-ramp is not a boundary condition, as in the model described in Sect. 4.2.1, since the boundary condition is now given by the demand \(d_{i}(k)\). The flow \(r_i(k)\) is computed in a different way depending on the fact that the on-ramp in section i is uncontrolled or controlled with ramp metering policies. Let us distinguish these two cases.

Uncontrolled On-Ramps In case the on-ramp of section i is uncontrolled, the flow \(r_i(k)\) entering the mainstream from the on-ramp of section i during time interval \([kT, (k+1)T)\) is computed as

$$\begin{aligned} r_i(k) =\min \left\{ d_i(k)+\frac{l_i(k)}{T}, r^{\mathrm{max}}_{i}, r^{\mathrm{max}}_{i} \frac{\rho ^\mathrm{max}_i-\rho _i(k)}{\rho ^\mathrm{max}_i-\rho ^\mathrm{cr}_i}\right\} \end{aligned}$$
(4.17)

Equation (4.17) computes the on-ramp flow as the minimum between three values: the flow corresponding to the vehicles in the on-ramp (waiting in the queue or reaching it), the on-ramp capacity, and the maximum flow that should enter the mainstream due to the traffic conditions. Note that this third term is computed as a reduction of the on-ramp capacity in case traffic conditions in the mainstream become congested, i.e. if \(\rho _i(k)>\rho ^\mathrm{cr}_i\).

Controlled On-Ramps If the on-ramp of section i is controlled, the flow \(r_i(k)\) entering the mainstream from the on-ramp of section i during time interval \([kT, (k+1)T)\) is given by

$$\begin{aligned} r_{i}(k) =\min \left\{ d_{i}(k)+\frac{l_{i}(k)}{T}, r^{\mathrm{max}}_{i}, r^\mathrm{{C}}_i(k), r^{\mathrm{max}}_{i} \frac{\rho ^\mathrm{max}_i-\rho _{i}(k)}{\rho ^\mathrm{max}_i-\rho ^\mathrm{cr}_i}\right\} \end{aligned}$$
(4.18)

in which the flow computed by the ramp metering controller \(r^\mathrm{{C}}_i(k)\) is added as a fourth term in the minimum function.

In some cases, it is preferable to represent the controlled case in a slightly different way, i.e. instead of considering the flow \(r^\mathrm{{C}}_i(k)\) as ramp metering control variable, the metering rate \(\mu _i(k) \in [\mu ^\mathrm{min}_i, 1]\) is adopted as control variable, \(\mu ^\mathrm{min}_i\) being the minimum on-ramp metering rate. If \(\mu _i(k)=1\), no ramp metering policy is applied, while ramp metering becomes active if \(\mu _i(k)<1\). In this case, (4.18) is replaced by the following:

$$\begin{aligned} r_{i}(k) =\mu _i(k) \min \left\{ d_{i}(k)+\frac{l_{i}(k)}{T}, r^{\mathrm{max}}_{i}, r^{\mathrm{max}}_{i} \frac{\rho ^\mathrm{max}_i-\rho _{i}(k)}{\rho ^\mathrm{max}_i-\rho ^\mathrm{cr}_i}\right\} \end{aligned}$$
(4.19)

The augmented METANET model to include the on-ramp queue dynamics for a freeway with off-ramps and on-ramps is given by (4.12)–(4.16), with (4.17) if the on-ramps are not controlled, and (4.18) or (4.19) for the controlled on-ramps. The boundary conditions are, in this case, the traffic flow entering the first road section, i.e. \(q_{0}(k)\), the off-ramp traffic flows \(s_{i}(k)\), the on-ramp demands \(d_i(k)\), \(i=1, \ldots , N\), the mean traffic speed in the section before the first one, i.e. \(v_{0}(k)\), the traffic density in the section after the last one, i.e. \(\rho _{N+1}(k)\), \(k=0, \ldots , K\).

As in Sect. 4.2.1, the variables referred to on-ramps and off-ramps are defined for all the sections. They are then fixed to 0, i.e. \(r_i(k)=0\), \(d_{i}(k)=0\), \(l_{i}(k)=0\), \(s_i(k)=0\), \(k=0, \ldots , K,\) if section \(i \in \{1, \ldots ,N\}\) is not equipped with ramps.

Note that the equation for the queue dynamics can be also adopted to consider the possible queue which is created to enter the considered freeway stretch. In that case, \(l_{0}(k)\) denotes this queue length and its dynamics is modelled similarly to (4.16), where the demand is \(d_{0}(k)\) and the flow entering the mainstream is \(q_{0}(k)\).

2.3 METANET for a Freeway Network

The METANET model described in the previous sections for a freeway stretch has been extended to consider a freeway network of arbitrary topology, including freeway stretches, bifurcations, on-ramps and off-ramps, in all types of traffic conditions, and also in case of events causing capacity reduction [24, 25].

According to this model, the freeway network is represented by means of a directed graph (see Fig. 4.3) composed of:

  • M freeway links, i.e. freeway stretches with homogeneous geometric characteristics (number of lanes, curvatures and so on);

  • O origin links, i.e. links which forward traffic flows from outside into the considered freeway network (they can represent either on-ramps or other freeway stretches merging in the considered network);

  • N nodes, representing junctions, bifurcations, merging on-ramps or diverging off-ramps, connecting no more than three links.

Fig. 4.3
figure 3

Links and nodes in a freeway network according to METANET

Note that the assumptions aforementioned are not restrictive and allow to represent any type of freeway network. As a matter of fact, in case a freeway stretch presents inhomogeneous characteristics, it can be represented by two or more consecutive links separated by nodes positioned where the road geometry changes. Moreover, in case of a complex node connecting more than three links, it can be easily decomposed into more nodes meeting such condition, by introducing dummy links and dummy nodes. Finally, note that the two directions of a freeway stretch should be represented as separate links with opposite directions.

Each freeway link \(m=1, \ldots , M\) is further divided into \(N_m\) sections which have a length denoted with \(L_m\) [km] and a number of lanes indicated with \(\lambda _m\). Also, for each node \(n=1, \ldots , N\), \(O_n\) is the set of exiting links, and \(I_n\), \(\bar{I}_n\) are the set of entering freeway links and entering origin links, respectively.

The METANET model may be used to describe the traffic behaviour in a freeway network in two different ways: in a non-destination-oriented mode, when the traffic assignment problem is not considered and the destination of vehicles travelling in the network is neglected, or in a destination-oriented mode, when instead the drivers’ route choice behaviour is considered and the choice of road users among alternative paths is explicitly modelled. In this section, the destination-oriented model is reported, since it is more general and particularly useful in case route guidance control is applied to the traffic network. The model in the non-destination-oriented mode is similar to the destination-oriented one, but it does not include the variables which depend on the destination of drivers (see [25] for further details).

In the destination-oriented model, for each link and for each node, it is necessary to specify the set of reachable destinations. Let us denote with \(J_m\), \(\bar{J}_o\), \(\bar{\bar{J}}_n\), respectively, the sets of destinations reachable from freeway link \(m=1, \ldots , M\), from origin link \(o=1, \ldots , O\), and from node \(n=1, \ldots , N\).

The time horizon is divided into K time intervals, with sample time interval T [h]. The variables referring to the freeway links, for each freeway link \(m=1, \ldots , M\), for each section \(i=1, \ldots , N_m\), and for each time step \(k=0, \ldots , K\), are:

  • \(\rho _{m,i,j}(k)\) is the partial traffic density in section i of link m at time instant kT with destination \(j\in J_m\) [veh/km/lane];

  • \(\rho _{m,i}(k)\) is the traffic density in section i of link m at time instant kT [veh/km/lane];

  • \(v_{m,i}(k)\) is the mean traffic speed in section i of link m at time instant kT [km/h];

  • \(q_{m,i}(k)\) is the traffic flow leaving section i of link m during time interval \([kT, (k+1)T)\) [veh/h];

  • \(\gamma _{m,i,j}(k)\in [0, 1]\) is the composition rate, i.e. the portion of flow in section i of link m at time instant kT having destination \(j\in J_m\); the values of the composition rates must verify that \(\sum _{j \in J_m}\gamma _{m,i,j}(k)=1\).

The variables referring to the origin links, for each origin link \(o=1, \ldots , O\) and for each time step \(k=0, \ldots , K\), are:

  • \(d_{o,j}(k)\) is the partial origin demand entering origin link o at time instant kT with destination \(j\in \bar{J}_o\) [veh/h];

  • \(d_{o}(k)\) is the origin demand entering origin link o at time instant kT [veh/h];

  • \(l_{o,j}(k)\) is the partial queue length at origin link o at time instant kT with destination \(j\in \bar{J}_o\) [veh];

  • \(l_{o}(k)\) is the queue length at origin link o at time instant kT [veh];

  • \(\gamma _{o,j}(k) \in [0, 1]\) is the composition rate, i.e. the portion of flow leaving origin link o at time instant kT having destination \(j\in \bar{J}_o\); the values of the composition rates must verify that \(\sum _{j \in \bar{J}_o}\gamma _{o,j}(k)=1\);

  • \(\theta _{o,j}(k)\in [0, 1]\) is the portion of the demand originating in origin link o at time instant kT having destination \(j\in \bar{J}_o\); analogously to the composition rates, it holds that \(\sum _{j \in \bar{J}_o}\theta _{o,j}(k)=1\);

  • \(q_{o}(k)\) is the traffic flow leaving origin link o during time interval \([kT, (k+1)T)\) [veh/h];

  • \(r^\mathrm{{C}}_{o}(k)\) is the ramp metering control variable, i.e. the flow computed by the ramp metering controller that should enter from the origin link o during time interval \([kT, (k+1)T)\) [veh/h].

The variables referring to the nodes, for each node \(n=1, \ldots , N\) and for each time step \(k=0, \ldots , K\), are:

  • \(Q_{n,j}(k)\) is the flow entering node n during time interval \([kT, (k+1)T)\) with destination \(j\in \bar{\bar{J}}_n\) [veh/h];

  • \(\beta _{m,n,j}(k) \in [0, 1]\) is the splitting rate, i.e. the portion of flow present in node n at time instant kT which chooses link m to reach destination \(j \in \bar{\bar{J}}_n\); the values of the splitting rates must verify that \(\sum _{\mu \in O_n}\beta _{\mu ,n,j}(k)=1\).

The model parameters are: \(v^{\mathrm{f}}_{m}\) is the free-flow speed [km/h] in each section of link m, \(\rho ^{\mathrm{cr}}_{m}\) is the critical density [veh/km/lane] in each section of link m, \(\rho ^\mathrm{max}_{m}\) is the jam density [veh/km/lane] in each section of link m, \(m=1, \ldots , M\), \(q^\mathrm{{max}}_o\) is the capacity of origin link o, \(o=1, \ldots , O\), whereas \(\tau \), \(\nu \), \(\chi \), \(\delta _{\text {on}}\), \(\phi \) are model parameters present in the speed equation, and \(a_m\), \(m=1, \ldots , M\), is a parameter characterising the steady-state speed–density relation.

Let us now distinguish the model equations of the freeway links, the origin links and the nodes, in case of possible controlled on-ramps and route guidance control actions. Moreover, an additional description is added to show how METANET has been extended to include the application of mainstream control actions in terms of variable speed limits.

Freeway Links The equations characterising freeway links are an extension of (4.12)–(4.15), taking into account that in the network model the traffic densities are expressed per lane and that the destinations are taken into account. In particular, the conservation equation is here written for the partial traffic density, i.e.

$$\begin{aligned} \rho _{m,i,j}(k+1)=\rho _{m,i,j}(k)+\frac{T}{L_m \lambda _m}\left[ \gamma _{m,i-1,j}(k)q_{m,i-1}(k)-\gamma _{m,i,j}(k)q_{m,i}(k) \right] \end{aligned}$$
(4.20)

where \(m=1,\ldots ,M\), \(i=1,\ldots ,N_m\), \(j\in J_m\), \(k=0,\ldots ,K-1\), and the following relations hold:

$$\begin{aligned} \rho _{m,i}(k)=\sum _{j \in J_m}\rho _{m,i,j}(k) \end{aligned}$$
(4.21)
$$\begin{aligned} \gamma _{m,i,j}(k)=\frac{\rho _{m,i,j}(k)}{\rho _{m,i}(k)} \end{aligned}$$
(4.22)

The speed dynamic equation is

$$\begin{aligned} v_{m,i}(k+1) = v_{m,i}(k) + \frac{T}{\tau } \left[ V\left( \rho _{m,i}(k)\right) - v_{m,i}(k) \right] \nonumber \\ +\,\frac{T}{L_m} v_{m,i}(k) \left[ v_{m,i-1}(k) - v_{m,i}(k) \right] - \frac{\nu T \left[ \rho _{m,i+1}(k) - \rho _{m,i}(k) \right] }{\tau L_m \left[ \rho _{m,i}(k) + \chi \right] } \end{aligned}$$
(4.23)

where \(m=1,\ldots ,M\), \(i=1,\ldots ,N_m\), \(k=0,\ldots ,K-1\). The traffic flow in (4.20) and the steady-state speed–density relation in (4.23) are given by

$$\begin{aligned} q_{m,i}(k) = \rho _{m,i}(k)v_{m,i}(k)\lambda _m \end{aligned}$$
(4.24)
$$\begin{aligned} V\left( \rho _{m,i}(k)\right) = v^{\mathrm{f}}_{m} \exp \left[ -\frac{1}{a_m} \left( \frac{\rho _{m,i}(k)}{\rho ^{\mathrm{cr}}_{m}} \right) ^{a_m} \right] \end{aligned}$$
(4.25)

In (4.23), an additional term can be added to take into account the speed reduction caused by merging phenomena near on-ramps, analogous to the fourth term in (4.13). In particular, let us consider a node in which an origin link o enters and let us denote with m the link exiting that node; in the first section of link m there is a speed reduction given by

$$\begin{aligned} -\delta _{\text {on}} T \frac{v_{m,1}(k) q_{o}(k)}{L_m\lambda _m\left[ \rho _{m,1}(k)+\chi \right] } \end{aligned}$$
(4.26)

In (4.23), it is possible to add a further additional term to model the speed reduction due to weaving phenomena in case of lane reductions in the mainstream. By denoting with \(\varDelta \lambda \) the number of lanes dropped between link m and the following one, the speed reduction in the last section of link m is given by

$$\begin{aligned} -\phi T\varDelta \lambda \frac{v_{m,N_m}(k)^2 \rho _{m,N_m}(k)}{L_m\lambda _m\rho ^\mathrm{cr}_{m}} \end{aligned}$$
(4.27)

The boundary conditions in (4.23) are the virtual downstream density \(\rho _{m,N_{m}+1}(k)\) at the end of the link and the virtual upstream speed \(v_{m,0}(k)\) at the beginning of the link. In case of nodes with one input link and output link, these values are obtained directly from adjacent links, but in case of nodes with more than two links, these values must be computed as suitable weighted sums. In particular, if node n (at the end of link m) has more than one leaving link, the virtual downstream density can be computed as in (4.65), i.e.

$$\begin{aligned} \rho _{m,N_{m}+1}(k)=\frac{\sum _{\mu \in O_n}\rho _{\mu ,1}(k)^2}{\sum _{\mu \in O_n}\rho _{\mu ,1}(k)} \end{aligned}$$
(4.28)

where the quadratical relation is used to represent the fact that a highly loaded link contributes to the spillback more than proportionally.

In case node n (at the beginning of link m) has more than one entering link, the virtual upstream speed may be computed as

$$\begin{aligned} v_{m,0}(k)=\frac{\sum _{\mu \in I_n}v_{\mu ,N_\mu }(k) q_{\mu ,N_\mu }(k)}{\sum _{\mu \in I_n}q_{\mu ,N_\mu }(k)} \end{aligned}$$
(4.29)

Origin Links The equations of the origin links are analogous to (4.16)–(4.19), adapted to the network model. In particular, the dynamic evolution of the partial queue length is calculated as

$$\begin{aligned} l_{o,j}(k+1) = l_{o,j}(k) + T \left[ d_{o,j}(k) - \gamma _{o,j}(k)q_{o}(k) \right] \end{aligned}$$
(4.30)

where \(o=1, \ldots , O\), \(j=1, \ldots , \bar{J}_o\), \(k=0, \ldots , K-1\), and the following relations hold:

$$\begin{aligned} l_{o}(k)=\sum _{j \in \bar{J}_o}l_{o,j}(k) \end{aligned}$$
(4.31)
$$\begin{aligned} \gamma _{o,j}(k) =\frac{l_{o,j}(k)}{l_{o}(k)} \end{aligned}$$
(4.32)
$$\begin{aligned} d_{o,j}(k) = \theta _{o,j}(k)d_{o}(k) \end{aligned}$$
(4.33)

The traffic flow leaving origin link o and entering the mainstream, i.e. entering the downstream link m, is given by

$$\begin{aligned} q_{o}(k) =\min \left\{ d_{o}(k)+\frac{l_{o}(k)}{T}, q^\mathrm{{max}}_o, q^\mathrm{{max}}_o \frac{\rho ^\mathrm{max}_{m}-\rho _{m,1}(k)}{\rho ^\mathrm{max}_{m}-\rho ^\mathrm{cr}_{m}}\right\} \end{aligned}$$
(4.34)

If, instead, the considered origin link o is a controlled on-ramp, the traffic flow leaving origin link o and entering link m is computed as

$$\begin{aligned} q_{o}(k) =\min \left\{ d_{o}(k)+\frac{l_{o}(k)}{T}, q^\mathrm{{max}}_o, r^\mathrm{{C}}_{o}(k), q^\mathrm{{max}}_o \frac{\rho ^\mathrm{max}_{m}-\rho _{m,1}(k)}{\rho ^\mathrm{max}_{m}-\rho ^\mathrm{cr}_{m}}\right\} \end{aligned}$$
(4.35)

As already mentioned in Sect. 4.2.2, in some cases the considered control variable is the metering rate \(\mu _o(k) \in [\mu ^\mathrm{min}_o, 1]\), \(\mu ^\mathrm{min}_o\) being the minimum on-ramp metering rate. In these cases, (4.35) can be substituted by

$$\begin{aligned} q_{o}(k) =\mu _o(k) \min \left\{ d_{o}(k)+\frac{l_{o}(k)}{T}, q^\mathrm{{max}}_o, q^\mathrm{{max}}_o \frac{\rho ^\mathrm{max}_{m}-\rho _{m,1}(k)}{\rho ^\mathrm{max}_{m}-\rho ^\mathrm{cr}_{m}}\right\} \end{aligned}$$
(4.36)

Equations (4.30)–(4.35) can be slightly modified to represent the so-called store-and-forward links, which are links characterised not only by a capacity and a queue length but also by constant travel times. These links are useful to consider urban zones or motorway-to-motorway control [25].

Nodes The model of the nodes does not represent any dynamic behaviour, but only conservation of flows. The total traffic flow entering node \(n=1, \ldots ,N\) with destination \(j \in \bar{\bar{J}}_n\), referred to time step \(k=0, \ldots , K\), is computed as the sum of the entering flows with destination j, i.e.

$$\begin{aligned} Q_{n,j}(k)=\sum _{\mu \in I_n} q_{\mu ,N_{\mu }}(k)\gamma _{\mu ,N_{\mu },j}(k)+\sum _{o\in \bar{I}_n} q_{o}(k)\gamma _{o,j}(k) \end{aligned}$$
(4.37)

The traffic flow exiting node \(n=1, \ldots ,N\) and entering the first section of link \(m=1, \ldots ,M\), referred to time step \(k=0, \ldots , K\), is calculated as the sum of flows choosing link m in the bifurcation, i.e.

$$\begin{aligned} q_{m,0}(k)=\sum _{j\in J_m} \beta _{m,n,j}(k) Q_{n,j}(k) \end{aligned}$$
(4.38)

Equation (4.38) is used to set the boundary conditions \(q_{m,0}(k)\) in (4.20), where other boundary conditions are \(\gamma _{m,0,j}(k)\), which are computed as

$$\begin{aligned} \gamma _{m,0,j}(k)=\frac{\beta _{m,n,j}(k) Q_{n,j}(k)}{q_{m,0}(k)} \end{aligned}$$
(4.39)

In presence of route guidance control, the splitting rates become the control variables, but it is in this case important to distinguish among different variables representing splitting rates. The following quantities are added to the model:

  • \(\beta ^\mathrm{{C}}_{m,n,j}(k) \in [0, 1]\) is the route guidance control variable, i.e. the splitting rate defined by a suitable traffic controller to be actuated at node n and representing the portion of flow present in node n at time instant kT which should choose link m to reach destination \(j \in \bar{\bar{J}}_n\);

  • \(\beta ^\mathrm{{N}}_{m,n,j}(k) \in [0, 1]\) is the nominal splitting rate, i.e. the portion of flow present in node n at time instant kT which would spontaneously choose link m to reach destination \(j \in \bar{\bar{J}}_n\).

Note that \(\beta ^\mathrm{{C}}_{m,n,j}(k)\) is the splitting rate defined with a suitable control approach and communicated to drivers through the visualisation of proper recommendations on Variable Message Signs (VMSs). If, for instance, \(\beta ^\mathrm{{C}}_{m,n,j}(k)=1\), this means that it is recommended to drivers to choose link m to reach destination j.

The effective splitting rates depend both on these splitting rates suggested through VMSs and the natural and spontaneous route choice of the drivers, according to a compliance rate \(\varepsilon _{m,n} \in [0, 1]\), which is a model parameter. In the considered model, the effective splitting rates \(\beta _{m,n,j}(k)\) are obtained as a weighing sum of the suggested rates \(\beta ^\mathrm{{C}}_{m,n,j}(k)\) and the nominal rates \(\beta ^\mathrm{{N}}_{m,n,j}(k)\) resulting in absence of route recommendations, i.e.

$$\begin{aligned} \beta _{m,n,j}(k)=(1-\varepsilon _{m,n})\beta ^\mathrm{{N}}_{m,n,j}(k) + \varepsilon _{m,n} \beta ^\mathrm{{C}}_{m,n,j}(k) \end{aligned}$$
(4.40)

Freeway links controlled with variable speed limits The original METANET model [25] does not describe the effect of variable speed limits applied in freeway links through VMSs. There are many different ways in which researchers have modelled this aspect but, up to now, there is not one model that is universally known as a suitable representation of variable speed limits in freeways. We will report two possible developments of METANET, widely adopted by researchers, which model the presence of variable speed limits in a freeway link in terms of a variation of the steady-state speed–density relation \(V\left( \rho _{m,i}(k)\right) \) given by (4.25).

The model proposed in [29, 30] was developed in contrast with early models [31] in which the effect of speed limits was considered by scaling down the desired speed, consequently changing the shape of the whole Fundamental Diagram and reducing the capacity. According to the authors of [29, 30], that approach was not realistic and, then, a more realistic model was introduced, by assuming that the steady-state speed in case of variable speed limits is the minimum between the usual steady-state speed and the speed caused by the limit imposed through VMSs. According to this view, let us consider the following additional variable:

  • \(v^\mathrm{{C}}_{m,i}(k)\) is the variable speed limit control variable representing the traffic speed to display in section i of link m during time interval \([kT, (k+1)T)\) [km/h].

Then, the steady-state speed–density relationship becomes

$$\begin{aligned} V\left( \rho _{m,i}(k)\right) = \min \left\{ v^{\mathrm{f}}_{m} \exp \left[ -\frac{1}{a_m} \left( \frac{\rho _{m,i}(k)}{\rho ^{\mathrm{cr}}_{m}} \right) ^{a_m} \right] , (1+ \alpha )v^\mathrm{{C}}_{m,i}(k) \right\} \end{aligned}$$
(4.41)

where \(\alpha \) models the compliance rate of drivers. In (4.41), the control variable \(v^\mathrm{{C}}_{m,i}(k)\) is multiplied for \((1+ \alpha )\) because drivers normally do not follow completely the speed limits and their desired speed is usually higher than the imposed speed limit (see [29, 30] for more details on this model).

Another development of METANET to consider variable speed limits has been proposed more recently [32, 33]. In [32, 33], again, the steady-state speed–density relationship depends on the speed displayed on VMSs but the dependence is different from the one provided in (4.41), as well as the meaning of the control variable. Specifically, let us introduce the following additional variable:

  • \(b_{m}(k) \in [b^\mathrm{{min}}, 1]\) is the variable speed limit control variable, representing the variable speed limit rate to display in each section of link m during time interval \([kT, (k+1)T)\).

Note that \(b^\mathrm{{min}}\) is a lower admissible bound for the control variable. This latter can be interpreted as a rate limiting the speed of vehicles, hence \(b_{m}(k)=1\) means that no variable speed limits are applied, while the control case corresponds to \(b_{m}(k)<1\). In this model, the steady-state speed–density relationship is written analogously to (4.25) but with parameters dependent on \(b_{m}(k)\), i.e.

$$\begin{aligned} V\left( \rho _{m,i}(k),b_{m}(k)\right) =v^{\mathrm{f}}_{m}\left( b_{m}(k)\right) \exp \left[ -\frac{1}{a_m\left( b_{m}(k)\right) } \left( \frac{\rho _{m,i}(k)}{\rho ^{\mathrm{cr}}_{m}\left( b_{m}(k)\right) } \right) ^{a_m\left( b_{m}(k)\right) } \right] \end{aligned}$$
(4.42)

where the dependence of the parameters on \(b_{m}(k)\) is of affine type, as follows:

$$\begin{aligned} v^{\mathrm{f}}_{m}\left( b_{m}(k)\right) = v^{\mathrm{f}}_{m} b_{m}(k) \end{aligned}$$
(4.43)
$$\begin{aligned} \rho ^{\mathrm{cr}}_{m}\left( b_{m}(k)\right) =\rho ^{\mathrm{cr}}_{m}\left[ 1+A_m(1-b_{m}(k))\right] \end{aligned}$$
(4.44)
$$\begin{aligned} a_m\left( b_{m}(k)\right) =a_m\left[ E_m-(E_m-1)b_{m}(k) \right] \end{aligned}$$
(4.45)

in which \(A_m\) and \(E_m\) are model parameters. Note that, when \(b_{m}(k)=1\), (4.42) is equal to (4.25).

To summarise, the METANET model for a freeway network is given by (4.20)–(4.40), with (4.41) or (4.42)–(4.45) instead of (4.25) in case of variable speed limits. The boundary conditions are the demands of the origin links \(d_o(k)\), with the ratios of these demands for each destination, i.e. \(\theta _{o,j}(k)\), \(o=1, \ldots , O\), \(j \in \bar{J}_o\), \(k=0, \ldots , K\), and the traffic density in the sections downstream the considered freeway network, i.e. \(\rho _{m,N_{m}+1}(k)\), \(k=0, \ldots , K\), for links \(m \in \{1, \ldots ,M\}\) which are destination links.

3 Multi-class Second-Order Models

As discussed in Sect. 3.4, there are many motivations for explicitly modelling the presence of multiple classes of vehicles in the traffic flow. These motivations not only apply for first-order traffic flow models but also for second-order models. Nevertheless, less research studies have dealt with the developments of second-order macroscopic models for the multi-class context, compared with first-order models, and these studies are rather recent.

In particular, few works in the multi-class literature deal with continuous second-order traffic flow models. For instance, in [34], starting from a car-following model for heterogeneous traffic flow and exploiting the relationship between micro and macro variables, a macroscopic traffic model is developed to represent the flow dynamics of cars and buses. In [35], the Aw–Rascle model is extended to represent heterogeneous traffic flow: in that paper, this model is calibrated using data from an arterial section in India and the results are compared with those obtained from other multi-class traffic models.

The literature on discrete second-order traffic flow models extended to the multi-class case is limited as well. In [36], the METANET model is adapted to represent a heterogeneous flow, considering an interpolation among the different Fundamental Diagrams of each class of vehicles, and is exploited within a Model Predictive Control (MPC) approach. A different multi-class second-order traffic model is proposed in [37], extending the approach proposed in [38]. In [37], each vehicle class is subject to its own single-class Fundamental Diagram, and is limited within an assigned space.

Another multi-class extension of the METANET model was proposed in [39], then slightly modified in [40, 41] for a freeway stretch and in [42] for a freeway network. In these latter models, the interaction among the different classes of vehicles is modelled through a Fundamental Diagram, different for each class, in which the flow of each class depends on the total density. In the following subsections, this latter multi-class model is analysed more in detail, respectively for a freeway stretch and for a network.

3.1 A Multi-class Second-Order Model for a Freeway Stretch

The model reported in this section was proposed in [40, 41], for the case of a multi-class ramp metering strategy. It is worth noting that considering a multi-class ramp metering policy implies that separate lanes and separate traffic lights are present at the on-ramps for different vehicles classes; the most realistic case is surely the one in which cars and trucks are distinguished and the on-ramps are divided in two different lanes.

The considered model extends the METANET model for a freeway stretch, described in Sects. 4.2.1 and 4.2.2, to the case in which different classes of vehicles are taken into account. Even though some notation of the multi-class model is common to the one-class model, for the reader’s convenience the entire nomenclature of the multi-class model is reported and described in the following.

The considered multi-class macroscopic traffic flow model is based on the division of the freeway stretch into N sections and the discretisation of the time horizon into K time intervals. Moreover, C classes of vehicles are considered. Let T indicate the sample time interval and \(L_i\) the length [km] of section i, \(i=1,\ldots ,N\).

In order to correctly model the presence of different types of vehicles, let us introduce the parameter \(\eta ^c\), \(c=1, \ldots , C\), which represents a conversion factor of vehicles of class c into cars. This parameter has a meaning analogous to the definition of Passenger Car Equivalents (PCE), that is the number of passenger cars displaced by a single heavy vehicle of a particular type under specific traffic and control conditions [43]. This parameter can vary depending on the traffic conditions in a road portion [44], but in this multi-class traffic model, \(\eta ^c\), \(c=1, \ldots , C\), is assumed to be a constant value.

For each section \(i=1, \ldots , N\), and for each time step \(k=0, \ldots K\), the main aggregate variables of the model are defined for each class \(c=1, \ldots , C\):

  • \(\rho _{i}^{c}(k)\) is the traffic density of class c in section i at time kT [veh\(^c\)/km];

  • \(v_{i}^{c}(k)\) is the mean traffic speed of class c in section i at time kT [km/h];

  • \(q_{i}^{c}(k)\) is the traffic flow of class c leaving section i during time interval \([kT, (k+1)T)\) [veh\(^c\)/h];

  • \(r_{i}^{c}(k)\) is the on-ramp traffic flow of class c entering section i during time interval \([kT, (k+1)T)\) [veh\(^c\)/h];

  • \(s_{i}^{c}(k)\) is the off-ramp traffic flow of class c exiting section i during time interval \([kT, (k+1)T)\) [veh\(^c\)/h];

  • \(l_{i}^{c}(k)\) is the queue length of vehicles of class c waiting in the on-ramp of section i at time kT [veh\(^c\)];

  • \(d_{i}^{c}(k)\) is the flow of class c accessing the on-ramp of section i during time interval \([kT, (k+1)T)\) [veh\(^c\)/h];

  • \(r_{i}^{\mathrm{{C}},c}(k)\) is the ramp metering control variable, i.e. the flow of class c, computed by the ramp metering controller, that should enter section i from the on-ramp during time interval \([kT, (k+1)T)\) [veh\(^c\)/h].

To correctly define the multi-class model, some variables referred to the total flow of vehicles are also required, as follows:

  • \(\rho _{i}(k)\) is the traffic density in section i at time kT [PCE/km];

  • \(r_{i}(k)\) is the total on-ramp traffic flow entering section i during time interval \([kT, (k+1)T)\) [PCE/h].

The considered model includes some traffic parameters. Specifically, \(v^{\mathrm{f},c}_{i}\) is the free-flow speed [km/h] referred to class c and section i, \(\rho ^{\mathrm{cr}}_i\) is the critical density [PCE/km] of section i, \(\rho ^{\mathrm{max}}_i\) is the jam density [PCE/km] of section i, \(r^{\mathrm{max},c}_{i}\) is the on-ramp capacity for class c and section i [veh\(^c\)/h], \(c=1, \ldots , C\), \(i=1,\ldots ,N\), while \(\tau ^c\), \(\nu ^c\), \(\chi ^c\), \(\delta _{\text {on}}^c\) are model parameters present in the speed equation, and \(l^c\), \(m^c\) are parameters of the steady-state speed–density relation, \(c=1, \ldots , C\).

On the basis of the single-class model (4.12)–(4.18), the multi-class traffic model for a freeway stretch is given by the following dynamic equations:

$$\begin{aligned} \rho _{i}^{c}(k+1)=\rho _{i}^{c}(k)+\frac{T}{L_i}\left[ q_{i-1}^c(k)-q_{i}^{c}(k)+r_{i}^{c}(k)-s_{i}^{c}(k)\right] \end{aligned}$$
(4.46)
$$\begin{aligned} v_{i}^{c}(k+1) = v_{i}^{c}(k) + \frac{T}{\tau ^c} \left[ V^c(\rho _{i} (k)) - v_{i}^{c}(k) \right] +\frac{T}{L_i} v_{i}^{c}(k) \left[ v_{i-1}^c(k) - v_{i}^{c}(k) \right] \nonumber \\ - \,\frac{\nu ^c T \left[ \rho _{i+1}(k) - \rho _{i}(k) \right] }{\tau ^c L_i \left[ \rho _{i}(k) + \chi ^c \right] } -\delta _{\text {on}}^c T \frac{v_{i}^{c}(k) r_{i}(k)}{L_i\left[ \rho _{i}(k)+\chi ^c\right] }\qquad \qquad \end{aligned}$$
(4.47)
$$\begin{aligned} l_{i}^{c}(k+1) = l_{i}^{c}(k) + T \left[ d_{i}^{c}(k) -r_{i}^{c}(k) \right] \end{aligned}$$
(4.48)

where \(c=1, \ldots , C\), \(i=1,\ldots , N\), \(k=0,\ldots ,K-1\). Note that, in the speed equation (4.47) for vehicles of class c, the anticipation term depends on the total density \(\rho _{i}(k)\) downstream, as well as the fourth term depends on the total on-ramp flow \(r_{i}(k)\) merging in the mainstream, since the acceleration or deceleration of class c depends on the total flow of vehicles seen ahead.

The traffic flow in (4.46) is obtained as

$$\begin{aligned} q_{i}^{c}(k) = \rho _{i}^{c}(k) v_{i}^{c}(k) \end{aligned}$$
(4.49)

whereas the total density and the total on-ramp traffic flow used in (4.47) can be computed, respectively, as

$$\begin{aligned} \rho _{i}(k)= \sum _{c=1}^C\eta ^c \rho _{i}^c(k) \end{aligned}$$
(4.50)
$$\begin{aligned} r_{i}(k)= \sum _{c=1}^C\eta ^c r_{i}^c(k) \end{aligned}$$
(4.51)

and the steady-state speed–density relation in (4.47) is given by

$$\begin{aligned} V^c(\rho _{i} (k)) = v^{\mathrm{f},c}_{i} \left[ 1- \left( \frac{\rho _{i}(k)}{\rho ^\mathrm{max}_i}\right) ^{l^c}\right] ^{m^c} \end{aligned}$$
(4.52)

In (4.52) the steady-state speed of class c depends on the total density \(\rho _{i}(k)\) and on parameters that are specific of class c, i.e. the free-flow speed \(v^{\mathrm{f},c}_{i}\), and parameters \(l^c\) and \(m^c\). Note that, in the multi-class version of the freeway traffic model, the steady-state relation (4.52) has been used, instead of considering a multi-class version of (4.15), since this type of relation presents a more general form, as already discussed in Sect. 3.1.2.

If the on-ramps are not controlled, the on-ramp traffic flow is computed as

$$\begin{aligned} r_{i}^{c}(k) =\min \left\{ d_{i}^{c}(k)+\frac{l_{i}^{c}(k)}{T}, r^{\mathrm{max},c}_{i}, r^{\mathrm{max},c}_{i} \frac{\rho ^\mathrm{max}_i-\rho _{i}(k)}{\rho ^\mathrm{max}_i-\rho ^\mathrm{cr}_i}\right\} \end{aligned}$$
(4.53)

whereas, in the controlled case, this flow is given by

$$\begin{aligned} r_{i}^{c}(k) =\min \left\{ d_{i}^{c}(k)+\frac{l_{i}^{c}(k)}{T}, r_{i}^{\mathrm{{C}},c}(k), r^{\mathrm{max},c}_{i}, r^{\mathrm{max},c}_{i} \frac{\rho ^\mathrm{max}_i-\rho _{i}(k)}{\rho ^\mathrm{max}_i-\rho ^\mathrm{cr}_i}\right\} \end{aligned}$$
(4.54)

If, as mentioned in Sect. 4.2.2, the considered control variable is the metering rate \(\mu ^c_i(k) \in [\mu ^{\mathrm{min},c}_i, 1]\), \(\mu ^{\mathrm{min},c}_i\) being the minimum on-ramp metering rate, (4.54) can be substituted by

$$\begin{aligned} r^{c}_{i}(k) =\mu ^c_i(k) \min \left\{ d^c_{i}(k)+\frac{l^c_{i}(k)}{T}, r^{\mathrm{max},c}_{i}, r^{\mathrm{max},c}_{i} \frac{\rho ^\mathrm{max}_i-\rho _{i}(k)}{\rho ^\mathrm{max}_i-\rho ^\mathrm{cr}_i}\right\} \end{aligned}$$
(4.55)

Note that, in the last term in (4.53)–(4.55), the total density \(\rho _{i}(k)\) is considered, since the reduction of the on-ramp entering flow due to congestion in the mainstream is related to the density of all the vehicles present in the mainstream.

3.2 A Multi-class Second-Order Model for a Freeway Network

The multi-class second-order model for a freeway network presented here is the multi-class extension of the network model described in Sect. 4.2.3, taking into account the multi-class concepts already described in Sect. 4.3.1. This model was proposed in [42] for a freeway network in which the on-ramps are controlled and route guidance policies are applied.

Even though some notation and some definitions are common to the models described in the previous sections, all the notation of this model is described for the reader’s convenience. On the other hand, the repeated information is only briefly described, and the reader can find more details in the aforementioned sections.

The time horizon is divided into K time intervals, with sample time interval T [h], and C classes of vehicles are considered, with \(\eta ^c\) representing a conversion factor of vehicles of class c into cars, \(c=1, \ldots , C\). The freeway network is represented with a directed graph composed of M freeway links, O origin links, and N nodes. Each freeway link \(m=1, \ldots , M\) is further divided into \(N_m\) sections with length \(L_m\) [km] and number of lanes \(\lambda _m\). For each node \(n=1, \ldots , N\), \(O_n\) is the set of exiting links, and \(I_n\), \(\bar{I}_n\) are the set of entering freeway links and entering origin links, respectively. The sets of destinations reachable from freeway link \(m=1, \ldots , M\), from origin link \(o=1, \ldots , O\), and from node \(n=1, \ldots , N\) are denoted with \(J_m\), \(\bar{J}_o\), \(\bar{\bar{J}}_n\), respectively.

The main variables referring to the freeway links, for each vehicle class \(c=1, \ldots , C\), for each freeway link \(m=1, \ldots , M\), for each section \(i=1, \ldots , N_m\), and for each time step \(k=0, \ldots , K\), are:

  • \(\rho ^{c}_{m,i,j}(k)\) is the partial traffic density of class c in section i of link m at time instant kT with destination \(j\in J_m\) [veh\(^c\)/km/lane];

  • \(\rho ^{c}_{m,i}(k)\) is the traffic density of class c in section i of link m at time instant kT [veh\(^c\)/km/lane];

  • \(\rho _{m,i}(k)\) is the traffic density in section i of link m at time instant kT [PCE/km/lane];

  • \(v^{c}_{m,i}(k)\) is the mean traffic speed of class c in section i of link m at time instant kT [km/h];

  • \(q^{c}_{m,i}(k)\) is the traffic flow of class c leaving section i of link m during time interval \([kT, (k+1)T)\) [veh\(^c\)/h];

  • \(\gamma ^{c}_{m,i,j}(k) \in [0, 1]\) is the composition rate, i.e. the portion of the traffic flow of class c in section i of link m at time instant kT having destination \(j\in J_m\); it holds that \(\sum _{j \in J_m}\gamma _{m,i,j}^c(k)=1\).

The main variables referring to the origin links, for each vehicle class \(c=1, \ldots , C\), for each origin link \(o=1, \ldots , O\) and for each time step \(k=0, \ldots , K\), are:

  • \(d^{c}_{o,j}(k)\) is the partial origin demand of class c entering origin link o at time instant kT with destination \(j\in \bar{J}_o\) [veh\(^c\)/h];

  • \(d^{c}_{o}(k)\) is the origin demand of class c entering origin link o at time instant kT [veh\(^c\)/h];

  • \(l^{c}_{o,j}(k)\) is the partial queue length of class c at origin link o at time instant kT with destination \(j\in \bar{J}_o\) [veh\(^c\)];

  • \(l^{c}_{o}(k)\) is the queue length of class c at origin link o at time instant kT [veh\(^c\)];

  • \(\gamma ^{c}_{o,j}(k) \in [0, 1]\) is the composition rate, i.e. the portion of flow of class c leaving origin link o at time instant kT having destination \(j\in \bar{J}_o\); it holds that \(\sum _{j \in \bar{J}_o}\gamma ^c_{o,j}(k)=1\);

  • \(\theta ^{c}_{o,j}(k) \in [0, 1]\) is the portion of the demand of class c originating in origin link o at time instant kT having destination \(j\in \bar{J}_o\); it holds that \(\sum _{j \in \bar{J}_o}\theta _{o,j}^c(k)=1\);

  • \(q^{c}_{o}(k)\) is the traffic flow of class c leaving origin link o during time interval \([kT, (k+1)T)\) [veh\(^c\)/h];

  • \(q_{o}(k)\) is the total traffic flow leaving origin link o during time interval \([kT, (k+1)T)\) [PCE/h];

  • \(r_{o}^{\mathrm{{C}},c}(k)\) is the ramp metering control variable, i.e. the flow of class c, computed by the ramp metering controller, that should enter from origin link o during time interval \([kT, (k+1)T)\) [veh\(^c\)/h].

The variables referring to the nodes, for each vehicle class \(c=1, \ldots , C\), for each node \(n=1, \ldots , N\) and for each time step \(k=0, \ldots , K\), are:

  • \(Q^{c}_{n,j}(k)\) is the flow of class c entering node n during time interval \([kT, (k+1)T)\) with destination \(j\in \bar{\bar{J}}_n\) [veh\(^c\)/h];

  • \(\beta ^c_{m,n,j}(k) \in [0, 1]\) is the effective splitting rate, i.e. the portion of flow of class c present in node n at time instant kT which chooses link m to reach destination \(j \in \bar{\bar{J}}_n\); it holds that \(\sum _{\mu \in O_n}\beta ^c_{\mu ,n,j}(k)=1\);

  • \(\beta ^{\mathrm{{C}},c}_{m,n,j}(k)\) is the route guidance control variable, i.e. the splitting rate defined by a traffic controller, representing the portion of flow of class c present in node n at time instant kT which should choose link m to reach destination \(j \in \bar{\bar{J}}_n\);

  • \(\beta ^{\mathrm{{N}},c}_{m,n,j}(k)\) is the nominal splitting rate, i.e. the portion of flow of class c present in node n at time instant kT which would spontaneously choose link m to reach destination \(j \in \bar{\bar{J}}_n\).

The model parameters are: \(v^{\mathrm{f},c}_{m,i}\) is the free-flow speed [km/h] in section i of link m for class c, \(\rho ^{\mathrm{cr}}_{m,i}\) is the critical density [PCE/km/lane] in section i of link m, \(\rho ^\mathrm{max}_{m,i}\) is the jam density [PCE/km/lane] in section i of link m, \(c=1,\ldots ,C\), \(m=1, \ldots , M\), \(i=1,\ldots ,N_m\), \(q^\mathrm{{max},c}_o\) is the capacity of origin link o for class c, \(c=1,\ldots ,C\), \(o=1, \ldots , O\), \(\varepsilon ^{c}_{m,n} \in [0,1]\) is the compliance rate with the route recommendations for class c, \(c=1,\ldots ,C\), \(m=1, \ldots , M\), \(N=1, \ldots , N\), whereas \(\tau ^c\), \(\nu ^c\), \(\chi ^c\), \(\delta _{\text {on}}^{c}\), \(\phi ^c\) are model parameters present in the speed equation and specifically defined for class c, \(c=1,\ldots ,C\), and \(l^c\), \(m^c\) are parameters of the steady-state speed–density relation, \(c=1,\ldots ,C\).

The equations of the multi-class network model are obtained from those of the single-class case, i.e. (4.20)–(4.40), properly extended to consider multiple classes of vehicles. Starting from the freeway links, the dynamic equations for the partial traffic density and the mean speed are

$$\begin{aligned} \rho ^{c}_{m,i,j}(k+1)=\rho ^{c}_{m,i,j}(k)+\frac{T}{L_m \lambda _m}\left[ \gamma ^{c}_{m,i-1,j}(k)q^{c}_{m,i-1}(k)-\gamma ^{c}_{m,i,j}(k)q^{c}_{m,i}(k) \right] \end{aligned}$$
(4.56)
$$\begin{aligned} v^{c}_{m,i}(k+1) = v^{c}_{m,i}(k) + \frac{T}{\tau ^c} \left[ V^{c}\left( \rho _{m,i}(k)\right) - v^{c}_{m,i}(k) \right] \nonumber \\ +\,\frac{T}{L_m} v^{c}_{m,i}(k) \left[ v^{c}_{m,i-1}(k) - v^{c}_{m,i}(k) \right] - \frac{\nu ^c T \left[ \rho _{m,i+1}(k)- \rho _{m,i}(k) \right] }{\tau ^c L_m \left[ \rho _{m,i}(k) + \chi ^c \right] } \end{aligned}$$
(4.57)

where \(c=1, \ldots , C\), \(m=1,\ldots ,M\), \(i=1,\ldots ,N_m\), \(j\in J_m\), \(k=0,\ldots ,K-1\), and the following relations hold:

$$\begin{aligned} \rho ^{c}_{m,i}(k)=\sum _{j \in J_m}\rho ^{c}_{m,i,j}(k) \end{aligned}$$
(4.58)
$$\begin{aligned} \gamma ^{c}_{m,i,j}(k)=\frac{\rho ^{c}_{m,i,j}(k)}{\rho ^{c}_{m,i}(k)} \end{aligned}$$
(4.59)
$$\begin{aligned} \rho _{m,i}(k)=\sum _{c=1}^{C}\eta ^c\rho ^{c}_{m,i}(k) \end{aligned}$$
(4.60)

The traffic flow in (4.56) and the steady-state speed–density relation in (4.57) are given, respectively, by

$$\begin{aligned} q^{c}_{m,i}(k) = \rho ^{c}_{m,i}(k)v^{c}_{m,i}(k)\lambda _m \end{aligned}$$
(4.61)
$$\begin{aligned} V^{c}\left( \rho _{m,i}(k)\right) = v^{\mathrm{f},c}_{m,i} \left[ 1- \left( \frac{\rho _{m,i}(k)}{\rho ^\mathrm{max}_{m,i}}\right) ^{l^c}\right] ^{m^c} \end{aligned}$$
(4.62)

In (4.57), a term can be added to take into account the speed reduction due to merging flows coming from on-ramps. Considering a node in which an origin link o merges, in the first section of link m leaving that node there is a speed reduction given by

$$\begin{aligned} -\delta _{\text {on}}^{c} T \frac{v^{c}_{m,1}(k) q_{o}(k)}{L_m\lambda _m\left[ \rho _{m,1}(k)+\chi ^c\right] } \end{aligned}$$
(4.63)

A further additional term can be added to (4.57), to model the speed reduction due to weaving phenomena in case of lane reductions. By denoting with \(\varDelta \lambda \) the number of lanes dropped between link m and the following one, the speed reduction in the last section of link m is given by

$$\begin{aligned} -\phi ^c T\varDelta \lambda \frac{v^c_{m,N_m}(k)^2 \rho _{m,N_m}(k)}{L_m\lambda _m\rho ^\mathrm{cr}_{m}} \end{aligned}$$
(4.64)

The boundary conditions of (4.57) are the virtual downstream density at the end of the link \(\rho _{m,N_{m}+1}(k)\) and the virtual upstream speed at the beginning of the link \(v^c_{m,0}(k)\). If node n (at the end of link m) has more than one leaving link, the virtual downstream density can be computed as in (4.28), i.e.

$$\begin{aligned} \rho _{m,N_{m}+1}(k)=\frac{\sum _{\mu \in O_n}\rho _{\mu ,1}(k)^2}{\sum _{\mu \in O_n}\rho _{\mu ,1}(k)} \end{aligned}$$
(4.65)

In case node n (at the beginning of link m) has more than one entering link, the virtual upstream speed may be computed as

$$\begin{aligned} v^c_{m,0}(k)=\frac{\sum _{\mu \in I_n}v^c_{\mu ,N_\mu }(k) q^c_{\mu ,N_\mu }(k)}{\sum _{\mu \in I_n}q^c_{\mu ,N_\mu }(k)} \end{aligned}$$
(4.66)

Let us now consider the origin links. The dynamic evolution of the partial queue length is given by

$$\begin{aligned} l^{c}_{o,j}(k+1) = l^{c}_{o,j}(k) + T \left[ d^{c}_{o,j}(k) - \gamma ^{c}_{o,j}(k)q^{c}_{o}(k) \right] \end{aligned}$$
(4.67)

where \(c=1, \ldots ,C\), \(o=1, \ldots , O\), \(j=1, \ldots , \bar{J}_o\), \(k=0, \ldots , K-1\), and the following relations hold:

$$\begin{aligned} l^{c}_{o}(k)=\sum _{j \in \bar{J}_o}l^{c}_{o,j}(k) \end{aligned}$$
(4.68)
$$\begin{aligned} \gamma ^{c}_{o,j}(k) =\frac{l^{c}_{o,j}(k)}{l^{c}_{o}(k)} \end{aligned}$$
(4.69)
$$\begin{aligned} d^{c}_{o,j}(k) = \theta ^{c}_{o,j}(k)d^{c}_{o}(k) \end{aligned}$$
(4.70)

The traffic flow of class c leaving each origin link o, having m as downstream link, is given by

$$\begin{aligned} q^{c}_{o}(k) =\min \left\{ d^{c}_{o}(k)+\frac{l^{c}_{o}(k)}{T}, q^\mathrm{{max},c}_o, q^\mathrm{{max},c}_o \frac{\rho ^\mathrm{max}_{m,1}-\rho _{m,1}(k)}{\rho ^\mathrm{max}_{m,1}-\rho ^\mathrm{cr}_{m,1}}\right\} \end{aligned}$$
(4.71)

In case the considered origin link o is a controlled on-ramp, the traffic flow of class c leaving origin link o and entering link m is computed as

$$\begin{aligned} q^{c}_{o}(k) =\min \left\{ d^{c}_{o}(k)+\frac{l^{c}_{o}(k)}{T}, q^\mathrm{{max},c}_o, r_{o}^{\mathrm{{C}},c}(k), q^\mathrm{{max},c}_o \frac{\rho ^\mathrm{max}_{m,1}-\rho _{m,1}(k)}{\rho ^\mathrm{max}_{m,1}-\rho ^\mathrm{cr}_{m,1}}\right\} \end{aligned}$$
(4.72)

As for the node model, the total traffic flow entering node n with destination j is computed as

$$\begin{aligned} Q^{c}_{n,j}(k)=\sum _{\mu \in I_n} q^c_{\mu ,N_{\mu }}(k)\gamma ^c_{\mu ,N_{\mu },j}(k)+\sum _{o\in \bar{I}_n} q^{c}_{o}(k)\gamma ^{c}_{o,j}(k) \end{aligned}$$
(4.73)

The traffic flow exiting node n and entering the first section of link m is calculated as

$$\begin{aligned} q^{c}_{m,0}(k)=\sum _{j\in J_m} \beta ^c_{m,n,j}(k) Q^{c}_{n,j}(k) \end{aligned}$$
(4.74)

and the relative composition rate is given by

$$\begin{aligned} \gamma ^c_{m,0,j}(k)=\frac{\beta ^c_{m,n,j}(k) Q^c_{n,j}(k)}{q^c_{m,0}(k)} \end{aligned}$$
(4.75)

In presence of route guidance control actions, the splitting rates are computed according to the following relation:

$$\begin{aligned} \beta ^c_{m,n,j}(k)=(1-\varepsilon ^{c}_{m,n})\beta ^{\mathrm{{N}},c}_{m,n,j}(k) + \varepsilon ^{c}_{m,n} \beta ^{\mathrm{{C}},c}_{m,n,j}(k) \end{aligned}$$
(4.76)