SlideShare a Scribd company logo
HOW MUCH TIME WILL BE USED FOR
DRIVING TO SCHOOL?
Ruo Yang
Winter 2015
Mathematical modelling
HOW DID I START?
1. Rush hours.
2. For different starting time t, it will costs a different time on the road
corresponding to t.
3. Different number of cars on the road at different starting time.
4. More cars costs more time for driving.
STRUCTURE
Input: Starting time
Road condition
(How many cars on the
road)
How many cars will
impacts my driving
Relation between
number of cars
who can impact
my drive and cost
of time
Output: cost of time
MODELLING
1. Difference equation model (Discrete in time).
2. Differential equation model (Continuous in time).
The core is finding the how many cars will impact driving for different starting time
THE ROAD TO UNIVERSITY
DIFFERENCE EQUATION
……….
S1
R1
F1
S2
F2
R2
R8
S9
F9
R9
I1 I2
I9
DIFFERENCE EQUATION
𝑆(𝑡)𝑖 > 0, 𝑖 = 1,2, … . . , 9 Represents how many cars on the road i at time t.
𝑅𝑖, 𝑖 = 1,2, … … , 9 Represents the percentage of cars go from ith road to i+1th road
after half minute
𝐹𝑖, 𝑖 = 1,2, … … , 9 Represents the percentage of cars stay in ith road after half
minute
𝐼(𝑡) > 0𝑖, 𝑖 = 1,2, … . . , 9, Represents how many cars will going to ith road from
outside every half minute.
DIFFERENCE EQUATION
∆𝑡 = ℎ𝑎𝑙𝑓 𝑚𝑖𝑛𝑢𝑡𝑒
𝑆 𝑡 + ∆𝑡 1 = 𝐼 𝑡 1 + 𝑅9 ∗ 𝑆 𝑡 9 + 𝐹1 ∗ 𝑆 𝑡 1
𝑆 𝑡 + ∆𝑡 2 = 𝐼 𝑡 2 + 𝑅1 ∗ 𝑆 𝑡 1 + 𝐹2 ∗ 𝑆 𝑡 2
𝑆 𝑡 + ∆𝑡 3 = 𝐼 𝑡 3 + 𝑅2 ∗ 𝑆 𝑡 2 + 𝐹3 ∗ 𝑆 𝑡 3
𝑆 𝑡 + ∆𝑡 4 = 𝐼 𝑡 4 + 𝑅3 ∗ 𝑆 𝑡 3 + 𝐹4 ∗ 𝑆 𝑡 4
𝑆 𝑡 + ∆𝑡 5 = 𝐼 𝑡 5 + 𝑅4 ∗ 𝑆 𝑡 4 + 𝐹5 ∗ 𝑆 𝑡 5
𝑆 𝑡 + ∆𝑡 6 = 𝐼 𝑡 6 + 𝑅5 ∗ 𝑆 𝑡 5 + 𝐹6 ∗ 𝑆 𝑡 6
𝑆 𝑡 + ∆𝑡 7 = 𝐼 𝑡 7 + 𝑅6 ∗ 𝑆 𝑡 6 + 𝐹7 ∗ 𝑆 𝑡 7
𝑆 𝑡 + ∆𝑡 8 = 𝐼 𝑡 8 + 𝑅7 ∗ 𝑆 𝑡 7 + 𝐹8 ∗ 𝑆 𝑡 8
𝑆 𝑡 + ∆𝑡 9 = 𝐼 𝑡 9 + 𝑅8 ∗ 𝑆 𝑡 8 + 𝐹9 ∗ 𝑆 𝑡 9
DIFFERENCE EQUATION
𝐹1 0 0 0 0 0 0 0 𝑅9
𝑅1 𝐹2 0 0 0 0 0 0 0
0 𝑅2 𝐹3 0 0 0 0 0 0
0 0 𝑅3 𝐹4 0 0 0 0 0
0 0 0 𝑅4 𝐹5 0 0 0 0
0 0 0 0 𝑅5 𝐹6 0 0 0
0 0 0 0 0 𝑅6 𝐹7 0 0
0 0 0 0 0 0 𝑅7 𝐹8 0
0 0 0 0 0 0 0 𝑅8 𝐹9
*
𝑆 𝑡 1
𝑆 𝑡 2
𝑆 𝑡 3
𝑆 𝑡 4
𝑆 𝑡 5
𝑆 𝑡 6
𝑆 𝑡 7
𝑆 𝑡 8
𝑆 𝑡 9
+
𝐼 𝑡 1
𝐼 𝑡 2
𝐼 𝑡 3
𝐼 𝑡 4
𝐼 𝑡 5
𝐼 𝑡 6
𝐼 𝑡 7
𝐼 𝑡 8
𝐼 𝑡 9
=
𝑆 𝑡 + ∆𝑡 1
𝑆 𝑡 + ∆𝑡 2
𝑆 𝑡 + ∆𝑡 3
𝑆 𝑡 + ∆𝑡 4
𝑆 𝑡 + ∆𝑡 5
𝑆 𝑡 + ∆𝑡 6
𝑆 𝑡 + ∆𝑡 7
𝑆 𝑡 + ∆𝑡 8
𝑆 𝑡 + ∆𝑡 9
DIFFERENCE EQUATION
Too many parameters, then reduce matrix
A=
𝐹𝐹1 0 𝑅𝑅3
𝑅𝑅1 𝐹𝐹2 0
0 𝑅𝑅2 𝐹𝐹3
, where
𝐹𝐹1 0 𝑅𝑅3
𝑅𝑅1 𝐹𝐹2 0
0 𝑅𝑅2 𝐹𝐹3
*
𝑆𝑆(𝑡)1
𝑆𝑆(𝑡)2
𝑆𝑆(𝑡)3
+
𝐼𝐼1
𝐼𝐼2
𝐼𝐼3
=
𝑆𝑆(𝑡 + ∆𝑡)1
𝑆𝑆(𝑡 + ∆𝑡)2
𝑆𝑆(𝑡 + ∆𝑡)3
.
To find the equilibrium points
1 − 𝐹𝐹1 0 −𝑅𝑅3
−𝑅𝑅1 1 − 𝐹𝐹2 0
0 −𝑅𝑅2 1 − 𝐹𝐹3
∗
𝑆𝑆(𝑡)1
𝑆𝑆(𝑡)2
𝑆𝑆(𝑡)3
=
𝐼𝐼1
𝐼𝐼2
𝐼𝐼3
.
DIFFERENCE EQUATION
𝑆𝑆(𝑡)1
𝑆𝑆(𝑡)2
𝑆𝑆(𝑡)3
=
−
𝐼𝐼1∗ 𝐹𝐹2−1 ∗ 𝐹𝐹3−1 +𝐼𝐼2∗𝑅𝑅1∗ 1−𝐹𝐹3 +𝐼𝐼3∗𝑅𝑅1∗𝑅𝑅2
𝐹𝐹1∗𝐹𝐹2∗𝐹𝐹3+𝑅𝑅1∗𝑅𝑅2∗𝑅𝑅3−𝐹𝐹1∗𝐹𝐹2−𝐹𝐹1∗𝐹𝐹3−𝐹𝐹3∗𝐹𝐹2+𝐹𝐹1+𝐹𝐹2+𝐹𝐹3−1
−
𝐼𝐼2∗ 𝐹𝐹1−1 ∗ 𝐹𝐹3−1 +𝐼𝐼3∗𝑅𝑅2∗ 1−𝐹𝐹1 +𝐼𝐼1∗𝑅𝑅3∗𝑅𝑅2
𝐹𝐹1∗𝐹𝐹2∗𝐹𝐹3+𝑅𝑅1∗𝑅𝑅2∗𝑅𝑅3−𝐹𝐹1∗𝐹𝐹2−𝐹𝐹1∗𝐹𝐹3−𝐹𝐹3∗𝐹𝐹2+𝐹𝐹1+𝐹𝐹2+𝐹𝐹3−1
−
𝐼𝐼3∗ 𝐹𝐹2−1 ∗ 𝐹𝐹1−1 +𝐼𝐼1∗𝑅𝑅3∗ 1−𝐹𝐹2 +𝐼𝐼2∗𝑅𝑅1∗𝑅𝑅3
𝐹𝐹1∗𝐹𝐹2∗𝐹𝐹3+𝑅𝑅1∗𝑅𝑅2∗𝑅𝑅3−𝐹𝐹1∗𝐹𝐹2−𝐹𝐹1∗𝐹𝐹3−𝐹𝐹3∗𝐹𝐹2+𝐹𝐹1+𝐹𝐹2+𝐹𝐹3−1
DIFFERENCE EQUATION
1. Nonnegative
2. Irreducible
So, primitive matrix
Perron-Frobenius Theorem
Positive E-value
𝑚𝑖𝑛𝑖 𝑗 𝑎𝑖𝑗 ≤ 𝜆 ≤ 𝑚𝑎𝑥𝑖 𝑗 𝑎𝑖𝑗
globally asymptotically stable.
DIFFERENTIAL EQUATION
………s1
r1
s2
r2 r8
s9
I1 I2 I9
O1 O2
O9
R
r9
DIFFERENTIAL EQUATION
𝑠(𝑡)𝑖, 𝑖 = 1,2, … . . , 9 Represents how many cars on the road i at time t.
𝐼(𝑡)𝑖, 𝑖 = 1,2, … … , 9 Represents how many cars will going to ith road from outside
every half minute.
𝑟𝑖, 𝑖 = 1,2, … … , 9 Represents the rate that how many cars leave from ith road to
i+1th road per half minute.
𝑂𝑖, 𝑖 = 1,2, … … , 9 Represents the rate that how many cars leave from ith road to
outside per half minute.
DIFFERENTIAL EQUATION
∆𝑡 = ℎ𝑎𝑙𝑓 𝑚𝑖𝑛𝑢𝑡𝑒
𝑑𝑠1
𝑑𝑡
= −𝑠(𝑡)1 ∗ 𝑂1 + 𝑠(𝑡)9 ∗ 𝑟9 + 𝐼(𝑡)1
𝑑𝑠2
𝑑𝑡
= −𝑠(𝑡)2 ∗ 𝑂2 + 𝑠(𝑡)1 ∗ 𝑟1 + 𝐼(𝑡)2
𝑑𝑠3
𝑑𝑡
= −𝑠(𝑡)3 ∗ 𝑂3 + 𝑠(𝑡)2 ∗ 𝑟2 + 𝐼(𝑡)3
𝑑𝑠4
𝑑𝑡
= −𝑠(𝑡)4 ∗ 𝑂4 + 𝑠(𝑡)3 ∗ 𝑟3 + 𝐼(𝑡)4
𝑑𝑠5
𝑑𝑡
= −𝑠(𝑡)5 ∗ 𝑂5 + 𝑠(𝑡)4 ∗ 𝑟4 + 𝐼(𝑡)5
𝑑𝑠6
𝑑𝑡
= −𝑠(𝑡)6 ∗ 𝑂6 + 𝑠(𝑡)5 ∗ 𝑟5 + 𝐼(𝑡)6
𝑑𝑠7
𝑑𝑡
= −𝑠(𝑡)7 ∗ 𝑂7 + 𝑠(𝑡)6 ∗ 𝑟6 + 𝐼(𝑡)7
𝑑𝑠8
𝑑𝑡
= −𝑠(𝑡)8 ∗ 𝑂8 + 𝑠(𝑡)7 ∗ 𝑟7 + 𝐼(𝑡)8
𝑑𝑠9
𝑑𝑡
= −𝑠(𝑡)9 ∗ 𝑂9 + 𝑠(𝑡)8 ∗ 𝑟8 + 𝐼(𝑡)9
DIFFERENTIAL EQUATION
A=
−𝑂1 0 0 0 0 0 0 0 𝑟9
𝑟1 −𝑂2 0 0 0 0 0 0 0
0 𝑟2 −𝑂3 0 0 0 0 0 0
0 0 𝑟3 −𝑂4 0 0 0 0 0
0 0 0 𝑟4 −𝑂5 0 0 0 0
0 0 0 0 𝑟5 −𝑂6 0 0 0
0 0 0 0 0 𝑟6 −𝑂7 0 0
0 0 0 0 0 0 𝑟7 −𝑂8 0
0 0 0 0 0 0 0 𝑟8 −𝑂9
𝐼(𝑡) =
𝐼 𝑡 1
𝐼 𝑡 2
𝐼 𝑡 3
𝐼 𝑡 4
𝐼 𝑡 5
𝐼 𝑡 6
𝐼 𝑡 7
𝐼 𝑡 8
𝐼 𝑡 9
, Then,
𝑑𝑠
𝑑𝑡
= 𝐴 ∗ 𝑠 𝑡 + 𝐼(𝑡).
DIFFERENTIAL EQUATION
Too many parameters, then reduce matrix
B =
−𝑂𝑂1 0 𝑟𝑟3
𝑟𝑟1 −𝑂𝑂2 0
0 𝑟𝑟2 −𝑂𝑂3
,
Where
−𝑂𝑂1 0 𝑟𝑟3
𝑟𝑟1 −𝑂𝑂2 0
0 𝑟𝑟2 −𝑂𝑂3
*
𝑠𝑠(𝑡)1
𝑠𝑠(𝑡)2
𝑠𝑠(𝑡)3
+
𝐼𝐼1
𝐼𝐼2
𝐼𝐼3
=
𝑑𝑠
𝑑𝑡
.
Nonhomogeneous system
DIFFERENTIAL EQUATION
𝑠𝑠(𝑡)1
𝑠𝑠(𝑡)2
𝑠𝑠(𝑡)3
=
𝐼𝐼1∗𝑂𝑂2∗𝑂𝑂3+𝐼𝐼2∗𝑂𝑂3∗𝑟𝑟1+𝐼𝐼3∗𝑟𝑟1∗𝑟𝑟2
𝑜𝑜1∗𝑜𝑜2∗𝑜𝑜3−𝑟𝑟1∗𝑟𝑟2∗𝑟𝑟3
𝐼𝐼2∗𝑂𝑂1∗𝑂𝑂3+𝐼𝐼3∗𝑂𝑂1∗𝑟𝑟2+𝐼𝐼1∗𝑟𝑟3∗𝑟𝑟2
𝑜𝑜1∗𝑜𝑜2∗𝑜𝑜3−𝑟𝑟1∗𝑟𝑟2∗𝑟𝑟3
𝐼𝐼3∗𝑂𝑂2∗𝑂𝑂1+𝐼𝐼1∗𝑂𝑂2∗𝑟𝑟3+𝐼𝐼2∗𝑟𝑟1∗𝑟𝑟3
𝑜𝑜1∗𝑜𝑜2∗𝑜𝑜3−𝑟𝑟1∗𝑟𝑟2∗𝑟𝑟3
𝜆3 + (𝑂𝑂1+𝑂𝑂2 + 𝑂𝑂3) ∗ 𝜆2+(𝑂𝑂1 ∗ 𝑂𝑂2 + 𝑂𝑂1 ∗ 𝑂𝑂3 + 𝑂𝑂2 ∗ 𝑂𝑂3) ∗ 𝜆 +
(𝑂𝑂1 ∗ 𝑂𝑂2 ∗ 𝑂𝑂3 − 𝑟𝑟1 ∗ 𝑟𝑟2 ∗ 𝑟𝑟3)
If unique equilibrium points exist then it is globally asymptotically stable.
NUMERICAL SIMULATION
By Recording the data everyday
8 10 12 14 16 18
4
6
8
10
12
14
timeo
fad
ay
number
o
f
c
ars
number_of_cars vs. time_of_a_day
untitled fit 1
NUMERICAL SIMULATION
For both models, using same initial condition for the road and input cars at each
traffic intersection.
6 8 10 12 14 16 18 20
0
2
4
6
8
10
12
14
Timeo
f the day
Number
of
cars
s1
s2
s3
s4
s5
s6
s7
s8
s9
6 8 10 12 14 16 18 20
0
2
4
6
8
10
12
14
time
Numberofcars
I1
I2
I3
I4
I5
I6
I7
I8
I9
NUMERICAL SIMULATION
0.1 0 0 0 0 0 0 0 0.01
0.8 0.1 0 0 0 0 0 0 0
0 0.8 0.1 0 0 0 0 0 0
0 0 0.55 0.1 0 0 0 0 0
0 0 0 0.02 0.1 0 0 0 0
0 0 0 0 0.85 0.1 0 0 0
0 0 0 0 0 0.85 0.1 0 0
0 0 0 0 0 0 0.5 0.4 0
0 0 0 0 0 0 0 0.5 0.1
for difference equation
NUMERICAL SIMULATION
Notice that: 2 models are using same ∆𝑡 = ℎ𝑎𝑙𝑓 𝑚𝑖𝑛𝑢𝑡𝑒
𝑅𝑖 + 𝐹𝑖 +𝑜𝑖=1 in difference equation.
𝑟𝑖=log(1+𝑅𝑖), 𝑂𝑖 = log(2 − (𝑅𝑖 + 𝐹𝑖)) in differential equation.
The
−0.09 0 0 0 0 0 0 0 0.01
0.59 −0.09 0 0 0 0 0 0 0
0 0.59 −0.30 0 0 0 0 0 0
0 0 0.44 −0.63 0 0 0 0 0
0 0 0 0.02 −0.05 0 0 0 0
0 0 0 0 0.62 −0.05 0 0 0
0 0 0 0 0 0.62 −0.37 0 0
0 0 0 0 0 0 0.41 −0.09 0
0 0 0 0 0 0 0 0.41 −0.64
is for differential equation
NUMERICAL SIMULATION
Average number of cars I will meet on the road at different starting time
This number is the number of cars can impact me during my driving.
6 8 10 12 14 16 18 20
30
40
50
60
70
80
90
100
110
120
130
Starting time
Averagenumberofcarswillbemet
Difference
Avarage of 2
Differential
NUMERICAL SIMULATION
The relation between time cost(without traffic light) and number of cars who can
impact my driving.
By recording data, transfer the starting time to corresponding average number of
cars met on the road.
40 50 60 70 80 90 100
8
9
10
11
12
13
14
15
Average number of cars met
Acturallycostoftime
t vs. sp
untitled fit 1
NUMERICAL SOLUTION
Starting time vs. cost time
Cost time = cost time (without traffic light) + random number from(0,3)* 1/3 seconds
6 8 10 12 14 16 18 20
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
Starting time
Timeofdrivingwithouttrafficlightsimpact
CONCLUSION
1. Different modelling method can provide different result.
2. A simple real life problem is harder than academic example.
3. Improvement :
1. Analyze more (5 by 5)
2. Change constant parameter to function respect to time.
3. PDE modelling
THANK YOU
QUESTIONS?

