# Analyzing Demand with Respect to Offer of Mobility
## 4 Model and Analyzer
### Modelling Mobility Demand  
The city users move for different motivations, for the resident commuters, work and study can be considered as two main motivations. The trips of resident commuters can be divided into two sets (see Figure 2). First, _Home to Work trips (H2W)_ which lead to study or workplaces. They usually start from home, in the morning. Furthermore, the commuters with private vehicles, usually park them in public parking spaces when the work or study places are located in restricted traffic zones, and then, start a _H2W_ trip from there to reach their destination, using the public means of transportation. Second, _Work to Home trips (W2H)_, which lead to home in the afternoon. They usually start from work or study places. Typically, the commuters, with private vehicles, who work or study in the restricted traffic zones start a _W2H_ trip (see Figure 3). This behavior has been observed in census data collected by Tuscany Region of all the inhabitants. Figure 3: Using public transport systems by the commuters with private vehicles who work or study in the restricted traffic zones. Figure 2: W2H and H2W trips. For a region \(R\) (Tuscany region for example), including a set \(L\) of locations, the (morning) demand ODM \(D_{|L|\times|L|}(mng)\) is defined by means of the matrix containing in cell \(D_{i,j}(mng)\), the total amount of outbound trips in \(H2W\). Likewise, the (afternoon) demand ODM \(D_{|L|\times|L|}(aft)\) is considered as the transpose of the demand matrix \(D_{|L|\times|L|}(mng)\) in the morning. That is, \(D(aft)=D^{(T)}(mng)\), where the operator \(T\) denotes the transpose, and the cell \(D_{i,j}(aft)\) describes the number of outbound trips in \(W2H\), from location \(l_{i}\) to \(l_{j}\). It is noted that the demand matrices \(D_{|L|\times|L|}(t)\) are defined considering all modalities in \(M\) and all mobility operators in \(\mathbb{O}\). Note that commuters who go to a given studying or working place during the morning time, usually return home during the afternoon time. Then, the number of outbound trips in \(W2H\) from location \(l_{i}\) to \(l_{j}\) is equal to the number of inbound trips in \(W2H\) to locality \(l_{j}\) from \(l_{i}\) (i.e., \(D_{i,j}(mng)=D_{j,i}(aft)\)). Such an assumption is primarily considered for residential commuters, and the model can be also applied to transitory flow since it depends on the collected data from different sources as mentioned in the previous description, and such data take into consideration the presence of tourists/events also. Commonly, residential commuters' flows are only considered during working days. In this case, a stationary/conservative behavior is defined, and it is applied to the model by means of Equations (2) and (3). For an area \(A\) (the city of Florence is an example) in region \(R\) of Tuscany Region including a set \(L^{\prime}\subset L\) of locations, the flow of commuters can be defined as the total number of the outbound trips in the morning \(Out(mng)\) and the inbound trips in the afternoon \(In(aft)\), respectively, from and to a given area \(A\). As defined in (2), \(Out(mng)\) is equal to \(In(aft)\) and it is evaluated by means of the sum of the total amount of the outbound trips in the morning from each location \(l\)\(e\)\(L^{\prime}\) to the all places in set \(L\). \[Out(mng)=In(aft)=\sum_{i=1}^{|L^{\prime}|}\sum_{j=1}^{|L|}D_{i,j}(mng) \tag{2}\]  
Analogously, we obtain (3). \[In(mng)=Out(aft)=\sum_{i=1}^{|L^{\prime}|}\sum_{j=1}^{|L|}D_{i,j}(aft) \tag{3}\]  
Without loss of generality, in the case of transitory flow involving a not stationary behavior, the model takes into account \(Out(mng)\) and \(In(aft)\) in Equation (2) and \(In(mng)\) and \(Out(aft)\) in Equation (3) which may be distinct from each other. The same solution applies for cases in which one may have unbalanced inflow/outflow for different reasons such as: football games that may provoke numerous arrivals by train, and fractioned departures in the following days, etc.