程序代写代做代考 matlab Excel algorithm CALISTO

CALISTO
User’s Manual
Date: April 2016

Authors:
1. Anastasia Spiliopoulou
2. Ioannis Papamichail
3. Markos Papageorgiou
4. John Chrysoulakis
2

Contents
Table of figures ……………………………………………………………………………………………….. 4
1 CALISTO graphical user interface ………………………………………………………………… 6
2 Freeway network description ……………………………………………………………………… 7
3 Simulated traffic data ………………………………………………………………………………. 11
4 Other settings …………………………………………………………………………………………. 13
5 Traffic flow model selection ……………………………………………………………………… 15
6 Optimization algorithm selection ………………………………………………………………. 18
7 Operation selection …………………………………………………………………………………. 23
8 Execution and results ………………………………………………………………………………. 24
References ……………………………………………………………………………………………………. 27 Appendix A : Model calibration procedure…………………………………………………………29 Appendix B: Traffic data input file ……………………………………………………………………. 31
3

Table of figures
Figure 1 CALISTO application window. ……………………………………………………………….. 7 Figure 2 Application window; defining the freeway network description………………..8 Figure 3 Example of network description editor. …………………………………………………. 9 Figure 4 Application window; defining the simulated traffic data…………………………10 Figure 5 Example of defining the simulated traffic data editor……………………………..11 Figure 6 Application window; defining other settings………………………………………….12 Figure 7 Example of other settings editor. …………………………………………………………13 Figure 8 Application window; selecting the traffic flow model……………………………..15 Figure 9 Example of CTM parameters editor………………Error! Bookmark not defined. Figure 10 Example of METANET parameters editor…………………………………………….16 Figure 11 Application window; selecting an optimization algorithm……………………..17 Figure 12 Example of Nelder‐Mead parameters editor. ………………………………………19 Figure 13 Example of genetic algorithm parameters editor. ………………………………..20 Figure 14 Example of cross‐entropy method parameters editor…………………………..21 Figure 15 Application window; selecting an operation. ………………………………………. 22 Figure 16 Application window; execution. …………………………………………………………23 Figure 17 Example of output plots; best PI value over iterations. …………………………24 Figure 18 Example of optimal model parameters window. ………………………………….25 Figure 19 Example of output plots; time‐series of the real flow measurements and the model’s estimations of flow at various detector locations……………………………..26 Figure 20 Example of output plots; time‐series of the real speed measurements and the model’s estimations of speed at various detector locations. ………………………….27 Figure 21 Example of output plots; time‐series of the real density and the model’s estimations of density at various detector locations. ………………………………………….27 Figure 22 Model calibration procedure……………………………………………………………..30 Figure 23 Example of real mainstream flows sheet. ……………………………………………32 Figure 24 Example of real on‐ramps flows sheet. ……………………………………………….33 Figure 25 Example of initial mainstream flows sheet…………………………………………..35
4

5

1 CALISTO graphical user interface
CALISTO (CALIbrationS Tool) is a software tool that enables the calibration and validation of macroscopic traffic flow models for various freeway sites using real traffic data (see Appendix A for a description of the calibration and validation procedures for macroscopic traffic flow models). Figure 1 presents the application window of the software which contains the following basic elements:
— Freeway network description: this feature includes all the required information needed so that a freeway site is described adequately, such as the number of freeway links, the number of freeway on‐ramps and off‐ ramps, the number of detector stations etc.
— Traffic data: it contains information about the simulated data, such as the simulation step, the traffic measurements interval, the simulation duration, and other, as well as the specification of the traffic data input file.
— Other settings: it consists of some extra simulation features regarding the utilized performance index and the simulation outputs.
— Selection of the traffic flow model: one of the available traffic flow models can be selected and the corresponding model parameter values should be specified.
— Selection of the optimization algorithm: one of the available optimization methods can be employed to perform the calibration of the chosen traffic flow model, using particular algorithm parameters.
— Selection of the operation: two operations are available, either Calibration or Validation. The calibration aims at the estimation of the optimal model parameter values so that the model may represent the traffic conditions of a particular freeway site with the highest achievable accuracy. The validation, is usually carried out after the model calibration, and aims to test the validity of the produced model, thus the resulting model is applied to the same freeway site using different traffic data than the one used for its calibration.
— Execution (Run): the selected operation is executed taking into account all the introduced information.
6

Figure 1 CALISTO application window. 2 Freeway network description
The Freeway network description editor can be accessed by clicking on the first button of the application window (see Figure 2). Then, the network description editor appears, as shown in Figure 3. The properties to be defined are the following:
— Number of mainstream links: it is the number of mainstream freeway links.
— Number of on‐ramps: it is the number of on‐ramps included in the simulated
freeway stretch.
— Number of off‐ramps: it is the number of off‐ramps included in the simulated
freeway stretch.
7

Figure 2 Application window; defining the freeway network description.
— Number of detector stations: it is the number of available detector stations in the simulated freeway stretch.
— Number of lanes at the entrance: it is the number of lanes at the entrance of the simulated freeway stretch.
— Number of lanes at the exit: it is the number of lanes at the exit of the simulated freeway stretch.
— Number of sections per link: this table includes the number of segments for each freeway link.
— Links’ length: this table includes the length, in meters, of each freeway link.
8

Figure 3 Example of network description editor.
— Number of lanes per link: this table includes the number of lanes of each freeway link.
— On‐ramps: this table contains the location of the on‐ramps in the network. The on‐ramps’ names should be defined as well. Note, that the on‐ramps are considered to be located always at the first segment of a link, thus only the link number should be specified.
— Off‐ramps: this table contains the location of the off‐ramps in the network. The off‐ramps’ names should be defined as well. Note, that the off‐ramps are considered to be located always at the last segment of a link, thus only the link number should be specified.
9

— Detector stations: this table contains the detector station locations in the network. The detectors’ names should be defined as well. Note, that the detectors’ location is defined by both the link number and the segment number.
In the bottom of the editor window three different buttons – options exist:
— Load: loads a selected file and introduces the included data to the corresponding editor window fields.
Figure 4 Application window; defining the simulated traffic data.
10

Figure 5 Example of defining the simulated traffic data editor.
— Save: saves the data included in the editor window in a *.mat file.
— Close: closes the editor window and saves the included data in the current
workspace.
3 Traffic data
The Traffic data editor can be accessed by clicking on the second button of the main page (see Figure 4). The traffic data editor appears, and includes the following properties (see also Figure 5):
— Measurements interval: it is the interval of the traffic measurements in sec.
— Start time: it is the starting time of the simulated data (hh:mm:ss).
— End time: it is the ending time of the simulated data (hh:mm:ss).
— Select input file: click on the Select button to select the Excel file that includes
all the traffic data to be utilized. See Appendix B for a description on the structure of the traffic data input file.
11

Again, in the bottom of the editor window three different buttons – options exist:
— Load: loads a selected file and introduces the included data to the corresponding editor window fields.
Figure 6 Application window; defining other settings.
12

Figure 7 Example of Other settings editor.
— Save: saves the data included in the editor window in a *.mat file.
— Close: closes the editor window and saves the included data in the current
workspace.
4 Other settings
The Other settings editor can be accessed by clicking on the third button of the application window (see Figure 6). This editor includes the following properties:
— Simulation step: it is the simulation step of the model in sec (usually 5sec–15 sec).
— Performance index weights: the utilized performance index is calculated by the following equation:
􏹬􏹭 􏹮 􏹯􏹰 · 􏹱􏹲􏹳􏹴􏹰􏹵􏹶􏹷􏹸 􏹹 􏹯􏹸 · 􏹱􏹲􏹳􏹴􏹸􏹺􏹻􏹻􏹼􏹸
13

where RMSEflows and RMSEspeeds are the root mean squared errors of the real flow and speed measurements and the corresponding model estimations, respectively, and wf and ws are the corresponding error weights (see also Figure 7).
— Output settings: settings regarding the plotting of:
o The calibration progress: if ticked it plots the best performance index
value over iterations during the calibration procedure.
o The model estimations at the end of the simulation: if ticked it plots the time‐series of real flow, speed and density measurements and the corresponding model estimations at all detector locations at the end
of the calibration or validation procedure.
14