More Related Content

What's hot

Standard Deviation and Variance
Standard Deviation and VarianceStandard Deviation and Variance
Standard Deviation and Variance
Robbie Jule
 
Ecucuacion cuadratica factor
Ecucuacion cuadratica factorEcucuacion cuadratica factor
Ecucuacion cuadratica factor
Ramiro Muñoz
 
Introduction to Regression line
Introduction to Regression lineIntroduction to Regression line
Introduction to Regression line
Amarnath R
 
North West Corner Method
North West Corner MethodNorth West Corner Method
North West Corner Method
UsharaniRavikumar
 
Modified distribution method (modi method)
Modified distribution method (modi method)Modified distribution method (modi method)
Modified distribution method (modi method)
Dinesh Suthar
 
Monte Carlo Methods
Monte Carlo MethodsMonte Carlo Methods
Monte Carlo Methods
James Bell
 
Max and min trig values
Max and min trig valuesMax and min trig values
Max and min trig values
Shaun Wilson
 
10th grade final exam review answer key
10th grade final exam review answer key10th grade final exam review answer key
10th grade final exam review answer key
Joshua Gerrard
 
Cg
CgCg
T test
T testT test
Maths
MathsMaths
Vogel's Approximation Method
Vogel's Approximation MethodVogel's Approximation Method
Vogel's Approximation Method
UsharaniRavikumar
 
