# A Microscopic On-Ramp Model Based on Macroscopic Network Flows
## 2 Methods
### Data-Driven Macroscopic Junction Model  
The macroscopic model we consider builds on the approach in [15]. Therein, a junction model has been introduced that relies on vehicle trajectory data. We describe the main idea of the model in this section, and we refer to [15] for a more detailed description. The model captures the scenario of an on-ramp on a motorway, which can be classified into the following three segments: (1) the entry lane allowing vehicles to enter the motorway, (2) the stretch of motorway before vehicles from the entry lane can enter, and (3) the stretch of motorway at which vehicles from the on-ramp enter or have entered the freeway. Segments 2 and 3 amount to a short stretch, at which no further on-ramps or exits are located, corresponding to the previously described dataset in which these segments have a total length of approximately 300 m. The segments are shown in Figure 2 (bottom).  
In the macroscopic model description, no distinction between the individual lanes within the segments is made (the on-ramp consists of a single lane, while both segments 2 and 3 cover three lanes). At each segment, the traffic is governed by the Lighthill-Whitham-Richards (LWR) model  
\[\rho_{t}+(\rho v_{s}(\rho))_{x}=0, \tag{1}\]  
which describes the time and space dependent traffic density by means of a partial differential equation [5]. In our application, only a single space variable was considered. From the trajectory data, vehicle numbers were counted in fixed control volumes, and their average velocities were computed, which allowed us to fit the parameters \(v_{\text{max}}^{s}\) and \(\rho_{\text{max}}^{s}\) of the Greenshields fundamental diagram  
\[v_{s}(\rho)=v_{\text{max}}^{s}\bigg{(}1-\frac{\rho}{\rho_{\text{max}}^{s}} \bigg{)} \tag{2}\]  
for each of the three segments, i.e., for \(s=1,2,3\). As both the LWR model and the Greenshields fundamental diagram have been found to be limited in fitting time-and-space-dependent vehicle densities on motorways, we emphasize that in our overall framework, they were not used to predict the tempo-spatial behavior of all vehicles but to derive further information on the interaction between vehicles on different segments of the on-ramp. The model assumes that the three segments meet, and therefore, the traffic densities couple at a single fixed spatial point. The coupling is modeled by means of a Riemann solver  
\[RS:(\rho_{0}^{1},\rho_{0}^{2},\rho_{0}^{3})\mapsto(Q_{0}^{1},Q_{0}^{2},Q_{0}^{ 3}) \tag{3}\]  
that maps densities adjacent to the junction to coupling fluxes that govern the behavior at the junction. In numerical simulations, the Riemann solver is applied to trace data at a given time t in order to compute boundary fluxes at the time \(t+\Delta t\). A plethora of such coupling models has been evaluated; for simplicity, we focus in this work on the flow maximization approach [35], which maximizes the flux at the junction while assuring that both Kirchhoff conditions, as well as the demand and supply conditions [36], which depend on the fundamental diagrams corresponding to the three segments, hold. These conditions ensure mass conservation at the junction. The coupling model includes additional parameters that have been estimated using the traffic data and numerical simulations. The latter has been conducted using an adapted Lax-Friedrichs scheme. As the model has been originally calibrated to the same on-ramp data that are considered in this work, it was used here with all estimated parameters as the basis for a novel microscopic ramp model.