Traffic modeling traffic flow matlab analysis December ’14: graphs & report This is a traffic model I made by treating the cars on it as a fluid, rather than as individual things (called a “continuum approximation”). Like any other fluid, we know that cars tend to go faster when there are fewer cars around, and slower when there are more (less dense fluids are faster than more dense fluids). However, the way in which cars tend to slow down is varied and potentially very weird. My code modeled flow around a 10 km circumference track to approximate traffic on a stretch of highway, and initial traffic density was determined randomly for each point on the road, centered around a particular preset value. The few parameters of traffic density, rate of car flow, rate of acceleration, maximum speed, maximum traffic density supported by the road, and most importantly, initial traffic density, drastically affected the behavior of traffic. If initial traffic density was well below the “carrying capacity” of the road, the random spikes in traffic would quickly diffuse and traffic would assume an evenly spread distribution. However, for greater values of initial traffic density, the initial spikes would grow larger and larger, eventually settling in to a pattern of regular emissions of cars in quick bursts, which are then immediately slowed by the next peaked jam. Depending on these values, there appears no limit to possible patterns- I’ve seen traffic densities travel against the direction of traffic, those strange pulsating sporadic swells, and converging jams. I used a periodic boundary condition to properly model a circular track, and had to use several special cases in my for loops to ensure that they used the right indices (like using the right-most value to compute the left-most). I used given formulas to relate traffic density and traffic flow rate and their derivatives to Euler Forward time step through my time and space loops. Changing the parameters all seemed to have pretty predictable effects, with the notable exception of initial traffic density. The difference between initial traffic density and the maximum traffic density of the road would lead to all kinds of unexpected behavior, as described in paragraph 2. There are a couple main categories for what you’ll see with depending on initial conditions: For initial traffic densities below or even slightly above the maximum, traffic will quickly diffuse, and the plot of position vs density will approach flatness. For initial traffic densities much higher than the maximum, spikes will become more and more pronounced, and cars will move to the right from one jam to the next. Making traffic density higher or lower as long as its above a certain point will not affect the overall behavior of the traffic. However, we do see the number of spikes increasing as initial traffic density increases. For both of these possibilities, the traffic density will sometimes appear to move forwards, sometimes appear to move backwards, and sometimes stagnate. Above is a graph of just one set of initial conditions– if you want to see more, contact me for my matlab code! In summary, this project was really cool in helping me understand what plays an unfortunately large part in my life: traffic. It also showed that otherwise difficult to comprehend systems can be understood using relatively simple methods, and that the same tools and models that represent temperature diffusion or other seemingly separate phenomena can be used to demonstrate the laws of man-made things like traffic, too. It was initially a big step for me to understand how exactly to extend what we had been learning to this problem, but once I did, the rest came relatively easily, and quickly divulged all kinds of traffic secrets.