MATH: RATIOS AND PERCENTS
MATH: RATIOS AND PERCENTSMATH: RATIOS AND PERCENTS
MATH: RATIOS AND PERCENTS
M, Michelle Jeannite
 
MAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELD
MAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELDMAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELD
MAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELD
VIJAY THAKKAR
 
Benginning Calculus Lecture notes 14 - areas & volumes
Benginning Calculus Lecture notes 14 - areas & volumesBenginning Calculus Lecture notes 14 - areas & volumes
Benginning Calculus Lecture notes 14 - areas & volumes
basyirstar
 
transporation problem - stepping stone method
transporation problem - stepping stone methodtransporation problem - stepping stone method
transporation problem - stepping stone method
oragon291764
 
Monte carlo
Monte carloMonte carlo
Monte carlo
shishirkawde
 

What's hot (17)

Standard Deviation and Variance
Standard Deviation and VarianceStandard Deviation and Variance
Standard Deviation and Variance
 
Ecucuacion cuadratica factor
Ecucuacion cuadratica factorEcucuacion cuadratica factor
Ecucuacion cuadratica factor
 
Introduction to Regression line
Introduction to Regression lineIntroduction to Regression line
Introduction to Regression line
 
North West Corner Method
North West Corner MethodNorth West Corner Method
North West Corner Method
 
