Switch to graphical version (better pictures & formulas)

Go to University of Toronto Mathematics Network Home Page

Details on The Mathematical Model Used

Read about the Competition this simulation was originally designed for

Lane Lane Lane Lane Lane Lane /\ 5 | | | 6 7 | | | 8 9 | | |10 /\ || ||| | |/\ ||| | |/\ ||| | |/\ || 20 m North <- \/| | ||| \/| | ||| \/| | ||| \/ Lane 1 -------- -------- -------- -------- -------- A -------- B -------- C -------- Lane 2 -------- -------- -------- -------- -> | | | | | | | | | /\ | | | | | | | | | || 32 m <- | | | | | | | | | \/ Lane 3 -------- -------- -------- -------- -------- D -------- E -------- F -------- Lane 4 -------- -------- -------- -------- -> | | | | | | | | | /\ | | | | | | | | | || 20 m <------>| | |<------>| | |<------>| | |<------> \/ 72 m 72 m 72 m 72 mEach road has two lanes, one each direction. The lanes are each 4 metres wide (so each road is 8 metres wide). All cars travel straight ahead; none try to turn. For convenience, we've numbered the lanes from 1 to 10 and labelled the lights A through F.

We assume traffic moves according to a simple mathematical model (follow the link for more information). The relevant parameters are the number of cars per minute d[1], ..., d[10] trying to use each lane, the speed limit c, two numbers l and L that control how cars tend to space themselves out, and the timings of the traffic lights. In this simulation, you can set the values of any or all of these parameters and watch what happens. As well as a graphical display, you'll see what the average speed of the cars is as a percentage of the speed limit: a measure of how effective your light timings are at keeping the traffic moving!

You can run the simulation in any one of the following ways:

- Work with a pre-defined traffic density scenario. You can program the lights any way you like. See if you can keep the traffic flowing smoothly and minimize the waiting time of the cars. The computer will keep track of high scores, so you can compare your efforts against those of others! This form of the simulation goes hand in hand with Part III of the competition this simulation was designed to accompany.
- Choose a pre-programmed scenario that lets you watch what happens as a line of cars starts moving when a light turns green. This form of the simulation goes hand in hand with Part II of the competition, which is a challenge to figure out mathematically how long it takes the line to get moving and whether or not slow acceleration is to blame when you're kept waiting at the back of the line. With the simulation, you can test out your mathematical predictions for different traffic behaviour.
- Completely customize the simulation. You can decide on the traffic patterns as well as the light timings, and watch what happens. This can be a useful test of your reasoning in Part I of the competition.

In each of the scenarios, the basic traffic behaviour is the same: c=40, l=4, and L=20 (see the mathematical model for what these mean), and there's no limit to how fast cars can accelerate. The difference is in the numbers d[1], ..., d[10]: the number of cars per minute trying to use each lane.

Scenario 1.(d[1], ..., d[10) = (10, 5, 5, 10, 15, 10, 8, 8, 5, 10)Scenario 2.(d[1], ..., d[10) = (5, 15, 2, 15, 2, 10, 1, 8, 10, 5)Scenario 3.(d[1], ..., d[10]) = (7, 20, 15, 15, 12, 6, 10, 10, 2, 12)

You may also want to make the lights turn green at different times, so that a lane with heavy traffic can encounter all green lights. The scenario begins just as light A starts its east-west green cycle. To stagger the lights, you can specify how far into the scenario lights B through F begin their east-west green cycle. We'll call these numbers B0 through F0. For example, setting B0 = 15 means that light B will begin an east-west green cycle 15 seconds after the start of the scenario. Setting B0 = -15 means that light B started an east-west green cycle 15 seconds before the start of the scenario.

Choose the scenario you want from the popup menu above, and enter the values for Aew, Ans, ..., Few, Fns, B0, ..., F0 that you think will lead to the smallest average waiting time (greatest average speed) for cars over a 10-minute period. (You may want to refer back to the map to see where each of the ten lanes is located relative to the six lights). Then select "Start Simulation". You'll see empty roads at the start of the ten-minute period, and you can advance the time by amounts you choose. Once you've advanced the time all the way to ten minutes, you will see what the average speed of the cars was under your timings and how that compares to the previous high score. Can you set a new high score?

In this simulation, you can choose the values for the three basic parameters c, l, and L in the mathematical model we are assuming the traffic follows. You can also decide how many seconds S it takes for the lead car to accelerate to full speed; leave this at zero if you want the lead car to be able to accelerate infinitely fast. You'll probably be surprised at how long it takes the line to get moving even when this number is set to zero (and less inclined to blame the reaction time of the cars in front of you next time you're kept waiting!)

Once you've chosen value for c, l, L, and S (or you can just leave them at their defaults if you like), select "Start Simulation". You'll see empty roads at the start of the simulation. Then select "advance simulation by 120 seconds"; during this period, eastbound cars will line up at red light B, and red light B will just have turned green. Then keep advancing the simulation at 1-second intervals, seeing how long it takes cars far back in the line to get moving.

This part of the simulation was designed to accompany Part II of the competition, which is a challenge to find mathematical formulas for how long it takes cars far back in the line to get going. You can use the simulation to see how accurate your mathematical predictions are.

This page last updated: April 12, 1997

Original Web Site Creator / Mathematical Content Developer: Philip Spencer

Current Network Coordinator and Contact Person: Joel Chan - mathnet@math.toronto.edu

Navigation Panel: Graphical Version | U of T Math Network Home | Model | Competition