# Macroscopic Traffic-Flow Modelling Based on Gap-Filling Behavior of Heterogeneous Traffic
## 4 Numerical Analysis  
Partial Differential Equations (PDEs) having a hyperbolic nature may result in shock-waves. Therefore, these systems of equations must be approximated by using Finite Volume Methods (FVMs) [34]. One of these methods is the Roe's Scheme. In Roe's Scheme, the models are first written in conservation form. Since this research numerically simulates both the PW and the proposed models, these models can be written in conservation form, as follows:  
PW model:  
\[\left(\rho\right)_{t}+\left(\rho v(\rho)\right)_{x} \tag{21}\]\[\left(\rho\upsilon\right)_{t}+\left(\rho\upsilon^{2}+C_{0}^{2}\rho\right)_{x}= \rho\frac{\upsilon(\rho)-\upsilon}{\tau} \tag{22}\]  
Proposed model:  
\[\left(\rho\right)_{t}+\left(\rho\upsilon(\rho)\right)_{x} \tag{23}\]  
\[\left(\rho\upsilon\right)_{t}+\left(\rho\upsilon^{2}+\frac{l^{2}\sqrt{2\pi}}{ t^{2}}\rho\right)_{x}=\rho\frac{\upsilon(\rho)-\upsilon}{\tau} \tag{24}\]  
The generalized conservation form is given as:  
\[u_{t}+f(u)_{x}=S \tag{25}\]  
where \(u\) is a vector of traffic variables, \(f(u)\) is a vector of function of traffic variables, and \(S\) is a source term. Initially, the source term is assumed to be zero, i.e., there is no relaxation. Therefore, Equation (25) can also be written as follows:  
\[\frac{\partial u}{\partial t}+A(u)\frac{\partial u}{\partial x}=0 \tag{26}\]  
where \(A(u)\) is known as the Jacobian matrix. The vectors of the PW and proposed models are presented in Table 2.  
where \(e_{1,2}\) are the eigen vectors of the corresponding models. According to Roe's Scheme, the average velocity at the boundaries or edges of the cells is given as follows:  
\[v=\frac{\sqrt{\rho_{2}}\upsilon_{2}+\sqrt{\rho_{1}}\upsilon_{1}}{\sqrt{\rho_{2 }}+\sqrt{\rho_{1}}} \tag{27}\]  
Furthermore, the average density at the boundaries or edges of cells is given as follows:  
\[\rho=\sqrt{\rho_{2}\rho_{1}} \tag{28}\]  
The generalized approach of Roe's Scheme is to divide the entire road segment into cells depending upon the road step, assuming that the total length of the road is \(x\). Then the number of cells is given as \(N=x/dx\), where \(dx\) is the road step. The number of edges or boundaries of these road segments is equal to \(N+1\). The total time of simulation is \(T\), and the number of time steps is \(T/dt\), where \(dt\) is the time step. At the start, initial conditions for traffic density, as well as velocity, are assigned to each cell. Subsequently, the Jacobian matrix is approximated at the boundaries or edges, using the Roe's Scheme. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Vectors** & **PW Model** & **Proposed Model** \\ \hline \(u\) & \(\left[\begin{array}{c}\rho\end{array}\right]\) & \(\left[\begin{array}{c}\rho\end{array}\right]\) \\ \(f(u)\) & \(\left[\begin{array}{c}\rho\upsilon\end{array}\right]\) & \(\left[\begin{array}{c}\rho\upsilon\end{array}\right]\) \\ \(\rho\upsilon^{2}+C_{0}^{2}\rho\right]\) & \(\left[\begin{array}{c}\rho\upsilon\end{array}\right]\) \\ \(S\) & \(\left[\begin{array}{c}0\end{array}\right]\) & \(\left[\begin{array}{c}0\end{array}\right]\) \\ \(\rho\frac{\upsilon(\rho)-\upsilon}{\tau}\) & \(\left[\begin{array}{c}0\end{array}\right]\) & \(\left[\begin{array}{c}\rho\frac{\upsilon(\rho)-\upsilon}{\tau}\end{array}\right]\) \\ \(A(u)\) & \(\left[\begin{array}{c}0\end{array}\right]\) & \(\left[\begin{array}{c}1\\ C_{0}^{2}-\upsilon^{2}\end{array}\right]\) & \(\left[\begin{array}{c}0\end{array}\right]\) & \(1\) \\ \(e_{1,2}\) & \(\left[\begin{array}{c}1\\ v\pm C_{0}\end{array}\right]\) & \(\left[\begin{array}{c}1\\ v\pm\frac{\frac{\
u(\sqrt{2\pi}}{\mu}}{\mu}\end{array}\right]\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Vectors of the PW and proposed models.