Computational Methods for Macroscopic Model

0 downloads 0 Views 4MB Size Report
Oct 29, 2015 - TRAWS 3 Presentation, IPAM, UCLA. School of ...... rO ]T. Open loop optimal control solution: u∗(k) and x∗(k), k = 0,..., K . control sample time ...
Computational Methods for Macroscopic Model Validation and Model Predictive Control

Computational Methods for Macroscopic Model Validation and Model Predictive Control Apostolos Kotsialos & Adam Poole School of Engineering and Computing Sciences Durham University Tel.: +44 (0)191 33 42399 E-mail: [email protected] TRAWS 3 Presentation, IPAM, UCLA School of Engineering and Computing Sciences, Durham University, Durham, DH1 3LE, UK

October 29th, 2015

Computational Methods for Macroscopic Model Validation and Model Predictive Control

Outline 1

Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation Small sites Evolutionary algorithms Gradient based algorithms A larger network

2

Algorithms for Road Network Traffic Model Predictive Control Hierarchical model predictive control Optimisation layer for coordinated ramp metering Rolling horizon

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Macroscopic modelling of road networks Macroscopic description of traffic flow in a network. Density: ρm,i (k ) (veh/km/lane) the number of vehicles in segment i of link m at time k · T divided by the number of lanes in the link λm and by the segment length Lm . Mean speed: vm,i (k ) (km/h) which is the space mean speed of the vehicle flow in segment i at the current time instant k · T . Traffic flow (or volume): qm,i (k ) (veh/h) the number of vehicles leaving the segment i of link m during the interval [k · T , (k + 1) · T ], over T .

Time and space discretization of the conservation and speed equations x(k + 1) = f [x(k ), d(k ); z] , x(0) = x0 x state vector d disturbance vector z vector of model parameters. Our purpose is to find ways of determining an optimal vector of parameters z∗ that minimises the model error. Model error   J x(k ), b x(k )

∂ρ(x, t) ∂t ∂v (x, t)

+

∂q(x, t) ∂x

=0

where b x(k ) is a set of measurements at different locations in the network over a specific time period. Typically this is the total square error.

∂v (x, t) + v (x, t) + ∂t ∂x Model spatio-temporal distribution profile of density, flow and speed vs measurements. 1 ∂P(x, t) 1 = {V [ρ(x, t)] − v (x, t)} ρ(x, t) ∂x τ

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Research on this problem Based on the previous work...

Criticism Most of the model validation studies are performed on an ad hoc basis. The sites used are usually unidirectional, i.e. a single motorway stretch. The length of the stretch is relatively small (about 5km to 6km). No general methodology that can be applied to all simulators. Main objective to validate a numerical scheme and support the results with some data. Overparametrization. Requirements Large scale and realistic size sites need to be developed. We need to consider networks rather than just unidirectional road parts. Avoid overparametrization. Generic design, simulator independent if possible. Automating the process.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Validating a motorway network Basic issues... Different models for modelling motorway stretch dynamics (1st, 2nd or higher order). Which one? Flow assignment models at junctions (network topology requirement). How? Real data required. Where, what and how?

Addressing those issues...(continued) Flow assignment model. Introduction of the turning rates at junctions.

Addressing those issues... Data. MIDAS data available from the Highways Agency for selected UK sites. Archived in database managed by Mott-McDonald. Loop detector technology. Traffic counts (flows) and speeds for every lane. Daily minute by minute data. Some uncertainty about the exact location of the loops. Loops not always functioning. Journalistic data missing.

Qn (k ) =

X

qµ,Nµ (k )

∀n

µ∈In

The turning rate βnm (k ) is defined as the percentage of Qn (k ) that leaves through out link m ∈ On during period k . m

qm,0 (k ) = βn (k ) · Qn (k )

∀m ∈ On .

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Validating a motorway network (cont’ed) Addressing those issues... Model used. Second order model METANET. Simulator package providing easy way of set up and configuration. C code available; easy to integrate with developed optimisation algorithms. No change at the core of the simulation program. C code availability allows the use of automatic differentiation (ADOLC package) for gradient based optimisation. Scripts for proper interfacing when the simulator is invoked from the optimisation algorithm. Motorway traffic flow model equations.

Model equations

ρm,i (k + 1)

=

qm,i (k ) vm,i (k + 1)

= =

ρm,i (k ) + L Tλ [qm,i−1 (k ) − qm,i (k )] m m ρm,i (k )vm,i (k )λm vm,i (k ) T {V [ρ

(k )]−v

(k )}

m,i m,i + τ + LT vm,i (k )[vm,i−1 (k ) − vm,i (k )] m

− τνT L

m

ρm,i+1 (k )−ρm,i (k ) ρm,i (k )+κ

 −δTqµ (k )vm,1 (k )/(Lm λm (ρm,1 (k ) + κ))  2 −φT ∆λρm,Nm (k )vm,Nm (k ) /(Lm λm ρcr ,m )     ρm,i (k ) αm V [ρm,i (k )] = vf ,m exp − α1 ρ m

cr ,m

