Please solve using Simulink and make sure your output will look similar to the one given. A major application of simulat

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Please solve using Simulink and make sure your output will look similar to the one given. A major application of simulat

Post by answerhappygod »

Please solve using Simulink and make sure your output will looksimilar to the one given.
A major application of simulation is in modeling the trafficflow in large cities, in order to test different traffic lightpatterns before inflicting them on the real traffic. In thisexample we look at a very small part of the problem: how tosimulate the flow of a single line of traffic through one set oftraffic lights. We make the following assumptions (you can makeadditional or different ones if you like):
1. Traffic travels straight, without turning.
2. The probability of a car arriving at the lights in aparticular second is independent of what happened during theprevious second. This is called a Poisson process. This probability(call it p) may be estimated by watching cars at the intersectionand monitoring their arrival pattern. In this simulation we take p= 0.3.
3. When the lights are green, assume the cars move through at asteady rate of, say, eight every ten seconds.
4. In the simulation, we will take the basic time period to beten seconds, so we want a display showing the length of the queueof traffic (if any) at the lights every ten seconds.
5. We will set the lights red or green for variable multiples often seconds. Model the situation with a script file traffic.m whichcalls three function files: go.m, stop.m, and prq.m. Because thefunction files need access to a number of base workspace variablescreated by traffic.m, these variables are declared global intraffic.m, and in all three function files.
In this example the lights are red for 40 seconds (red = 4) andgreen for 20 seconds (green = 2). The simulation runs for 240seconds (n = 24).
Typical output looks like this:
1 R ****
2 R ********
3 R ***********
4 R **************
5 G **********
6 G *****
7 R ********
8 R *************
9 R ****************
10 R *******************
11 G **************
12 G **********
13 R **************
14 R *****************
15 R ********************
16 R ************************
17 G **********************
18 G ****************
19 R ******************
20 R **********************
21 R ************************
22 R ******************************
23 G **************************
24 G ***********************
From this particular run it seems that a traffic jam is buildingup, although more and longer runs are needed to see if this isreally so. In that case, one can experiment with different periodsfor red and green lights in order to get an acceptable trafficpattern before setting the real lights to that cycle. Of course, wecan get closer to reality by considering two-way traffic, andallowing cars to turn in both directions, and occasionally to breakdown, but this program gives the basic ideas.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply