forked from alexdevonport/pfaces-pirk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjacobian_bounds.cl
77 lines (73 loc) · 2.18 KB
/
jacobian_bounds.cl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
float state_jacobian_lower_bound(unsigned int i, unsigned int j) {
// Parameters
unsigned int nlinks = SS_DIM;
float v = 0.5; // free-flow speed, in links/period
float w = 1.0/6.0; // congestion-wave speed, in links/period
float xbar = 320.0; // max occupancy when jammed, in vehicles
float b = 3.0/4.0; // fraction of vehicule staying on the network after each link
float T = 30.0; // time step for the continuous-time model
float c = 0.0;
if(i==0 && j==0) {
c = -v;
}
else if(i==1 && j==2) {
c = -w;
}
else if(i==2 && j==1) {
c = -w;
}
else if(i==j) {
c = -(v+w);
}
else {
c = 0;
}
c = c/T;
return c;
}
float state_jacobian_upper_bound(unsigned int i, unsigned int j) {
// Parameters
unsigned int nlinks = SS_DIM;
float v = 0.5; // free-flow speed, in links/period
float w = 1.0/6.0; // congestion-wave speed, in links/period
float xbar = 320.0; // max occupancy when jammed, in vehicles
float b = 3.0/4.0; // fraction of vehicule staying on the network after each link
float T = 30.0; // time step for the continuous-time model
float c = 0.0;
if (i==0 && j == 1) {
c = 2 * w;
} else if (i == 0 && j == 2) {
c = 2 * w;
} else if (i == 1 && j == 0) {
c = 0.5 * v;
} else if (i == 2 && j == 0) {
c = 0.5 * v;
} else if (i - j == 2) {
c = b * v;
} else if (i - j == -2) {
c = w / b;
} else if (i == (nlinks - 1) && j == (nlinks - 1) - 2) {
c = b * v;
} else if (i == (nlinks - 1) - 1 && j == (nlinks - 1) - 3) {
c = b * b;
}
else {
c = 0;
}
c = c / T;
return c;
}
float input_jacobian_lower_bound(unsigned int i, unsigned int j) {
if(i == 0 && j == 0) {
return 1.0;
} else {
return 0.0;
}
}
float input_jacobian_upper_bound(unsigned int i, unsigned int j) {
if(i == 0 && j == 0) {
return 1.0;
} else {
return 0.0;
}
}