ν (anticipation constant), κ (numerical stability constant), ρcr ,m (critical density), and αm are model parameters to be determined.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Spatial extension of the model parameters Fundamental diagram. Global network-wide parameters for the speed equation.

ν – anticipation constant τ – relaxation constant ρmax – maximum density vmin – minimum speed δ – on-ramp term φ – lane drop term κ – numerical stability Fundamental diagram parameters for a motorway link m (uniform geometry). Qe [ρm,i (k )] =     ρm,i (k ) αm vf ,m ρm,i (k ) exp − α1 ρ m

cr ,m

free speed vf ,m exponent αm critical density ρcr ,m (the most important one) Overparametrization: try to use as few as possible FDs. How to decide the number, limits and spatial extension of the fundamental diagrams used?

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Fundamental diagram decisions and validation process... Two-phase approach in previous work for the large scale motorway network of Amsterdam Phase 1: quantitative validation. Split the network into representative motorway stretches and perform model calibration for each one. Outcome: estimate the optimal parameter set for each part of the network.

Phase 2: qualitative validation. Use optimal parameter sets to similar motorways and manual tuning of turning rates. In this work: only quantitative validation based on data; reduced need for qualitative validation.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

Available MIDAS data Locations of loop detectors. Entry and exit points. They provide the boundary conditions (demand, speed and density). At bifurcations. Turning rate trajectories. Along the motorway. Comparison points; data are used for calculating the error.

Data available from loop detectors. Used data: traffic counts per minute and time mean speeds. yj,q (k ) the flow measurement at location j at model time step k . Pλm yj,q (k ) = y (k ) `=1 j,`,q

N (k ) `=1 j,` Pλm Nj,` (k )

0

20

40

110 100 90 80 70 60 50 40 30 20 60 80 100 120 140 160 180 Time (mins)

Flow

Turning Rate

`=1 vj,` (k )

where Nj,` is the number of vehicle counts at lane ` of location j.

6500 6000 5500 5000 4500 4000 3500 3000 2500

0.8 0.7 0.6 0.5 0.4 0.3 0.2

0

20

40

Velocity (km/h)

Pλm

yj,v (k ) =

Flow (veh/h)

Lane time mean speeds are measured vj,` (k ). The time mean speeds are used to estimate the space mean speeds. Assumption: there are homogenous traffic conditions along the lane length. Hence, the lane’s space mean speed is equal to the lane’s time mean speed. The cross-lane segment’s space mean speed is estimated as

Measurements are organised in vector b x.

Velocity

60

80 100 120 Time (mins)

140

160

180

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

The model calibration optimisation problem For a motorway network with: M1 links M2 entry points M3 exit points M4 junctions requiring turning rates M5 measurement locations used for the error calculation The optimisation problem at hand is

The vector of parameters z is a more complicated story... If we impose a single fundamental diagram on the whole network z = [τ κ ν ρmax vmin δ φ vf α ρcr ]T . b different fundamental diagrams to be If we allow up to N used   b N b N b T 1 1 1 N z = τ κ ν ρmax vmin δ φ vf α ρcr . . . vf α ρcr .

  min J x(k ), b x(k ) z

subject to

This needs to be extended by assigning to each fundamental diagram a starting link l. Hence the parameter’s vector becomes

x(k + 1) = f [x(k ), d(k ); z] , x(0) = x0 zmin ≤ z ≤ zmax x=

T

 ρ1,1 v1,1 . . . ρ1,N v1,N 1

1

. . . ρ1,M v1,1 . . . ρ1,N 1

M1

v1,N

M1

  b N b N b N b T 1 1 1 1 N z = τ κ ν ρmax vmin δ φ vf α ρcr l . . . vf α ρcr l

 T µM µ d = q1 v1 . . . qM vM ρ1 . . . ρM β1 1 βM 4

b where l ι ∈ [1, M1 + 1], ι = 1, . . . , N.

h iT b x = y1,q y1,v . . . yM ,q yM ,v 5 5

Algorithm for splitting the whole network into large sections.

2

2

3

4

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Problem formulation

The problem’s objective function Flow square error Jj,q (x, b x) from sensor j is given by K h i2 X Jj,q (x, b x) = yj,q (k ) − qm ,i (k ) j j k =1

Automatic assignment of FDs; penalty terms Jp (z) included Jp (z) =

PN−1 PN b b ι=1

r =ι+1

Speed square error

Jj,v (x, b x) =

K h i2 X yj,v (k ) − vm ,i (k ) . j j

k =1

h  wv vfι − vfr 2  ι +wρ ρcr − ρrcr 2i ι r 2 +wα α − α

where wv , wρ and wα are weights penalising FD parameters’ variance. The objective function becomes

Weighted total error Je is  J x, b x, z = Je (x, b x) + wp Jp (z) M4

Je (x, b x) =

i Xh Aq Jj,q (x, b x) + Av Jj,v (x, b x) j=1

where Aq and Av are scaling factors.

where wp a total penalty weight. But we are also using Aq = 0 and Av = 1 and different weights for gradient based algorithm.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Small sites

Two simple sites

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

System structure

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

Particle Swarm Optimisation – basic structure ξ

ξ

ξ