Modified distribution method (modi method)
Modified distribution method (modi method)Modified distribution method (modi method)
Modified distribution method (modi method)
 
Monte Carlo Methods
Monte Carlo MethodsMonte Carlo Methods
Monte Carlo Methods
 
Max and min trig values
Max and min trig valuesMax and min trig values
Max and min trig values
 
10th grade final exam review answer key
10th grade final exam review answer key10th grade final exam review answer key
10th grade final exam review answer key
 
Cg
CgCg
Cg
 
T test
T testT test
T test
 
Maths
MathsMaths
Maths
 
Vogel's Approximation Method
Vogel's Approximation MethodVogel's Approximation Method
Vogel's Approximation Method
 
MATH: RATIOS AND PERCENTS
MATH: RATIOS AND PERCENTSMATH: RATIOS AND PERCENTS
MATH: RATIOS AND PERCENTS
 
MAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELD
MAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELDMAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELD
MAXIMUM SHEAR STRESS IN PARALLEL WELD AND TRANSVERSE FILLET WELD
 
Benginning Calculus Lecture notes 14 - areas & volumes
Benginning Calculus Lecture notes 14 - areas & volumesBenginning Calculus Lecture notes 14 - areas & volumes
Benginning Calculus Lecture notes 14 - areas & volumes
 
transporation problem - stepping stone method
transporation problem - stepping stone methodtransporation problem - stepping stone method
transporation problem - stepping stone method
 
Monte carlo
Monte carloMonte carlo
Monte carlo
 

Similar to How much time will be used for driving

