1. Introduction
    1. Purpose
    2. The purpose of this report is to outline the operation of C++ computer language to develop a program that models the flow of traffic through a traffic control station (intersection with stoplight). The calculational technique adapted for this computer program describes the movement of vehicular traffic through a single control station. The mathematical model is a fundamental differential equation. The equation evaluates the rate of change of the number of vehicles at the control station as a function of stop light action, arriving vehicles, and by making selected assumptions for the input parameters, the rate of vehicles leaving the control station is then determined. The final form used to evaluate the rate of vehicle movement, is an exponential function that is evaluated using time. Time is the length of stop light action, as a variable from which the outflow of traffic through the control station is determined; this is the desired information. A straightforward computer model, using C++ language and based on the solved differential equation, describes the movement of vehicles into and through the stoplight.

      Although not included as part of the final flow control model, this program is expected to be adaptable to a series of traffic control stations (stoplights) by using the output of one station as the input to the following station. With increased traffic flow, comes increased traffic congestion. Clearly with increased traffic flow, comes increased traffic congestion and a higher level of computer model for

      evaluating traffic flow for these complex conditions is required. This program provides a basis for further evaluation.

    3. Computer Program

C++ computer-programming format is used to develop the model for evaluation of traffic flow through a given area, such as a traffic stop light controlled intersection. The criterion for the traffic flow model is to describe the control of traffic exiting a control station (intersection) and monitoring the traffic entering the intersection. Specifically the model evaluates the average velocity of traffic arriving at the intersection and this data is used as input to determine the traffic flow into the intersection and subsequently exiting the intersection. The equation used to model the control of traffic through the intersection is based on a differential equation (See Appendix A) that uses an assumed speed for the vehicles arriving and a uniform spacing between vehicles (entering and leaving). The solution of the differential equation is an exponential function that is used in the computer program. Also, a random number generator was written to produce random velocities for the vehicles to be exiting the traffic control station.

 

 

 

 

 

 

 

2.0 Problem Statement

2.1 Problem Statement

A computer program that models the flow of traffic through a single control station is needed to provide a bases for modeling the flow of traffic through a specific area (which consists on several control stations). By defining the following parameters:

it is possible to create a computer-controlled stoplight. This program, although not done

in this report, is adaptable to a number of areas with high traffic congestion.

 

 

 

 

 

 

 

 

3.0 Method of Solution

3.1 Mathematical Model

The computer program developed to describe the control of traffic through a control station is composed of three major functions. The first function models the vehicles entering the control station and is based on the following input parameters:

The first function, based on these input parameters, calculates the following:

This information is then put into a table (See Appendix B).

The second function of the program calculates the following:

A third function of the program is a random number generator that selects a specific speed from the range of values determined in the second part of the program thereby ensuring that the calculation is not biased. The solution of the differential equation that describes the change of vehicles in the control station results in an exponential function. The equation calculates the number of cars that pass through a control station during a given amount of time.

The equation is as follows:

C=C0 e( (vin / x) – ( vout / d) *t)

The input parameters are as follows:

· C is the number of cars that can travel through the light

· C0 is the number of cars entering the light

· e is the natural exponential base

· vin is the velocity of the cars entering the light

· vout is the velocity of the cars exiting the light

· x is the distance between the front bumpers of the cars entering the light

· d is the distance between the front bumpers of the cars exiting the light

· t is the time step variable

 

    1. Computational Methods

The first program calculates the total amount of time that is takes a vehicle to pass through a traffic control station by continually adding the time steps together. Each time step is a set length, so the program simply adds the length of the current time step tot he previous time step. The speed of the vehicles is found by multiplying the total time at a given time step, by constant acceleration. The program has been set to stop increasing the speed once the speed limit has been reached. The program then reads the speed as a constant maximum speed. The average velocity is calculated by adding the speed at a given time step to the speed of the previous time stop and dividing the sum by two. The velocities are then placed into an array that is used in the second program. The distance the vehicle travels is calculated by multiplying the actual time step by the sum of the velocity in that time step and the distance traveled in the previous time step. All of the information that is calculated in this program is then displayed in a table.

The second program operates on some of the information that is found in the first program. The velocities from the first program play a key role in the operation of the second program. First of all, the velocity array is set as the velocity of the cars entering the traffic control station. Each velocity is then divided by the distance that was set as the distance between the front bumpers of the incoming vehicles. A random number generator then calculates random velocities for the vehicles exiting the traffic control station. Each of these velocities is also divided by a set following distance. The difference of this answer and the previous answer (entering velocity divided by the following distance) is found and the difference is then multiplied by the time that has lapsed. This process provides the number of vehicles that are entering the traffic control station for a given amount of time. This number of vehicles is then used to find the number of cars exiting the traffic control station. The rate of vehicles entering the light (velocity entering divided by the following distance) is multiplied by e to the power of the number of vehicles inside the traffic control station (the rate of cars entering the control station minus the rate of cars exiting, all multiplied by the time

(C=C0 e( (vin / x) – ( vout / d) *t) )), and is then subtracted from the rate of cars entering. For example, if the rate of cars entering was 4, and the number of cars in the station was 2, then the formula would look like this: 4-(4*e^(2)) and the answer would be –25.56. This implies that no cars are leaving the station.

To find the number of cars at the control station ( or stopped at the station) simply subtracts the number of cars leaving ( or rate of cars leaving) the station from the rate of cars entering the station.

 

4.0 Results

4.1 Calculations

The computer program will calculate and output:

It is concluded that the faster the speeds of cars leaving the control station, there will be fewer cars stopping completely at the control station. Therefore, more cars will pass through the control station.

4.2 Graphs

To see more graphs, see Appendix C.

 

 

 

    1. Comparisons

The above graphs are showing the speeds of the vehicles going into the control station, compared to the speeds of the vehicles going out of the control station.

 

 

 

 

 

 

 

 

5.0 Conclusions

5.1 Computer Program

The overall quality of the program is very good. The program performs all the expected calculations, and outputs the calculations in a very understandable format. A chart is outputted, which displays the speeds that the vehicles are traveling, and also the following distance between the vehicles. The rest of the output is the speed of the vehicle, and how many vehicles are arriving at the control station, and how many vehicles are leaving the control station. To see the computer program coding in its entirety, see Appendix D.

    1. Data

With the output of the computer program, the team was able to conclude that the longer a control station (traffic light) is green, and the faster the speeds of the vehicles, more vehicular traffic will pass through the control stations.

 

 

 

 

 

 

 

 

 

  1. Future Work

Though team members plan no future work at the moment, allotting for several different factors can continue this project. Future work would be to allow for more than one traffic control station, and pick a route in a certain city and find the most efficient way for traffic to flow through following the vehicles through each traffic control station (stoplight). By doing this, the most efficient way to travel through a city could be found by calculating how long the stoplights should remain green to allow more traffic to pass through.