At iteration ξ particle ι is at position zξ ι = [zι,1 , zι,2 , . . . , zι,Γ ] within C and has directional velocity θιξ

=

ξ ξ ξ [θι,1 , θι,2 , . . . , θι,Γ ].

Update of ι’s directional velocities and positions: ξ+1 θι,γ

=

h i h i ξ ξ ξ ξ ξ ωθι,γ + c1 r1 πι,γ − zι,γ + c2 r2 zh ,γ − zι,γ ι

ξ+1 zι,γ

=

ξ ξ+1 zι,γ + θι,γ

ω is the inertia weight, c1 , c2 are acceleration coefficients, r1 , r2 are random numbers in the domain [0, 1], ξ

ξ

ξ

πι ξ = [πι,1 , πι,2 , . . . , πι,Γ ] is the best position previously found by particle ι until iteration ξ and hι is the index of the best particle within the neighbourhood of ι. Many variations exist; we used 7 of those.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

PSO algorithms used for Heathrow and Sheffield

APSO-09 APSO-12 APSO-14 HEPSO CEPSO-12 GPSO LPSO Simple GA (baseline) Heathrow: Monday 8th , 15th and 22nd of February 2010 Sheffield: Monday the 1st , 8th and 15th of June 2009.

Summary of best objective value for each algorithm (H = Heathrow and S = Sheffield) H 8th H 15th H 22nd S 1st S 8th S 15th GA 5384538 5858308 6739297 6595545 7024323 7619637 GPSO 3792653 3142996 2466972 4387156 5644626 3913927 LPSO 3785607 1997553 1893783 3956224 4399481 3902504 APSO-09 5108443 2613920 1882825 4530514 5542426 4414949 APSO-12 6541304 2934669 3478906 4841882 7178995 5257622 APSO-14 4357332 5823782 4222196 4366692 7530088 5295245 HEPSO 2585451 2389230 1928796 3797889 4453520 4061613 CEPSO 3801993 3215278 2092989 4567079 5299468 4881406 CS 5733080 3806055 6468042 6273483 6293645 6649381 MCS 5440922 3988003 6483786 7278220 6840414 7581395

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

7e+06

H8-1 H8-2 H8-3 H15-1 H15-2 H15-3 H22-1 H22-2 H22-3

6e+06 5e+06 4e+06

S1-1 S1-2 S1-3 S8-1 S8-2 S8-3 S15-1 S15-2 S15-3

2e+06 1e+06 0

GPSO

5e+06 4.5e+06 4e+06 3.5e+06 3e+06 2.5e+06 2e+06 1.5e+06 1e+06 500000 0

LPSO

APSO-09

APSO-12 Algorithm

APSO-14

HEPSO

CEPSO

H8 H15 H22 S1 S8 S15

SO GP

O O O 09 12 14 LPS PSO- PSO- PSO- HEPS CEPS A A A Algorithm

Dierence to best found objective value

3e+06

Dierence to best found objective value

Dierence to best found objective value

Algorithm perfromance (difference from the best)

6e+06

S1-1 S1-2 S1-3 S1-4 S1-5 S1-6

5e+06 4e+06 3e+06 2e+06 1e+06 0

SO

GP

O

LPS

O O 09 12 14 SO- PSO- PSO- HEPS CEPS AP A A Algorithm

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

PSO algorithm convergence for Heathrow 1e+07

GA GPSO LPSO APSO-09

Best Objective Value

9e+06

APSO-12 APSO-14 HEPSO CEPSO

CS MCS

8e+06 7e+06 6e+06 5e+06 4e+06

1e+07

3e+06

50000 100000 Function Evaluations

150000

H8th 1e+07

GA GPSO LPSO APSO-09

9e+06

APSO-12 APSO-14 HEPSO CEPSO

CS MCS

Best Objective Value

0

Best Objective Value

GA GPSO LPSO APSO-09

9e+06

2e+06

7e+06 6e+06 5e+06 4e+06 3e+06

7e+06

2e+06 0

50000 100000 Function Evaluations

5e+06

H22nd

4e+06 3e+06 2e+06 0

50000 100000 Function Evaluations

H15

th

150000

CS MCS

8e+06

8e+06

6e+06

APSO-12 APSO-14 HEPSO CEPSO

150000

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

PSO algorithm convergence for Sheffield 9e+06

GA GPSO LPSO APSO-09

Best Objective Value

8e+06

APSO-12 APSO-14 HEPSO CEPSO

CS MCS

7e+06

6e+06

5e+06 9e+06

GA GPSO LPSO APSO-09

4e+06 0

50000 100000 Function Evaluations

150000

S1st 9e+06

GA GPSO LPSO APSO-09

Best Objective Value

8e+06

APSO-12 APSO-14 HEPSO CEPSO

CS MCS

Best Objective Value

8e+06

APSO-12 APSO-14 HEPSO CEPSO

CS MCS

7e+06

6e+06

5e+06

4e+06

7e+06

0 6e+06

50000 100000 Function Evaluations

S15th

5e+06

4e+06 0

50000 100000 Function Evaluations

S8th

150000

150000

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

Solutions for the Sheffield site

2500

φ 0.038 0.360 0.122

2000 Flow (veh/hr/lane)

Optimal solutions found for Sheffield site model calibration. τ κ ν vmin ρmax δ 1st 32.34 28.63 55.90 7.48 183.13 0.844 th 8 10.22 20.06 20.00 7.99 184.24 0.001 15th 19.09 5.89 23.39 8.00 173.38 0.001

1500 1000 500

1st

Sheffield optimal solutions for FD parameters. ρcr vf α Start link

0 0

FD 1 FD 2 FD 3

27.23 30.19 26.68

122.36 105.35 109.75

2.6760 2.3494 1.1386

1 8 10

7 9 10

FD 1 FD 2 FD 3

31.53 28.50 38.02

122.22 113.77 104.72

2.5587 1.8865 1.0724

1 4 10

3 9 10

FD 1 FD 2 FD 3

28.43 31.88 35.17

115.96 103.43 104.73

2.1077 2.0904 1.1459

1 8 10

7 9 10

8th

15th

20

40

60

80

100

120

Density (veh/km/lane)

End link

1: 1–7 1: 8–9 1: 10

8: 1–3 8: 4–9 8: 10

15: 1–7 15: 8–9 15: 10

L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 0.9km7.1km1.9km0.8km3.4km 2.4km 1.6km 2.3km 0.7km0.8km Nottingham Leeds Leicester J30

J31

M18

J33

J34

Sheffield verification total square error Calibrated 1 Calibrated 8 Calibrated 15

S1st 3782550 14388131 7578581

S8th 9741511 4382314 10574672

S15th 7764030 20064014 3858505

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

Calibration results – Sheffield site

60

2000

40

1000

20

0 06:00

0 07:00

08:00

09:00

140

6000

120

5000

100

4000

80

3000

60

2000

40

1000

20

0 06:00

Velocity (km/h)

Flow (veh/h)

Link 6: downstream of M18 merge 7000

0 07:00

08:00

09:00

Time (mins)

S1st

7000

140

6000

120

5000

100

4000

80

3000

60

2000

40

1000 08:00

S15th

09:00

7000

140

6000

120

5000

100

4000

80

3000

60

2000

40

1000

L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 0.9km7.1km1.9km0.8km3.4km 2.4km 1.6km 2.3km 0.7km0.8km Nottingham

Velocity (km/h)

Flow (veh/h)

140 120 100 80 60 40 20 0

0 07:00

Link 6: downstream of M18 merge

Leeds Leicester

20

0 06:00

140 120 100 80 60 40 20 0

20

0 06:00

Velocity (km/h)

Flow (veh/h)

Model flow Meas. flow Model velocity Meas. velocity Link 5: upstream of M18 merge

Link 5: upstream of M18 merge 7000 6000 5000 4000 3000 2000 1000 0 06:00 07:00 08:00 09:00 Link 6: downstream of M18 merge 7000 6000 5000 4000 3000 2000 1000 0 06:00 07:00 08:00 09:00 Time (mins) Model flow Meas. flow Model velocity Meas. velocity

Velocity (km/h)

80

3000

Velocity (km/h)

100

4000

Flow (veh/h)

120

5000

Flow (veh/h)

140

6000

Velocity (km/h)

Flow (veh/h)

Link 5: upstream of M18 merge 7000

J30

0 07:00

08:00

09:00

Time (mins) Model flow Model velocity

Meas. flow Meas. velocity

S8th

J31

M18

J33

J34

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

Verification results – Sheffield

Flow (veh/h)

140 120 100 80 60 40 20 0

Flow (veh/h)

140 120 100 80 60 40 20 0

140 120 100 80 60 40 20 0

Velocity (km/h)

Flow (veh/h)

140 120 100 80 60 40 20 0

Flow (veh/h)

Link 5: upstream of M18 merge 7000 6000 5000 4000 3000 2000 1000 0 06:00 07:00 08:00 09:00 Link 6: downstream of M18 merge 7000 6000 5000 4000 3000 2000 1000 0 06:00 07:00 08:00 09:00 Time (mins) Model flow Meas. flow Model velocity Meas. velocity Link 5: upstream of M18 merge 7000 6000 5000 4000 3000 2000 1000 0 06:00 07:00 08:00 09:00 Link 6: downstream of M18 merge 7000 6000 5000 4000 3000 2000 1000 0 06:00 07:00 08:00 09:00 Time (mins) Model flow Meas. flow Model velocity Meas. velocity

Velocity (km/h)

Verification of the Sheffield model using input data from set S15th and using the optimal parameter set based on (a) the S1st data set and (b) the S8th data set.

Velocity (km/h)

(a) L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 0.9km7.1km1.9km0.8km3.4km 2.4km 1.6km 2.3km 0.7km0.8km Nottingham Leeds Leicester

Velocity (km/h)

J30

(b)

J31

M18

J33

J34

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Evolutionary algorithms

Evolutionary algorithms...