Ejercicios john rangel
Ejercicios john rangelEjercicios john rangel
Ejercicios john rangel
johndaddy
 
Overview Of Using Calculator
Overview Of Using CalculatorOverview Of Using Calculator
Overview Of Using Calculator
FrancescoPozolo1
 
Maqueta en componentes normal y tangencial
Maqueta en componentes normal y tangencialMaqueta en componentes normal y tangencial
Maqueta en componentes normal y tangencial
Robayo3rik
 
Ejercicios asignados a yonathan david diaz granados
Ejercicios asignados a yonathan david diaz granadosEjercicios asignados a yonathan david diaz granados
Ejercicios asignados a yonathan david diaz granados
YonathanDavidDiazGra
 
Integrales
IntegralesIntegrales
Integrales
cesarcsl
 
Opt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptxOpt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptx
AbdellaKarime
 
4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx
Happy Ladher
 
Chapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptxChapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptx
MdSazolAhmmed
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
UmeshJagga1
 
Lec 8 dynamics
Lec 8 dynamicsLec 8 dynamics
Lec 8 dynamics
YousafAnwarKhan
 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
versabit technologies
 
cat-quant-cheat-sheet
 cat-quant-cheat-sheet cat-quant-cheat-sheet
cat-quant-cheat-sheet
techonomics1
 
Discrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryDiscrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata Theory
Mark Simon
 
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial ApproachPREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
ahmet furkan emrehan
 
Final Report
Final ReportFinal Report
Final Report
Brian Wu
 
Numerical integration
Numerical integration Numerical integration
Numerical integration
Dhyey Shukla
 
Ip 5 discrete mathematics
Ip 5 discrete mathematicsIp 5 discrete mathematics
Ip 5 discrete mathematics
Mark Simon
 
Semana 10 numeros complejos i álgebra-uni ccesa007
Semana 10   numeros complejos i álgebra-uni ccesa007Semana 10   numeros complejos i álgebra-uni ccesa007
Semana 10 numeros complejos i álgebra-uni ccesa007
Demetrio Ccesa Rayme
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
ssuser01e301
 
quadcopter modelling and controller design
quadcopter modelling and controller designquadcopter modelling and controller design
quadcopter modelling and controller design
Vijay Kumar Jadon
 

Similar to How much time will be used for driving (20)

Ejercicios john rangel
Ejercicios john rangelEjercicios john rangel
Ejercicios john rangel
 
Overview Of Using Calculator
Overview Of Using CalculatorOverview Of Using Calculator
Overview Of Using Calculator
 
Maqueta en componentes normal y tangencial
Maqueta en componentes normal y tangencialMaqueta en componentes normal y tangencial
Maqueta en componentes normal y tangencial
 
Ejercicios asignados a yonathan david diaz granados
Ejercicios asignados a yonathan david diaz granadosEjercicios asignados a yonathan david diaz granados
Ejercicios asignados a yonathan david diaz granados
 
Integrales
IntegralesIntegrales
Integrales
 
Opt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptxOpt Assgnment #-1 PPTX.pptx
Opt Assgnment #-1 PPTX.pptx
 
4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx4. Integral Calculus for gcse and other exams.pptx
4. Integral Calculus for gcse and other exams.pptx
 
Chapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptxChapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptx
 
Machine learning introduction lecture notes
Machine learning introduction lecture notesMachine learning introduction lecture notes
Machine learning introduction lecture notes
 
Lec 8 dynamics
Lec 8 dynamicsLec 8 dynamics
Lec 8 dynamics
 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
 
cat-quant-cheat-sheet
 cat-quant-cheat-sheet cat-quant-cheat-sheet
cat-quant-cheat-sheet
 
Discrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata TheoryDiscrete Math IP4 - Automata Theory
Discrete Math IP4 - Automata Theory
 
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial ApproachPREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
PREDICTION MODELS BASED ON MAX-STEMS Episode Two: Combinatorial Approach
 
Final Report
Final ReportFinal Report
Final Report
 
Numerical integration
Numerical integration Numerical integration
Numerical integration
 
Ip 5 discrete mathematics
Ip 5 discrete mathematicsIp 5 discrete mathematics
Ip 5 discrete mathematics
 
Semana 10 numeros complejos i álgebra-uni ccesa007
Semana 10   numeros complejos i álgebra-uni ccesa007Semana 10   numeros complejos i álgebra-uni ccesa007
Semana 10 numeros complejos i álgebra-uni ccesa007
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 
quadcopter modelling and controller design
quadcopter modelling and controller designquadcopter modelling and controller design
quadcopter modelling and controller design
 

