DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the...
-
Upload
doreen-daniels -
Category
Documents
-
view
216 -
download
0
Transcript of DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the...
![Page 1: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/1.jpg)
DynaTraffic – Models and mathematical prognosis
Simulation of the distribution of trafficwith the help of Markov chains
![Page 2: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/2.jpg)
2
What is this about?
• Models of traffic situations• Graphs:
– Edges, Vertices– Matrix representation– Vector representation
• Markov chains– States, transition probabilities– Special states: periodic, absorbing, or transient– Steady-state distribution
• Matrix vector multiplication
DynaTraffic help to understand and learn these concepts
![Page 3: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/3.jpg)
3
The goal: analysis of a traffic system
We are interested in this question:„How many cars are thereat a certain time on a lane?”
In order to be able to make statements about the development of a system, we need a model.I.e., first we build a model and then we control and observe this model.
![Page 4: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/4.jpg)
Mathematical prognosis step 1
Build a model of an everyday situation
![Page 5: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/5.jpg)
5
Photo from a side perspective
![Page 6: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/6.jpg)
6
Photo of the layout
© Google Imagery 2007
![Page 7: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/7.jpg)
7
Model of the layout, with cars
![Page 8: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/8.jpg)
8
Elements for the model without cars
Nodes
Arrows
What does your model look like?
![Page 9: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/9.jpg)
9
Model of the layout, without cars
Stop points nodesLanes edges
4
73
![Page 10: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/10.jpg)
10
Representation in DynaTraffic
4
73
- Characters to label lanes- Colored arrows and slightly different arrangement
![Page 11: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/11.jpg)
11
Models
• Why does one build models?– To better understand systems– Models are a useful tool to examine systems
• Definition of a model: A simplified representation used to explain the workings of a real world system or event.(Source: http://en.wiktionary.org/wiki/model)
• Mathematical Models try to capture the relevant parameters of natural phenomena and to use these parameters for predictions in the observed system.
![Page 12: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/12.jpg)
Mathematical prognosis step 2
Transformation of the model
![Page 13: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/13.jpg)
13
Why a transformation method?
We are concerned with traffic on single lanes and analyze the traffic with the help of a Markov model.
For that lanes must be vertices Transformation of the situation graph!
![Page 14: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/14.jpg)
14
Transformation recipe
Transformation of situation graph to line graph:
• Each edge become a vertex.• There is an edge between two vertices, if
one can change from one lane to the other in the traffic situation.
• Each vertex has an edge to itself.
![Page 15: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/15.jpg)
15
Transformation step a)
Each edge becomes a vertex.
![Page 16: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/16.jpg)
16
Transformation step b)
There is an edge between two vertices, if one can change from one lane to the other in the traffic situation.
![Page 17: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/17.jpg)
17
Transformation step c)
Each vertex has an edge to itself.I.e.: a car can remain on a lane!
![Page 18: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/18.jpg)
18
The good news concerningthis transformation
We do not need to do this transformation, it is already done in DynaTraffic. But we should understand it…
Situation graph Line graph to the situation graph
![Page 19: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/19.jpg)
Mathematical prognosis step 3
Define assumptions
![Page 20: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/20.jpg)
20
Define the process
• Every 10 seconds, each car takes a decision with a certain probability (so-called transition probability):– „I change to another lane“– „I remain on this lane“
• The realization of decisions is called a transition: cars change their state, if necessary.
![Page 21: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/21.jpg)
21
The transition graph
The transition probabilities areentered in the line graph Transition graph (= Markov chain)
![Page 22: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/22.jpg)
22
Our Markov chain
The vertices represent possible states, i.e., lanes on which a car can be.The edges show to which other lanes a car can change from each lane.
![Page 23: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/23.jpg)
23
Meaning ofthe transition probability?
„If there is a car onlane A now, it will inthe next transitionchange to lane Bwith a probabilityof 83%.
![Page 24: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/24.jpg)
24
Alternative representationof the transition graph
Transition graph Transition matrix
![Page 25: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/25.jpg)
25
How to read the transition matrix
From
To
![Page 26: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/26.jpg)
26
Empty entries inthe transition matrix?
If an edge does not exist, there is a 0 in the transition matrix at the corresponding entry.
![Page 27: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/27.jpg)
27
Summary:our traffic model
Photo Model with cars
Model without cars
Transition graphTransition matrix
![Page 28: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/28.jpg)
28
Summary:our traffic model
Photo Model with cars
Model without cars
Transition graphTransition matrix
Step 1: build a model of an everyday situation
Step 2
: tra
nsform
ation
of t
he m
odel
Step 3: define assumptions
![Page 29: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/29.jpg)
29
Demo DynaTraffic
![Page 30: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/30.jpg)
30
Our Markov chain again
The vertices represent possible states, i.e., lanes on which a car be.The edges show on which other vertices a car can change from one vertex, and with which probability this happens per transition.
![Page 31: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/31.jpg)
31
„Do a transition“?
To calculate how many cars there are going to be on a certain lane, one needs:
– The number of cars on the individual lanes.– The probabilities leading to the certain lane.
![Page 32: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/32.jpg)
32
How many cars are on lane Aafter the next transition?
Cars on individual lanes:A: 3 carsB: 4 carsC: 7 cars
Probabilities leading to lane A:A A : 0.17C A : 0.83
Calculation: 3 * 0.17 + 7 * 0.83 = 6.32 cars
![Page 33: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/33.jpg)
33
Probabilities for transitions
The required probabilities can directly be read from the transition matrix!
3 * 0.17 + 7 * 0.83 = 6.32 cars
![Page 34: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/34.jpg)
34
State vector
The number of cars per lane in the state vector notation
![Page 35: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/35.jpg)
35
Calculate transitions
As seen: Multiplication of the first row of the transition matrix with the current number of cars on the first lane (= second entry of the state vector) gives the new number of cars on the first lane.
![Page 36: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/36.jpg)
36
Calculate transitions compactly
With a matrix vector multiplication a transition can be calculated at once for all lanes!
![Page 37: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/37.jpg)
37
Matrix vector multiplication
+ + + + =
![Page 38: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/38.jpg)
38
Properties of transition graphs
Based on the transition probabilities, certain states of a transition graph can be classified. States can be absorbing, periodic, or transient.There are further steady-state distributions and irreducible transition graphs.
![Page 39: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/39.jpg)
39
Absorbing state
A state which has no out-going transitionwith positive probability
Over time all cars conglomerate there!
Where does this happen with real traffic?- Junkyard- dead-end one-way street ;-)
![Page 40: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/40.jpg)
40
Periodic states
States take periodically the same values
Traffic oscillates between certain states.
Where are such streets in everyday life?- e.g. between work and home
![Page 41: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/41.jpg)
41
Transient state
A state to which a care cannever return.
![Page 42: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/42.jpg)
42
Irreducible transition graph
Each state is reachable from every other state.
![Page 43: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/43.jpg)
43
Is the following graph irreducible?
No! (State D is not reachable from every other state!)
Which transition probabilites couldbe changed in order to make this graph ireducible?
![Page 44: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/44.jpg)
44
Properties of the transition matrix
Column sum = 1: stochastic matrix
Column sum ≠ 1:
Column sum < 1:total number of cars goes toward 0
Column sum > 1:total number of cars grow infinetly
![Page 45: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/45.jpg)
45
Steady-state distribution
If a transition graph is irreducible and does not have periodic states, then the system swings into a steady-state distribution, independently of the initial state.
![Page 46: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/46.jpg)
46
Notation of transition probabilities
„The probability to change fromvertex A to vertex B is 10%”
P(A, B) = 0.1
![Page 47: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/47.jpg)
47
Summary
Properties of states:– Periodic: Cars move to and fro.– Absorbing: All cars are finally there.– Transient: A car never returns there.
Transitions graphs can be irreducible: Cars can change from every state to every other state.
Distributions can be steady-state: the system has swung into.
![Page 48: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/48.jpg)
48
Models and their limitations
Lanes can hold a infinitely large number of cars in our model. This is not realistic!
Therefore:– Simulation stops, of > 2000 cars on a lane.– In the upper-limit mode a individual upper limit
(< 2000) can be defined per lane.
![Page 49: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/49.jpg)
49
The upper-limit mode
Possible application: Different parking areas. Cars should fill the parking areas C, D, and E in this order.
![Page 50: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/50.jpg)
50
Layout of parking areas in DynaTraffic
Upper limits of lanes are displayed
![Page 51: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/51.jpg)
51
Process upper-limit:lane C reached its capacity
Set all edges incident to C to 0. No more cars should arrive.
This is not a stochastic matrix any more! Columns must be normalized.
![Page 52: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/52.jpg)
52
Process upper-limit:lane C is unlocked again
Original row of the lane is reestablished Only outgoing edges are reestablished:
This is ok for all vertices. Normalize column sum.
![Page 53: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/53.jpg)
53
What is this about?
• Models of traffic situations• Graphs:
– Edges, Vertices– Matrix representation– Vector representation
• Markov chains– States, transition probabilities– Special states: periodic, absorbing, or transient– Steady-state distribution
• Matrix vector multiplication
DynaTraffic help to understand and learn these concepts
![Page 54: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/54.jpg)
54
Summary
We model and analyze a traffic system with the help of Markov chains.– How does the traffic distribution evolve?– Does the system swing into?
Like this we can make predictions about the system based on our Markov model!
![Page 55: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/55.jpg)
55
DynaTraffic
Situationgraph
Transitiongraph
Statestatistics
Transition matrix& state vector
Control of transitions
![Page 56: DynaTraffic – Models and mathematical prognosis Simulation of the distribution of traffic with the help of Markov chains.](https://reader035.fdocuments.in/reader035/viewer/2022062715/56649d9e5503460f94a89271/html5/thumbnails/56.jpg)
56
Demo DynaTraffic