The simplest variant LPSO performs better... better setting for evaluation may be necessary but not strong evidence against this conclusion. PSO outperforms simple GA (baseline case anyhow) and Cuckoo search. Computation time still an issue, but in principle does not pose a problem since model calibration is “rest and digest” functionality in a TCC’s information ecosystem, so there should be amble time to perform it periodically and for specific days, months, special events etc. A. Poole and A. Kotsialos, “Swarm intelligence algorithms for macroscopic traffic flow model validation with automatic assignment of fundamental diagrams,” Applied Soft Computing, Vol. 38, pp. 134–150, 2016.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Gradient based algorithms

Improve convergence? maybe if we use gradient based optimisation for the calibration problem. We need a way to calculated the gradient  ∂J (x,b x,z) ∂z1    ∂J (x,bx,z) b, z =  ∂z2 ∇Jz x, x   ...  ∂J (x,b x,z)

      

∂zΓ

We can apply then a gradient-based optimisation algorithm. Difficult to obtain analytical expressions. Estimate the derivatives using Automatic Differentiation (AD)  b, z software technology to approximate ∇Jz x, x

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Gradient based algorithms

Using AD Taking some liberty with notation we can rewrite the optimisation problem as   minz J simulate for k = 0, . . . , K − 1: x(k + 1) = f [x(k ); z] , x(0) = x0 , b x, z subject to zmin ≤ z ≤ zmax Because of the way links are modelled in METANET   b b b T b number of links (not of segments). with N= z = τ κ ν ρmax vmin δ φ vf1 α1 ρ1cr . . . vfN αN ρN cr ADOL-C (the AD software) can provide us with the Jacobian matrix ∂x as we perform the simulation ∂z (forward integration), i.e. we get an approximation of  ∂x(1) ∂z1   ∂x(2)  ∂z1  ∂x  =  . ∂z  .  . 

∂x(K ) ∂z1

∂x(1) ∂z2

...

∂x(1) ∂zΓ



∂x(2) ∂z2

...

∂x(2) ∂zΓ

         

. . .

.

∂x(K ) ∂z2

.

. . .

.

...

∂x(K ) ∂zΓ

Using the chain rule ∇Jz = ∂Jv ∂x

and

∂Jp ∂z

∂Jv T ∂x ∂x

∂z

!T +

∂Jp ∂z

 =

are calculated analytically (quadratic terms).

The result is a nonlinear simply bounded optimisation problem.

∂x ∂z

T

∂Jv ∂x

+

∂Jp ∂z

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Gradient based algorithms

The RPROP algorithm The ∇Jz is an approximation. We need an algorithm that can accommodate for these errors. RPROP

RPROP algorithm for optimisation A. Kotsialos, “Nonlinear optimisation using directional step lengths based on RPROP,” Optimization Letters, Vol. 8, nr 4, pp. 1401–1415, 2014. A. Kotsialos, “Non-smooth optimization based on resilient backpropagation search for unconstrained and simply bounded problems,” Optimization Methods and Software, Vol. 28, nr 6, pp. 1282–1301, 2013.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation Gradient based algorithms

METANET + ADOL-C + RPROP Parent

Child

Parent

Child

Create SHM x for ∂ ∂z

Create SHM x for x and ∂ ∂z

Create model input files

Create model input files

Create Child

Create Child

Start

Open child read pipe

Open parent write pipe

Read data from pipe

Run model: pipe/SHM

Start

Run model: SHM

1 2 . . . K

Jacobian SHM

Wait for child to complete

k

k

1

1

2 . . . K

2 . . . K Jacobian

∂x ∂z

End

PIPE

SHM

k

SHM

Wait for child to complete

∂x ∂z

End

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

A much larger network at Manchester M66

M62 M61

M60

M62

M602

M60

M56

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

Automatic sectioning of the network M66

M62 M61

M60

M62

M602

M60

M56

Section

Motorways

Origins

Destinations

Links

Length

0 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

A5103/M56 M61 M60 (+M62,M66) M62/M602 M60 (+M62,M66) M602 A5103/M56 M60 M56 M60/A5103 M61/A580 M61/M60 M60/R’bout M60/M61 A580 M60/M602 M60 M60/A5103 M66/R’bout M62/M60 M66/R’bout M56 M62 M61 M60/R’bout M602/M60 R’bout/M60 M60/M62 R’bout/M60 M62/M60 R’bout/M62 M60/M602 R’bout/M66 M602/M60 R’bout R’bout R’bout R’bout R’bout

5 2 19 1 20 1 4 1 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

4 0 18 1 20 0 5 0 1 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

9 4 49 5 51 3 9 1 3 1 3 1 2 1 1 2 1 1 2 2 2 3 3 2 2 2 2 1 2 4 2 1 2 1 8 1 1 1 1

6.90 3.15 62.50 6.55 62.27 1.50 7.00 0.90 3.45 0.70 2.30 1.20 0.90 1.00 0.80 0.90 0.45 1.30 0.90 0.90 0.90 3.55 1.80 1.70 0.90 1.15 0.90 0.80 0.90 2.35 0.90 0.50 0.90 0.50 1.80 0.45 0.45 0.45 0.45

TOTAL

56

55

192

186.92

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

Main sections for Manchester site M66

M66

M62

M62

M61

M61

M60

M62

M602

M60

M60

M62

M602

M60

M56

M56

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

Some of the minor ones M66

M66 S20

S24

S32

M62 S10

S12

M61

S26

M61 S23

S18 S7

M62

S30

M62

S1

S14

S3

M60 M602

S5

S19

M62

S15

M60 M602

S22

M60

S28 S11

S25

M60

S17

S8

S9 S21 S0

S6

M56

M56

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

40 35 30 25 20

Alpha

J18

S24 S30 J17

S22 S19 S23 S1 J14 J15 J16

J7

J6

J9

J8 J9 J10 J11 J12 J13

S9 J5

J2 J3/4

J25 J26 J27 J1

J24

S21

4000 3500 3000 2500 2000 1500 1000 500 0 130 120 110 100 90 80 70 60 50 45 40 35 30 25 20

4

4

3.5

3.5

3

J23

J18 J19 J20 Capacity

Critical Density

(km/h)

Free Speed

(veh/lane)

J18

J19

J20

J21

J22

J23

J25

J24

J27

45

J24 J25 J21 J22

S20 S26

S18 S32 J1

J5

J6

J3/4 J2

J7

J11

J9

J10

J8

J12

J13

J16

J17

J18

S8

3 Alpha

Capacity

S17

(veh/km/lane)

(km/h)

S13 S11 S15 S29

4000 3500 3000 2500 2000 1500 1000 500 0 130 120 110 100 90 80 70 60 50

(veh/km/lane)

Critical Density

Free Speed

(veh/lane)

S12S28

J15 J14

62-J18

LPSO calibration results – sections 2 & 4

2.5 2 1.5

2.5 2 1.5

1

1

0.5

0.5

0

10

20

30

40

50

60

0

10

20

Distance (km) 14

21

28

30

40

Distance (km) 14

21

28

50

60

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

LPSO calibration contours – sections 2 & 4

Data

Model

S32 S18

60

Data

120

100

50

Model

120

60

S30 S24 S1 S23

50

100

S19 S22

20

30

40

20

20

10

S21

J25 J24

S29 S15 S11 S13

10

07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

0

60

40

20

S28 S12 0

80

S9

S26 S20 07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

Velocity (km/h)

60

S17

J9

40 Distance (km)

Distance (km)

S8

30

Velocity (km/h)

80

40

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

40 35 30 25 20

Alpha

J18

S24 S30 J17

S22 S19 S23 S1 J14 J15 J16

J7

J6

J9

J8 J9 J10 J11 J12 J13

S9 J5

J2 J3/4

J25 J26 J27 J1

J24

S21

4000 3500 3000 2500 2000 1500 1000 500 0 130 120 110 100 90 80 70 60 50 45 40 35 30 25 20

4

4

3.5

3.5

3

J23

J18 J19 J20 Capacity

Critical Density

(km/h)

Free Speed

(veh/lane)

J18

J19

J20

J21

J22

J23

J25

J24

J27

45

J24 J25 J21 J22

S20 S26

S18 S32 J1

J5

J6

J3/4 J2

J7

J11

J9

J10

J8

J12

J13

J16

J17

J18

S8

3 Alpha

Capacity

S17

(veh/km/lane)

(km/h)

S13 S11 S15 S29

4000 3500 3000 2500 2000 1500 1000 500 0 130 120 110 100 90 80 70 60 50

(veh/km/lane)

Critical Density

Free Speed

(veh/lane)

S12S28

J15 J14

62-J18

RPROP calibration results - sections 2 & 4

2.5 2 1.5

2.5 2 1.5

1

1

0.5

0.5

0

10

20

30

40

50

60

0

10

20

Distance (km) 14

21

28

30

40

Distance (km) 14

21

28

50

60

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

RPROP calibration contours – sections 2 & 4

Data

Model

S32 S18

60

Data

120

100

50

Model

120

60

S30 S24 S1 S23

50

100

S19 S22

20

30

40

20

20

10

S21

J25 J24

S29 S15 S11 S13

10

07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

0

60

40

20

S28 S12 0

80

S9

S26 S20 07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

Velocity (km/h)

60

S17

J9

40 Distance (km)

Distance (km)

S8

30

Velocity (km/h)

80

40

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

40 35 30 25 20

Alpha

J18

S24 S30 J17

S22 S19 S23 S1 J14 J15 J16

J7

J6

J9

J8 J9 J10 J11 J12 J13

S9 J5

J2 J3/4

J24

J25 J26 J27 J1

S21

4000 3500 3000 2500 2000 1500 1000 500 0 130 120 110 100 90 80 70 60 50 45 40 35 30 25 20

4

4

3.5

3.5

3

J23

J18 J19 J20 Capacity

Critical Density

(km/h)

Free Speed

(veh/lane)

J18

J19

J20

J21

J22

J23

J25

J24

J27

45

J24 J25 J21 J22

S20 S26

S18 S32 J1

J5

J6

J3/4 J2

J7

J11

J9

J10

J8

J12

J13

J16

J17

J18

S8

3 Alpha

Capacity

S17

(veh/km/lane)

(km/h)

S13 S11 S15 S29

4000 3500 3000 2500 2000 1500 1000 500 0 130 120 110 100 90 80 70 60 50

(veh/km/lane)

Critical Density

Free Speed

(veh/lane)

S12S28

J15 J14

62-J18

RPROP, LPSO and HEPSO comparison; data set of the 14th for sections 2 & 4

2.5 2 1.5

2.5 2 1.5

1

1

0.5

0.5

0

10

20

30

40

50

60

0

10

20

Distance (km) RPROP

LSPO

HEPSO

30

40

Distance (km) RPROP

LPSO

HEPSO

50

60

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

RPROP verification for sections 2 & 4; optimal parameter set of the 14th applied on the 21st data

Data

Model

S32 S18

60

Data

120

100

50

Model

120

60

S30 S24 S1 S23

50

100

S19 S22

20

30

40

20

20

10

S21

J25 J24

S29 S15 S11 S13

10

07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

0

60

40

20

S28 S12 0

80

S9

S26 S20 07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

Velocity (km/h)

60

S17

J9

40 Distance (km)

Distance (km)

S8

30

Velocity (km/h)

80

40

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

LPSO verification for sections 2 & 4; optimal parameter set of the 14th applied on the 21st data

Data

Model

S32 S18

60

Data

120

100

50

Model

120

60

S30 S24 S1 S23

50

100

S19 S22

20

30

40

20

20

10

S21

J25 J24

S29 S15 S11 S13

10

07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

0

60

40

20

S28 S12 0

80

S9

S26 S20 07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

Velocity (km/h)

60

S17

J9

40 Distance (km)

Distance (km)

S8

30

Velocity (km/h)

80

40

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

RPROP and LPSO verification (14th → 21st) RPROP LPSO S32 S18

60

S17

20

80

S8

30

S11 S13

40

20

20

10

40

S29 S15 S11 S13

S28 S12 0

07:00

08:00

09:00

07:00

08:00

Time

Time

Data

Model

0

120

60

S1 S23

07:00

08:00

09:00

07:00

08:00

Time

Time

Data

Model

100

120

S30 S24 S1 S23

50

S19 S22

S21

J25

20

J24

10

0

S26 S20 07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

60

80

S9 30

40

20

20

10

0

J9

40 Distance (km)

Distance (km)

80

S9 30

100

S19 S22

Velocity (km/h)

J9

40

0

09:00

60

S30 S24

50

20

S28 S12 0

09:00

60

S17

S29 S15 10

120

100

40 Distance (km)

30

Velocity (km/h)

S8

S32 S18

50

80

40

Model

60

100

50

Distance (km)

Data

120

Velocity (km/h)

Model

0

S21

J25 J24

60

40

20

S26 S20 07:00

08:00 Time

09:00

07:00

08:00 Time

09:00

0

Velocity (km/h)

Data 60

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Macroscopic Traffic Flow Model Validation A larger network

Conclusions for model calibration algorithms Macroscopic traffic flow model calibration of large scale motorway networks. Optimisation problem formulation very important for obtaining relevant solutions. Solutions generalise well. Automatic assignment of fundamental diagrams over the whole network. Avoid over-parametrization. Gradient based optimisation using RPROP possible thanks to automatic differentiation and RPROP convergence properties. LPSO version of PSO works better than more recent variations of PSO algorithms. Macroscopic simulator can be changed and the methodology still works; preliminary work with the cell transmission model.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Hierarchical model predictive control

Road Network Traffic Model Predictive Control Integrated ramp metering, motorway-to-motorway control, route guidance and variable speed limits control is formulated as an optimal control problem. The discrete time optimal control problem has the form min J = u

K −1 X

ϕ [x(k ), u(k ), d(k )] + ϑ [x(K )]

k =0

subject to x(k + 1) = f [x(k ), u(k ), d(k )] , x(0) = x0 umin ≤ u(k ) ≤ umax where x is the state vector u is the control vector, and d(k ) is the disturbance vector.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Hierarchical model predictive control

...for traffic network models... Second order model ρm,i (k + 1)

=

qm,i (k ) vm,i (k + 1)

= =

ρm,i (k ) + L Tλ [qm,i−1 (k ) − qm,i (k )] m m ρm,i (k )vm,i (k )λm vm,i (k )

T {V [ρm,i (k )]−vm,i (k )} + τ T + L vm,i (k )[vm,i−1 (k ) − vm,i (k )] m ρ m,i+1 (k )−ρm,i (k ) − τνT Lm ρm,i (k )+κ  −δTqµ (k )vm,1 (k )/(Lm λm (ρm,1 (k ) + κ))  2 −φT ∆λρm,Nm (k )vm,Nm (k ) /(Lm λm ρcr ,m ) x=     ρm,i (k ) αm V [ρm,i (k )] = vf ,m exp − α1 ρ m cr ,m

Second order model + queue model state h ρ1,1 v1,1 . . . ρ1,N v1,N 1

1

. . . ρM,N

M

vM,N

M

w1 . . . wO

iT

  µ Disturbance d = d1 . . . dO βn . . . T Control vector (lets assume all on-ramps are controlled) u = [r1 , . . . rO ]T