5
Figure 8 Application window; selecting the traffic flow model.
— Load: loads a selected file and introduces the included data to the corresponding editor window fields.
— Save: saves the data included in the editor window in a *.mat file.
— Close: closes the editor window and saves the included data in the current
workspace.
Traffic flow model selection
This version of the software includes the second‐order traffic flow model METANET (Messmer and Papageorgiou, 1990). However, the structure of the program is
15

modular enabling the addition of more discrete‐time state‐space models in the future.
The model parameters can be accessed by clicking on the “Model parameters” button. Note, that in case of calibration these parameters values correspond to the initial parameter set, while in case of validation these are the values of the resulted model.
Figure 9 Example of METANET parameters editor.
For METANET model, the parameters to be specified are the following (see also Figure 10):
16

— Number of links: the number of mainstream links, as defined in the Freeway network description editor.
— Number of FD groups: the number of different Fundamental Diagrams (FD) considered for the freeway network.
— Global parameters: the global model parameters are the following: o τ: a time parameter in sec.
Figure 10 Application window; selecting an optimization algorithm.
o ν: an anticipation parameter in km2/h. o δ: a merging parameter in h/km.
o φ: a lane‐drop parameter in h/km
17

o κ: a further model parameter in veh/km/lane
o vmin: the minimum speed in km/h.
Moreover, indicate, for each one of the above parameters, whether it should be considered as fixed, by selecting one of the options of the listbox located next to each parameter. If a parameter is defined as fixed, it will not be taken into account in the calibration procedure, and the assigned fixed value will be considered instead. Note, that in case of validation this information is not taken into account.
— Link assignment to an FD group: assign every freeway link to one of the listed FD groups, by ticking on the corresponding Link ‐ Group combination.
— FD parameters per group: define the parameter values of each FD group. In particular the parameters that need to be specified are:
o vf : the free flow speed in km/h.
o ρcr: the critical density in veh/km/lane. o a: a further parameter.
Again, indicate, for each one of the above parameters, whether it should be considered as fixed, by selecting one of the options of the listbox located next to each parameter.
In the bottom of the editor window three different buttons – options exist:
— Load: loads a selected file and introduces the included data to the corresponding editor window fields.
— Save: saves the data included in the editor window in a *.mat file.
— Close: closes the editor window and saves the included data in the current
workspace. .
6
Optimization algorithm selection
Three optimization algorithms are available in the current version of the software (see Figure 11). Namely, the Nelder‐Mead method, a genetic algorithm and the
18

cross‐entropy method. All three optimization methods are derivative free methods and are suitable for the calibration of macroscopic traffic flow models. The structure of the program is modular enabling the addition of more optimization algorithms in the future.
Depending on the algorithm that is selected some parameters need to be specified, by clicking on the Algorithm parameters button. In particular, if the Nelder‐Mead algorithm is selected, the following parameters should be defined (see also Figure 12):
— Tol. fun.: Termination tolerance on the performance index value. — Tol. x: Termination tolerance on the parameter vector values.
— Max. iter.: Maximum number of iterations allowed.
Figure 11 Example of Nelder‐Mead parameters editor.
More information on the method and its parameters can be found at http://www.mathworks.com/help/matlab/ref/fminsearch.html.
In the bottom of the editor window three different buttons – options exist:
— Load: loads a selected file and introduces the included data to the corresponding editor window fields.
— Save: saves the data included in the editor window in a *.mat file.
19

— Close: closes the editor window and saves the included data in the current workspace.
In case the genetic algorithm is selected, the following parameters should be defined (see also Figure 13):
— Population size: size of the population.
— Elite count: number of individuals in the current generation that they will
survive to the next generation.
— Crossover rate: fraction of the population of the next generation that is
created using crossover.
— Mutation rate: probability of a fraction of the vector entries of an individual,
for mutation, to be mutated. The selected entries will replaced by a random
number selected uniformly from the range of values for that entry.
— Tol. fun.: Termination tolerance on the performance index value.
— Generations: Maximum number of iterations allowed.
More information on the method and its parameters can be found at http://www.mathworks.com/help/gads/genetic‐algorithm‐options.html.
Again, at the bottom of the editor window a Load, Save and Close button exist.
Figure 12 Example of genetic algorithm parameters editor.
20

