A Guide to MATLAB for Beginners and Experienced Users

Everyone has had the experience of sitting in a traffic jam, or of seeing cars bunch up on a road for no apparent good reason. MATLAB and SIMULINK are good tools for studying models of such behavior. Our analysis here will be based on "follow-the-leader" theories of traffic flow, about which you can read more in Kinetic Theory of Vehicular Traffic, by Ilya Prigogine and Robert Herman, Elsevier, New York, 1971 or in The Theory of Road Traffic Flow,by Winifred Ashton, Methuen, London, 1966. We will analyze here an extremely simple model that already exhibits quite complicated behavior. We consider a one-lane, one-way, circular road with a number of cars on it (a very primitive model of, say, the Inner Loop of the Capital Beltway around Washington, DC, since in very dense traffic, it is hard to change lanes and each lane behaves like a one-lane road). Each driver slows down or speeds up on the basis of his or her own speed, the speed of the car directly ahead, and the distance to the car ahead. But human drivers have a finite reaction time. In other words, it takes them a certain amount of time (usually about a second) to observe what is going on around them and to press the gas pedal or the brake, as appropriate. The standard "follow-the-leader" theory supposes that
where t is time; T is the reaction time; u n is the position...