Queueing model ˜o (k ) qo (k ) = ro (k )q ˜o (k ) = min q ˜o,1 (k ), q ˜o,2 (k ) q ˜o,1 (k ) = d(k ) + w(k ) q T  ρmax −ρµ,1 (k ) ˜o,2 (k ) = Qo min 1, q ρ −ρ max

cr ,µ

Open loop optimal control solution: u∗ (k ) and x∗ (k ), k = 0, . . . , K . control sample time Tc = zc T , zc ∈ N∗ .

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Hierarchical model predictive control

Hierarchical control system

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Optimisation layer for coordinated ramp metering

Optimality conditions Let us assume there are p different classes of control measures with sample time Tc,` = z` T , ` = 1, . . . , p. The control time step at model time step k is $ k` =

k

KKT conditions on the Lagrangian for a known u(k ) yield g` (k` )  = Pb ∂ϕ(k )

%

k =a

∂u` (k` )

∂f(k )T



+ ∂u (k ) λ(k + 1) ` `

z` where

h iT u(k ) = u(k1 )T . . . u(kp )T Objective function  PK −1 P P ρm,i (k )vm,i (k )λm + wo (k ) n oo Pk =0 2 + o af [ro (k ) − ro (k − 1)] + aw ψ [wo (k )]2

J =

T

where ψ [wo (k )] = max {o, wmax − wo (k )}

a = k` z` b = min {(k` + 1)z` − 1, K − 1} k` = 0, . . . , K`  K −1 if K mod z` = 0 jz` k K` = K  otherwise z `

and the Lagrange multipliers are obtained by a backwards integration

The problem’s Lagrangian is λ(k ) = KX −1

L = J−

k =0

∂f(k )T ∂x(k )

λ(k + 1) +

λ(k +1) {x(k + 1) − f [x(k ), u(k ), d(k )]} with λ(K ) =

∂ϑ(x(K )) ∂x(K )

∂ϕ(k ) ∂x(k )

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Optimisation layer for coordinated ramp metering

Line search optimisation Step 1 Set iteration index ι = 0. Select initial control trajectory u(0) . Step 2 Perform a forwards integration of x(ι) (k + 1) = f(k ) for known u(ι) to obtain the state x(ι) (k ). Step 3 With known x(ι) u(ι) perform a backwards integration to calculate the Lagrange multipliers λ(ι) (k ). Step 4 With known x(ι) u(ι) and λ(ι) (k ) calculate the gradient g(ι) . Step 5 Solve the line search optimisation subproblem: h  i (ι) (ι) α = arg min J sat u + αs where s(ι) is a search direction method calculated from current and previous information collected over the optimisation iterations.

Search direction methods include (Fletcher, Practical Methos of Optimisation) Steepest descent Conjugate gradient: Fletcher-Reeves, Polak-Ribiere. Quasi-Newton methods: BFGS, DFP RPROP Typically, for solving the line search subproblem about 6 to 8 gradient evaluations for the bracketing and sectioning phases. RPROP performs only one gradient evaluation at each iteration. Non-smooth conditions in the model, but continuous.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Optimisation layer for coordinated ramp metering

The A’dam network and search direction methods (4h horizon)

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

The open loop optimal state

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

Rolling into time

30 minutes ahead

60 minutes ahead

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

Impact of prediction and application horizons

30 minutes ahead, application 30 minutes

60 minutes ahead, application 30 minutes

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

Direct control layer

How to do the job? We have u∗ , qo∗ (k ) and x∗ (k ) for the application horizon. Employ local controllers at each on-ramp. Different choices: Realise directly the optimal flows qo∗ (k ). ALINEA with dynamic set points

ρ b(ka ) =

1

(za ka +1)−1 X

za ka



ρµ,1 (k )

k =za ka

and ALINEA applied as    ˜o (ka + 1) = min Ro (ka ) + KA ρ q b(ka ) − ρµ,1 (k ) , qo,min Queue control as well.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

Investigations for disturbance prediction errors

scen. nr.

error

1 2 3 4 5

+5% +10% -5 % -10% 0%

AMOC+ALINEA (veh.∗h) 7,841.88 8,486.30 8,443.75 8,722.20 7,971.67

AMOC (veh∗h) 8,834.42 8,903.91 10,956.35 11,098.68 8,244.27

Overestimating demand is good. Similar direction of overestimation for all ramps. What happens if we overestimate the demand? Urban on-ramp storage capacity 100 veh. and motorway 200 veh. METANET has exact turning rates, AMOC their constant average. Horizons: (HP , HA ) = (60, 10) minutes. Implement AMOC (optimal flows) or ALINE+AMOC.

The direct control layer is computationally not intensive (cannot afford it anyhow). Emphasis on heuristic rules for setting up the parameters of the local controllers.

Computational Methods for Macroscopic Model Validation and Model Predictive Control Algorithms for Road Network Traffic Model Predictive Control Rolling horizon

Conclusions for hierarchical control Hierarchical model predictive control requires a very efficient optimisation solver. RPROP is suitable for fast convergence and quality of solutions. Direct control layer improves the solution’s implementation. It is not computationally demanding but needs fast communications and clever design. Overestimation of disturbances is allowable for the optimal control problem, but needs the existence of a suitable direct control layer. Large scale networks like that of Manchester feasible to control.