Figure 13 Example of cross‐entropy method parameters editor.
Finally, in case that the cross‐entropy method is selected, the following parameters should be defined (see also Figure 14):
— Population size: size of the population.
— Elite rate: percent of the elite solutions.
— Smth. parameter: a smoothing parameter.
— Tol. std.: Termination tolerance on the standard deviation of the probability
density function.
— Max. iter.: Maximum number of iterations allowed.
More information on the method and its parameters can be found in Ngoduy and Maher, 2012.
Again, at the bottom of the editor window a Load, Save and Close button exist.
21

Figure 14 Application window; selecting an operation.
22

Figure 15 Application window; execution. 7 Operation selection
Two operations are available in this software tool (see also Figure 15), namely the calibration and the validation:
— Calibration: calibrates the selected traffic flow model, using the selected optimization method, for the particular freeway network, using the defined traffic data.
— Validation: runs the selected traffic flow model, for the particular freeway network, using the defined traffic data.
23

Figure 16 Example of output plots; best PI value over iterations. 8 Execution and results
In order to execute the selected operation the user should click on the Run button (see Figure 16). If the selected operation is Calibration then the following results are obtained:
— Graph of the calibration progress over iterations as shown in Figure 17. This graph appears only if this is selected by the user (see Section 4).
— A window including the optimal model parameter values (see Figure 18). The user may save these optimal values for future use, by clicking on the Save button and then may close the window by pressing the Close button.
— Time plots of the real traffic measurements (flows, speeds and densities) and the corresponding model estimations for all detector locations (see Figures 19‐21). These plots appear only if this is selected by the user (see Section 4).
— *.mat files containing all the information included in the editors. In particular the following output files are obtained:
o Freeway_network_description.mat o Simulated_traffic_data.mat
o Other_settings.mat
24

Figure 17 Example of optimal model parameters window.
o METANET_parameters.mat o NM_parameters.mator
GA_parameters.mat or
CEM_parameters.mat (depending on the utilized algorithm).
— *.mat files containing the calibration output (optimal parameter vector;
performance index):
o NM_output.mat or
GA_output.mat or
CEM_output.mat (depending on the utilized algorithm).
25

— Simulation_Output.mat: which contains the model estimations at all segments of the freeway stretch.
— Performance_index.dat file containing the best performance index value. If the selected operation is Validation then the following results are obtained:
— Time plots of the real traffic measurements (flows, speeds and densities) and the corresponding model estimations for all detector locations (see Figures 19‐21). These plots appear only if this is selected by the user (see Section 4).
— *.mat files containing all the information included in the editors. In particular the following output files are obtained:
o Freeway_network_description.mat o Simulated_traffic_data.mat
o Other_settings.mat
o METANET_parameters.mat
— Simulation_Output.mat: which contains the model estimations at all segments of the freeway stretch.
— Performance_index.dat file containing the performance index value.
Figure 18 Example of output plots; time‐series of the real flow measurements and the model’s estimations of flow at various detector locations.
26

Figure 19 Example of output plots; time‐series of the real speed measurements and the model’s estimations of speed at various detector locations.
Figure 20 Example of output plots; time‐series of the real density and the model’s estimations of density at various detector locations.
References
Messmer, A., and M. Papageorgiou. METANET: A macroscopic simulation program for motorway networks. Traffic Engineering & Control, Vol. 31, No. 8‐9, 1990, pp.466‐470.
27

Ngoduy, D., and M. J. Maher. Calibration of second order traffic models using continuous cross entropy method. Transportation Research Part C: Emerging Technologies, Vol. 24, 2012, pp. 102‐121.
28

