Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Computer Exercise 1

CIVL4450 Traffic Flow Theory and Emerging Technologies

Due Date: 11/09/2023, Tuesday 16:00

Computer Exercise 1 will build on the cell transmission model that we started developing in the tutorial session in Week 6. Please refer to the tutorial document and the provided

Python script for further details. Your task is to make changes in the simulation model to capture the changes defined below and answer the below questions.

1.   Please complete the tutorial exercise, and report the changes you have made in the script (report only the lines in the Python script where it is noted ### PLEASE

COMPLETE ###’). [2 marks]

2.   Calculate the total time spent in the network including the virtual queue. Total time

spent is TTS = T ∑k(k)=0 N(k), where T is the length of the time step, K is total

number of time steps, and N(k) is the number of vehicles in the system at time step k. Note that N(k) should also include the vehicles in the virtual queue. Pleaseadd     the piece of code you have used to make the calculation. [3 marks]

Hint1: You can use the np.sum() or ndarray.sum() functions to calculate the sum of array elements.

Hint2: You have the density values which you can convert to number of vehicles in a cell.

3.   Plot flow vs. density values in cells 2 and 3. Compare the resulting plots with the triangular fundamental diagram that was assumed initially. Do you observe

discrepancies between the triangular and observed fundamental diagrams? If so, please discuss what might be causing the discrepancies. [2 marks]

Hint: Consider using ax.scatter() for density-flow measurements and ax.plot() for the triangular FD relation.

4.   Transport authorities plan to build a new on-ramp that will be located in cell 4 of the highway (in Figure 2 of the tutorial document). The on-ramp demand in the initial

scenario is expected to be split equally between the two on-ramps. Please make

changes in the script and calculate the new travel time spent including the virtual queues. Please report the lines that you remove and add to the script. Do you

recommend the infrastructure upgrade based on the simulation results? [3 marks]

To submit your report, please goto Blackboard > Assessment > Computer Exercise 1

Please copy and paste the lines from your script in a word document (if necessary) and submit a single file that answers the above questions.