How much time will be used for driving

  • 1. HOW MUCH TIME WILL BE USED FOR DRIVING TO SCHOOL? Ruo Yang Winter 2015 Mathematical modelling
  • 2. HOW DID I START? 1. Rush hours. 2. For different starting time t, it will costs a different time on the road corresponding to t. 3. Different number of cars on the road at different starting time. 4. More cars costs more time for driving.
  • 3. STRUCTURE Input: Starting time Road condition (How many cars on the road) How many cars will impacts my driving Relation between number of cars who can impact my drive and cost of time Output: cost of time
  • 4. MODELLING 1. Difference equation model (Discrete in time). 2. Differential equation model (Continuous in time). The core is finding the how many cars will impact driving for different starting time
  • 5. THE ROAD TO UNIVERSITY
  • 7. DIFFERENCE EQUATION 𝑆(𝑡)𝑖 > 0, 𝑖 = 1,2, … . . , 9 Represents how many cars on the road i at time t. 𝑅𝑖, 𝑖 = 1,2, … … , 9 Represents the percentage of cars go from ith road to i+1th road after half minute 𝐹𝑖, 𝑖 = 1,2, … … , 9 Represents the percentage of cars stay in ith road after half minute 𝐼(𝑡) > 0𝑖, 𝑖 = 1,2, … . . , 9, Represents how many cars will going to ith road from outside every half minute.
  • 8. DIFFERENCE EQUATION ∆𝑡 = ℎ𝑎𝑙𝑓 𝑚𝑖𝑛𝑢𝑡𝑒 𝑆 𝑡 + ∆𝑡 1 = 𝐼 𝑡 1 + 𝑅9 ∗ 𝑆 𝑡 9 + 𝐹1 ∗ 𝑆 𝑡 1 𝑆 𝑡 + ∆𝑡 2 = 𝐼 𝑡 2 + 𝑅1 ∗ 𝑆 𝑡 1 + 𝐹2 ∗ 𝑆 𝑡 2 𝑆 𝑡 + ∆𝑡 3 = 𝐼 𝑡 3 + 𝑅2 ∗ 𝑆 𝑡 2 + 𝐹3 ∗ 𝑆 𝑡 3 𝑆 𝑡 + ∆𝑡 4 = 𝐼 𝑡 4 + 𝑅3 ∗ 𝑆 𝑡 3 + 𝐹4 ∗ 𝑆 𝑡 4 𝑆 𝑡 + ∆𝑡 5 = 𝐼 𝑡 5 + 𝑅4 ∗ 𝑆 𝑡 4 + 𝐹5 ∗ 𝑆 𝑡 5 𝑆 𝑡 + ∆𝑡 6 = 𝐼 𝑡 6 + 𝑅5 ∗ 𝑆 𝑡 5 + 𝐹6 ∗ 𝑆 𝑡 6 𝑆 𝑡 + ∆𝑡 7 = 𝐼 𝑡 7 + 𝑅6 ∗ 𝑆 𝑡 6 + 𝐹7 ∗ 𝑆 𝑡 7 𝑆 𝑡 + ∆𝑡 8 = 𝐼 𝑡 8 + 𝑅7 ∗ 𝑆 𝑡 7 + 𝐹8 ∗ 𝑆 𝑡 8 𝑆 𝑡 + ∆𝑡 9 = 𝐼 𝑡 9 + 𝑅8 ∗ 𝑆 𝑡 8 + 𝐹9 ∗ 𝑆 𝑡 9
  • 9. DIFFERENCE EQUATION 𝐹1 0 0 0 0 0 0 0 𝑅9 𝑅1 𝐹2 0 0 0 0 0 0 0 0 𝑅2 𝐹3 0 0 0 0 0 0 0 0 𝑅3 𝐹4 0 0 0 0 0 0 0 0 𝑅4 𝐹5 0 0 0 0 0 0 0 0 𝑅5 𝐹6 0 0 0 0 0 0 0 0 𝑅6 𝐹7 0 0 0 0 0 0 0 0 𝑅7 𝐹8 0 0 0 0 0 0 0 0 𝑅8 𝐹9 * 𝑆 𝑡 1 𝑆 𝑡 2 𝑆 𝑡 3 𝑆 𝑡 4 𝑆 𝑡 5 𝑆 𝑡 6 𝑆 𝑡 7 𝑆 𝑡 8 𝑆 𝑡 9 + 𝐼 𝑡 1 𝐼 𝑡 2 𝐼 𝑡 3 𝐼 𝑡 4 𝐼 𝑡 5 𝐼 𝑡 6 𝐼 𝑡 7 𝐼 𝑡 8 𝐼 𝑡 9 = 𝑆 𝑡 + ∆𝑡 1 𝑆 𝑡 + ∆𝑡 2 𝑆 𝑡 + ∆𝑡 3 𝑆 𝑡 + ∆𝑡 4 𝑆 𝑡 + ∆𝑡 5 𝑆 𝑡 + ∆𝑡 6 𝑆 𝑡 + ∆𝑡 7 𝑆 𝑡 + ∆𝑡 8 𝑆 𝑡 + ∆𝑡 9
  • 10. DIFFERENCE EQUATION Too many parameters, then reduce matrix A= 𝐹𝐹1 0 𝑅𝑅3 𝑅𝑅1 𝐹𝐹2 0 0 𝑅𝑅2 𝐹𝐹3 , where 𝐹𝐹1 0 𝑅𝑅3 𝑅𝑅1 𝐹𝐹2 0 0 𝑅𝑅2 𝐹𝐹3 * 𝑆𝑆(𝑡)1 𝑆𝑆(𝑡)2 𝑆𝑆(𝑡)3 + 𝐼𝐼1 𝐼𝐼2 𝐼𝐼3 = 𝑆𝑆(𝑡 + ∆𝑡)1 𝑆𝑆(𝑡 + ∆𝑡)2 𝑆𝑆(𝑡 + ∆𝑡)3 . To find the equilibrium points 1 − 𝐹𝐹1 0 −𝑅𝑅3 −𝑅𝑅1 1 − 𝐹𝐹2 0 0 −𝑅𝑅2 1 − 𝐹𝐹3 ∗ 𝑆𝑆(𝑡)1 𝑆𝑆(𝑡)2 𝑆𝑆(𝑡)3 = 𝐼𝐼1 𝐼𝐼2 𝐼𝐼3 .
  • 11. DIFFERENCE EQUATION 𝑆𝑆(𝑡)1 𝑆𝑆(𝑡)2 𝑆𝑆(𝑡)3 = − 𝐼𝐼1∗ 𝐹𝐹2−1 ∗ 𝐹𝐹3−1 +𝐼𝐼2∗𝑅𝑅1∗ 1−𝐹𝐹3 +𝐼𝐼3∗𝑅𝑅1∗𝑅𝑅2 𝐹𝐹1∗𝐹𝐹2∗𝐹𝐹3+𝑅𝑅1∗𝑅𝑅2∗𝑅𝑅3−𝐹𝐹1∗𝐹𝐹2−𝐹𝐹1∗𝐹𝐹3−𝐹𝐹3∗𝐹𝐹2+𝐹𝐹1+𝐹𝐹2+𝐹𝐹3−1 − 𝐼𝐼2∗ 𝐹𝐹1−1 ∗ 𝐹𝐹3−1 +𝐼𝐼3∗𝑅𝑅2∗ 1−𝐹𝐹1 +𝐼𝐼1∗𝑅𝑅3∗𝑅𝑅2 𝐹𝐹1∗𝐹𝐹2∗𝐹𝐹3+𝑅𝑅1∗𝑅𝑅2∗𝑅𝑅3−𝐹𝐹1∗𝐹𝐹2−𝐹𝐹1∗𝐹𝐹3−𝐹𝐹3∗𝐹𝐹2+𝐹𝐹1+𝐹𝐹2+𝐹𝐹3−1 − 𝐼𝐼3∗ 𝐹𝐹2−1 ∗ 𝐹𝐹1−1 +𝐼𝐼1∗𝑅𝑅3∗ 1−𝐹𝐹2 +𝐼𝐼2∗𝑅𝑅1∗𝑅𝑅3 𝐹𝐹1∗𝐹𝐹2∗𝐹𝐹3+𝑅𝑅1∗𝑅𝑅2∗𝑅𝑅3−𝐹𝐹1∗𝐹𝐹2−𝐹𝐹1∗𝐹𝐹3−𝐹𝐹3∗𝐹𝐹2+𝐹𝐹1+𝐹𝐹2+𝐹𝐹3−1
  • 12. DIFFERENCE EQUATION 1. Nonnegative 2. Irreducible So, primitive matrix Perron-Frobenius Theorem Positive E-value 𝑚𝑖𝑛𝑖 𝑗 𝑎𝑖𝑗 ≤ 𝜆 ≤ 𝑚𝑎𝑥𝑖 𝑗 𝑎𝑖𝑗 globally asymptotically stable.
  • 14. DIFFERENTIAL EQUATION 𝑠(𝑡)𝑖, 𝑖 = 1,2, … . . , 9 Represents how many cars on the road i at time t. 𝐼(𝑡)𝑖, 𝑖 = 1,2, … … , 9 Represents how many cars will going to ith road from outside every half minute. 𝑟𝑖, 𝑖 = 1,2, … … , 9 Represents the rate that how many cars leave from ith road to i+1th road per half minute. 𝑂𝑖, 𝑖 = 1,2, … … , 9 Represents the rate that how many cars leave from ith road to outside per half minute.
  • 15. DIFFERENTIAL EQUATION ∆𝑡 = ℎ𝑎𝑙𝑓 𝑚𝑖𝑛𝑢𝑡𝑒 𝑑𝑠1 𝑑𝑡 = −𝑠(𝑡)1 ∗ 𝑂1 + 𝑠(𝑡)9 ∗ 𝑟9 + 𝐼(𝑡)1 𝑑𝑠2 𝑑𝑡 = −𝑠(𝑡)2 ∗ 𝑂2 + 𝑠(𝑡)1 ∗ 𝑟1 + 𝐼(𝑡)2 𝑑𝑠3 𝑑𝑡 = −𝑠(𝑡)3 ∗ 𝑂3 + 𝑠(𝑡)2 ∗ 𝑟2 + 𝐼(𝑡)3 𝑑𝑠4 𝑑𝑡 = −𝑠(𝑡)4 ∗ 𝑂4 + 𝑠(𝑡)3 ∗ 𝑟3 + 𝐼(𝑡)4 𝑑𝑠5 𝑑𝑡 = −𝑠(𝑡)5 ∗ 𝑂5 + 𝑠(𝑡)4 ∗ 𝑟4 + 𝐼(𝑡)5 𝑑𝑠6 𝑑𝑡 = −𝑠(𝑡)6 ∗ 𝑂6 + 𝑠(𝑡)5 ∗ 𝑟5 + 𝐼(𝑡)6 𝑑𝑠7 𝑑𝑡 = −𝑠(𝑡)7 ∗ 𝑂7 + 𝑠(𝑡)6 ∗ 𝑟6 + 𝐼(𝑡)7 𝑑𝑠8 𝑑𝑡 = −𝑠(𝑡)8 ∗ 𝑂8 + 𝑠(𝑡)7 ∗ 𝑟7 + 𝐼(𝑡)8 𝑑𝑠9 𝑑𝑡 = −𝑠(𝑡)9 ∗ 𝑂9 + 𝑠(𝑡)8 ∗ 𝑟8 + 𝐼(𝑡)9
  • 16. DIFFERENTIAL EQUATION A= −𝑂1 0 0 0 0 0 0 0 𝑟9 𝑟1 −𝑂2 0 0 0 0 0 0 0 0 𝑟2 −𝑂3 0 0 0 0 0 0 0 0 𝑟3 −𝑂4 0 0 0 0 0 0 0 0 𝑟4 −𝑂5 0 0 0 0 0 0 0 0 𝑟5 −𝑂6 0 0 0 0 0 0 0 0 𝑟6 −𝑂7 0 0 0 0 0 0 0 0 𝑟7 −𝑂8 0 0 0 0 0 0 0 0 𝑟8 −𝑂9 𝐼(𝑡) = 𝐼 𝑡 1 𝐼 𝑡 2 𝐼 𝑡 3 𝐼 𝑡 4 𝐼 𝑡 5 𝐼 𝑡 6 𝐼 𝑡 7 𝐼 𝑡 8 𝐼 𝑡 9 , Then, 𝑑𝑠 𝑑𝑡 = 𝐴 ∗ 𝑠 𝑡 + 𝐼(𝑡).
  • 17. DIFFERENTIAL EQUATION Too many parameters, then reduce matrix B = −𝑂𝑂1 0 𝑟𝑟3 𝑟𝑟1 −𝑂𝑂2 0 0 𝑟𝑟2 −𝑂𝑂3 , Where −𝑂𝑂1 0 𝑟𝑟3 𝑟𝑟1 −𝑂𝑂2 0 0 𝑟𝑟2 −𝑂𝑂3 * 𝑠𝑠(𝑡)1 𝑠𝑠(𝑡)2 𝑠𝑠(𝑡)3 + 𝐼𝐼1 𝐼𝐼2 𝐼𝐼3 = 𝑑𝑠 𝑑𝑡 . Nonhomogeneous system
  • 18. DIFFERENTIAL EQUATION 𝑠𝑠(𝑡)1 𝑠𝑠(𝑡)2 𝑠𝑠(𝑡)3 = 𝐼𝐼1∗𝑂𝑂2∗𝑂𝑂3+𝐼𝐼2∗𝑂𝑂3∗𝑟𝑟1+𝐼𝐼3∗𝑟𝑟1∗𝑟𝑟2 𝑜𝑜1∗𝑜𝑜2∗𝑜𝑜3−𝑟𝑟1∗𝑟𝑟2∗𝑟𝑟3 𝐼𝐼2∗𝑂𝑂1∗𝑂𝑂3+𝐼𝐼3∗𝑂𝑂1∗𝑟𝑟2+𝐼𝐼1∗𝑟𝑟3∗𝑟𝑟2 𝑜𝑜1∗𝑜𝑜2∗𝑜𝑜3−𝑟𝑟1∗𝑟𝑟2∗𝑟𝑟3 𝐼𝐼3∗𝑂𝑂2∗𝑂𝑂1+𝐼𝐼1∗𝑂𝑂2∗𝑟𝑟3+𝐼𝐼2∗𝑟𝑟1∗𝑟𝑟3 𝑜𝑜1∗𝑜𝑜2∗𝑜𝑜3−𝑟𝑟1∗𝑟𝑟2∗𝑟𝑟3 𝜆3 + (𝑂𝑂1+𝑂𝑂2 + 𝑂𝑂3) ∗ 𝜆2+(𝑂𝑂1 ∗ 𝑂𝑂2 + 𝑂𝑂1 ∗ 𝑂𝑂3 + 𝑂𝑂2 ∗ 𝑂𝑂3) ∗ 𝜆 + (𝑂𝑂1 ∗ 𝑂𝑂2 ∗ 𝑂𝑂3 − 𝑟𝑟1 ∗ 𝑟𝑟2 ∗ 𝑟𝑟3) If unique equilibrium points exist then it is globally asymptotically stable.
  • 19. NUMERICAL SIMULATION By Recording the data everyday 8 10 12 14 16 18 4 6 8 10 12 14 timeo fad ay number o f c ars number_of_cars vs. time_of_a_day untitled fit 1
  • 20. NUMERICAL SIMULATION For both models, using same initial condition for the road and input cars at each traffic intersection. 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 Timeo f the day Number of cars s1 s2 s3 s4 s5 s6 s7 s8 s9 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 time Numberofcars I1 I2 I3 I4 I5 I6 I7 I8 I9
  • 21. NUMERICAL SIMULATION 0.1 0 0 0 0 0 0 0 0.01 0.8 0.1 0 0 0 0 0 0 0 0 0.8 0.1 0 0 0 0 0 0 0 0 0.55 0.1 0 0 0 0 0 0 0 0 0.02 0.1 0 0 0 0 0 0 0 0 0.85 0.1 0 0 0 0 0 0 0 0 0.85 0.1 0 0 0 0 0 0 0 0 0.5 0.4 0 0 0 0 0 0 0 0 0.5 0.1 for difference equation
  • 22. NUMERICAL SIMULATION Notice that: 2 models are using same ∆𝑡 = ℎ𝑎𝑙𝑓 𝑚𝑖𝑛𝑢𝑡𝑒 𝑅𝑖 + 𝐹𝑖 +𝑜𝑖=1 in difference equation. 𝑟𝑖=log(1+𝑅𝑖), 𝑂𝑖 = log(2 − (𝑅𝑖 + 𝐹𝑖)) in differential equation. The −0.09 0 0 0 0 0 0 0 0.01 0.59 −0.09 0 0 0 0 0 0 0 0 0.59 −0.30 0 0 0 0 0 0 0 0 0.44 −0.63 0 0 0 0 0 0 0 0 0.02 −0.05 0 0 0 0 0 0 0 0 0.62 −0.05 0 0 0 0 0 0 0 0 0.62 −0.37 0 0 0 0 0 0 0 0 0.41 −0.09 0 0 0 0 0 0 0 0 0.41 −0.64 is for differential equation
  • 23. NUMERICAL SIMULATION Average number of cars I will meet on the road at different starting time This number is the number of cars can impact me during my driving. 6 8 10 12 14 16 18 20 30 40 50 60 70 80 90 100 110 120 130 Starting time Averagenumberofcarswillbemet Difference Avarage of 2 Differential
  • 24. NUMERICAL SIMULATION The relation between time cost(without traffic light) and number of cars who can impact my driving. By recording data, transfer the starting time to corresponding average number of cars met on the road. 40 50 60 70 80 90 100 8 9 10 11 12 13 14 15 Average number of cars met Acturallycostoftime t vs. sp untitled fit 1
  • 25. NUMERICAL SOLUTION Starting time vs. cost time Cost time = cost time (without traffic light) + random number from(0,3)* 1/3 seconds 6 8 10 12 14 16 18 20 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 Starting time Timeofdrivingwithouttrafficlightsimpact
  • 26. CONCLUSION 1. Different modelling method can provide different result. 2. A simple real life problem is harder than academic example. 3. Improvement : 1. Analyze more (5 by 5) 2. Change constant parameter to function respect to time. 3. PDE modelling