Appendix A : Model calibration procedure
The model parameter calibration (or parameter estimation) procedure aims at enabling a macroscopic traffic flow model to represent traffic conditions of a freeway network with the highest achievable accuracy. The estimation of the unknown model parameters is not a trivial task, since the system equations are highly nonlinear in both the parameters and the state variables. Consider that a macroscopic discrete‐time state‐space model is described by the following state equation,
x(k+1)= f[x(k),d(k),p] k=0,1,…,K−1 x(0) = x0
(A.1)
where k is the discrete time index; x stands for the state vector, d is the disturbance vector and p is the parameter vector. In particular, the state vector x includes the section densities and mean speeds, the external variable vector d consists of the origin speeds and inflows, the turning rates at bifurcations, and the downstream densities; and p includes the unknown model parameters that need to be specified.
If the initial state x0 is given and the external vector d(k) is known over a time horizon k=0,…,K−1, then the parameter estimation problem can be formulated as a nonlinear least‐squares output error problem which aims at the minimization of the discrepancy between the model calculations and the real traffic data by use of the following cost function,
1 K−1
J (p) = ∑⎡y(k) − ym (k)⎤2 (A.2)
K k=0 ⎣ ⎦
subject to (1); where y(k)=g[x(k)] is the measurable model output vector (typically consisting of flows and mean speeds at various network locations) and ym(k) includes the real measured traffic data (consisting of flows and speeds at the corresponding network locations). The model parameter values are selected from a closed admissible region of the parameter space, which may be defined on the basis of physical considerations. The determination of the optimal parameter set must be
29

performed by means of a suitable nonlinear programming routine, whereby for each choice of a new parameter vector p, the value of the performance index (PI) (A.2) may be computed by a simulation run of the model equations as shown in Figure 22.
Figure 21 Model calibration procedure.
After the calibration procedure, the resulting traffic flow models must be validated before their potential use in a real implementation. Model validation aims to ensure that the resulting model reflects reliably the traffic characteristic of the specific network, thus it may reproduce its typical traffic conditions. To this end, the model is applied to the same freeway site, albeit by using different data for the disturbance vector d and initial state x0, than the ones used for its calibration, and the model output y is compared to the corresponding real traffic data ym. In other words, the calibration procedure is carried out using real traffic data from a specific date, while for the validation procedure traffic data from different dates are used.
30

Appendix B: Traffic data input file
The real traffic data to be utilized should be included in an Excel file. In the first and the second sheet of the file (named “Real mainstream flows” and “Real mainstream speeds” respectively) the real mainstream flows (in veh/h) and the real mainstream speeds (in km/h) should be included, as shown in Figure 23 and Figure 24. The first column includes the time resolution (in hh:mm:ss), while the rest columns include the real traffic data for each detector location. As shown in Figure 23 and Figure 24 the first row includes the detector names. Note, that the detector names and the time resolution should match with the information included in the “Freeway network description” and “Traffic data” windows, respectively.
The real on‐ramp flows (in veh/h) and the real off‐ramp exit‐rates should be included in the third and fourth sheet, named “Real on ramp flows” and “Real off ramp exit rates” respectively (see Figure 25 and Figure 26). Again, the first column includes the time resolution (in hh:mm:ss), while the rest columns include the corresponding traffic data for each on‐ramp or off‐ramp respectively. Similar to the previous sheets, first row includes the on‐ramp or off‐ramp names. Again, the ramp names and the time resolution should match with the information included in the “Freeway network description” and “Traffic data” windows, respectively.
The fifth sheet, named “Boundary mainstream conditions” includes the traffic conditions at the upstream and downstream boundary of the network (see Figure 27). In particular the first column includes the time resolution (in hh:mm:ss), the second and third column the flow and speed measurements at the upstream boundary of the network and the fourth and fifth column the flow and speed measurements at the downstream boundary of the network. Note that, some traffic flow models may not need information from the upstream or downstream boundary of the network. However, the user should not leave this sheet empty.
Finally, the sixth and seventh sheet, named “Initial mainstream flows” and “Initial mainstream speeds, include the initial traffic conditions (flows and speeds) at all mainstream segments (see Figure 28 and Figure 29). Figure 28 presents an example
31

of the “Initial mainstream flows” sheet. It is observed that there is only one row, with as many cells as the total number of the segments included in all links of the examined stretch. Similar is the structure of the “Initial mainstream speeds” sheet (Figure 29).
Figure 22 Example of real mainstream flows sheet.
32

Figure 23 Example of real mainstream speeds sheet.
Figure 24 Example of real on‐ramps flows sheet. 33

Figure 25 Example of real off‐ramp exit rates sheet.
Figure 26 Example of boundary mainstream conditions sheet. 34

Figure 27 Example of initial mainstream flows sheet.
Figure 28 Example of initial mainstream speeds sheet.
35