POD Based MPC Controllers
POD Based MPC Controllers
K. U. LEUVEN
Introduction
Many physical systems
Heat Exchangers
spatial
C C
E
discretization
modeled v k0Ce RT
t z
Tubular reactors
by T T
E
v Gr Ce RT H r (Tw T )
t z
… High-dimensional
Ri
River systems
t models
Reduced-order
models x (t ) F x(t ), u(t )
Allow the design of
Large number of states
a (t ) ΦTn F Φ na(t ),
) u(t )
Few number of states What to do?
Depending of the field of application, POD is also known by other names such as:
other names ….
We can trace
t ace the idea of POD back to independent investigations
in estigations by
b Kosambi (1943),
(1943)
Loève (1945), Karhunen (1946), Pougachev (1953) and Obukhov (1954).
However if we consider the history of PCA and SVD, we can not forget the work of Pearson
who introduced PCA in 1901,
1901
and we have to mention the contributions of Beltrami (1873), Jordan (1874), Sylvester
(1889), Schmidt (1907) and Weyl (1912), who were responsible for establishing the
existence of SVD and developing
p g its theory.
y
x1 (t1 ) x1 (t2 ) x1 (t Nd )
x2 (t1 ) x2 (t2 ) x2 (t Nd )
X x(t1 ),
) x(t2 )), , x(t Nd )
xN (t1 ) xN (t2 ) xN (t Nd )
snapshots
In POD we start by observing that each snapshot can be written as a linear combination of a set
of ordered orthonormal basis vectors (POD basis vectors)
N j N basis vector
x(ti ) a j (ti ) j (1)
j 1 a j (ti ) x(ti ), i Tj x(ti ) coordinate of x(ti) with respect to j
(POD coefficients)
Since the first n most relevant basis vectors capture most of the energy contained in the data,
n
x n (ti ) a j (ti ) j , i 1, 2, , N d , n N .
j 1
In POD, the basis vectors are computed in such a way that the reconstruction of the snapshots
using the first n most relevant basis vectors is optimal in the sense that the Sum Squared Error
(SSE) between x(ti ) and x n (ti )
Nd
En (ti ) x(ti ) x n (ti )
2
2
i 1
is minimized.
minimized Herein 2
denotes the L2-norm
norm or Euclidean norm.
norm
subject to orthonormality
1, if i j condition
iT j
0,
0 otherwise.
th i
The orthonormal basis vectors that solve this problem can be found by computing the Singular
Value Decomposition (SVD) of the snapshot matrix X
1 0 0 Φ N N 1 , 2 , , N
Σ N Nd ΦT Φ ΦΦT I N
X ΦΣΨT N 0 0
Ψ Nd Nd 1 , 2 , , Nd
POD basis 1 2 3 N 0 ΨΨT ΨT Ψ I Nd
vectors
X Φ N N a1 (t1 ) a1 (t2 ) a1 (t Nd )
a ( t ) a ( t ) a (t )
x(t1 ), , x(t Nd ) 1 , , N 2 1 2 2 2 Nd Evolution of the
POD coefficients
aN (t1 ) aN (t2 ) aN (t Nd )
X ΦΓ ΦT Φ I N
n
j 1 j
2 Modeled energy The closer Pn to 1, or similarly the closer
Pn of 1-Pn to 0, the better the approximation
N
j 1 j
2 Total energy
contained in X of X will be.
determines the truncation degree of Ad-hoc rule: n has to be determined for Pn = 0.99
Pn the selected POD basis vectors
by a lower complexity model (a model with less number of states and state equations).
The derivation and selection of the n most relevant basis vectors from an ensemble of
simulation or experimental data of the process described by (2).
(2)
The derivation of the dynamical model for the POD coefficients a1(t), …, an(t) associated to
the selected basis vectors. These coefficients are the states of the reduced-order model.
Galerkin projection
System identification
where the dynamics of the temperature profile T(x, t) is modeled by the following PDE (only
temperature variations in the x-direction
direction are considered) :
T ( x, t ) 2T ( x, t ) Initial conditions: T ( x, 0) h( x)
G (3)
t x 2
Boundary conditions : T (0, t ) u1 (t )
Thermal Conductivity [J s-1 m -1 K -1 ] (Dirichlet Type) 1
T ( L, t ) u2 (t )
G Density [kg m -3 ] 2
cp
cp = Heat
H tC it [J Kg
Capacity K -11 K -11 ] T ( L, t ) u3 (t )
Design a control scheme that allows the system to reach a desired temperature
distribution
d st but o in steady state as fast
ast as poss
possible,
b e, while
e sat
satisfying
sy gp process
ocess co
constraints.
st a ts
Desired temperature
Desired profile
Temperature Profile
70
Parameters of the problem
60
L 0.1 m
[°C ]
50
G 105 m 2 s -1
C)
Temperature (C
40
emperature
30
Initial temperature distribution :
T ( x, t 0) h( x) 0
20
Te
0
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
0 u1 (t ) 150C
x
x [m] 0 u2 (t ) 150C
0 u3 (t ) 150C
This profile corresponds to the steady state
temperature distribution when the bar is heated
f
from 0°C byb constantt t temperatures
t t ( ) = 30°C,
u1(t)
u2(t) = 60°C and u3(t) =10°C.
u1 (k ) u2 ( k ) u3 (k )
x
••• •••
x0 x1 x2 x3 xP 1 xP xP 1 xN 2 xN 1 xN
T i ( k ) T i ( k 1) T ( k ) 2 T i ( k ) T i 1 ( k )
G i 1 (4) Ti (k ) T ( xi , tk )
t x2
N = Number of sections in
Backward difference Approx. Central difference approx. which the bar is divided
P = Grid-point where u2(k)
for i 1, 2, , P 1, P 1, , N 1 is located.
1 2r r 0 0 T1 (k 1)) T1 (k ) r 0 0 t
r 1 2r T (k 1) T (k ) 0 0 0
r G
0 2 2 x 2
0 r r 0
1 2r r TP 2 (k 1) TP 2 (k ) 0 0 0
u1 (k )
0 0 r 1 2r TP 1 (k 1) TP 1 ( k ) 0 r 0
u2 ( k )
1 2 r r 0 0 T
P 1 ( k 1) T ( k
P 1 0) r 0
u3 (k )
r 1 2r TP 2 ( k 1) TP 2 (k ) 0 0 0
0 r r 0
0
1 2r r TN 2 (k 1) TN 2 (k ) 0 0 0
0 0 r 1 2r TN 1 (k 1) TN 1 (k ) 0
0 r
T(k 1) T(k ) B u( k )
A
(5)
1 1
T(k 1) A T(k ) A Bu(k ) The system has 398 states !!!
50
0
T ( x1 , t1 ) T ( x1 , t2 ) T ( x1 , tM )
-50
0 50 100 150 200 250 300 350 400 450 500 T (x , t ) T ( x2 , t2 ) T ( x2 , tM )
150 2 1
100
2(kk)
uu2(k)
N 1 1 N 1 2
u3(k)
50
0
-50
0 50 100 150 200 250 300 350 400 450 500
Tsnap 398500
k
k - samples
p g time Ts = 1 s
Sampling
Switching probability Number of time steps M = 500
for the PBRNS = 2%
-2
10
For this problem, the first n = 10
basis vectors were selected.
-4
10
-6
10 1 Pn 2.454 10-5
-8
10
1-Pn
10
-10
Tn (k ) a j (k ) j Φ n a(k )
10
j 1
1 , 2 ,10
-12
10
with: Φ n
a(k ) a1 (k ),
) a2 (k )), , a10 (k )
-14
10 T
-16
10
0 5 10 15 20 25 30 35 40 45 50
n
-0.05
0 05 0 025
0.025 -0.075
0 075
4 5 6
0.15 0.15 0.15
7 8 9
0.15 0.1 0.2
-0.05 -0.075 0
0.025
“Selected POD basis vectors”
-0.2
0 0.05 0.1
x [m]
and we replace T(k) by its nth order approximation Tn(k), the Galerkin projection states that
the projection of R(Tn(k)) on the space spanned by the basis vectors n vanishes. That is,
Replacing T(k) by its nth order approximation Tn(k)= n a(k) in the discrete model of the system
(5),
Φ na(k 1) A 1Φ n a(k ) A 1Bu(k )
and applying the inner product criterion (Galerkin projection) to the resulting equation, we have
that
Φ na(k 1), j A 1Φ na(k ) A 1Bu(k ), j
j 1, 2, , n 10
we obtain the model for the first n POD coefficients. The reduced order model of the bar with
only 10 states is then given by
(k ) Bu
a(k 1) Aa (k )
Tn (k ) Φ na(k )
100
Subspace
p identification a1 0 a2 0
(k)k)
u1u1(k
50
algorithm -2000
0 100 200 300 400 500
-1000
0 100 200 300 400 500
0 500 500
k k
-50
0 50 100 150 200 250 300 350 400 450 500 a3 0 a4 0
150
-500 -500
0 100 200 300 400 500 0 100 200 300 400 500
100 500 200
k k
k)
k)
a5 a6
uu2(k
50
2(k
0 0
0
-50
z ( k 1) Az (k ) Bu(k ) -500
0 100 200 300 400 500
-200
0 100 200 300 400 500
0 50 100 150 200 250 300 350 400 450 500 200 100
k k
150 a(k ) Cz (k ) Du(k ) a7 0 a8 0
100
-200 -100
3((k)
Tn ( k ) Φ n a ( k )
k)
0 100 200 300 400 500 0 100 200 300 400 500
uu3(k
50 50 50
k k
0
a9 0
a10 0
-50
0 50 100 150 200 250 300 350 400 450 500 -50 -50
0 100 200 300 400 500 0 100 200 300 400 500
k Selected model order: 10
k - samples k k
k - samples k - samples
It offers the best trade-
off between accuracy and
complexity Sampling time Ts = 1 s
1 100
ture [°C]
k=1 k = 25
ET T(k ) T10 (k )
[°C]
922108
error: 0.838564
0.16
50 50 100 k 1
ure
Temperat
Temp. at Time
error: 0.09
Temperatu
0.14
0 0
0.12
[°C]
ure (C)
-50 -50
0.1
Temperatture
0 0.05 0.1 0 0.05 0.1
Temperatu
x x[m] x
x [m]
0.08
100 100
e step k = 80
e step k = 50
k = 50 k = 80
[°C]
ture [°C]
80 80 0.06
280382
042363
error: 0.0ture
60 60
0 04
0.04
Temp. at Time
error: 0.0
Temp. at Time
Temperat
Temperat
40 40
0.02
20 20
0 0 0
0 0.05 0.1 0 0.05 0.1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
x x[m] x x[m] x x[m]
POD model Full-order model
POD model
d l derived
d i d byb means off subspace
b identification
id tifi ti techniques
t h i
k=1 k = 25
[°C
1 100
[°C]]
ET T(k ) T10 (k )
error: 0.844423
error: 0.100039
50 50
Temperature
100 k 1
Temperature
0.25
0 0
0.2
[°C]
Tem
Temperature (C)
-50 -50
0 0.05 0.1 0 0.05 0.1
Temperature
x
x [m] x
x [m] 0.15
100 100
mp. at Time step k = 50
k = 50 k = 80
5C]
2C]
[°C
[°C
80 80
T
error: 0.0555075
error: 0.0850122
0.1
Temperature
Temperature
60 60
40 40 0.05
20 20
Tem
Tem
0 0 0
0 0.05 0.1 0 0.05 0.1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
x
x [m] xx[m] x x[m]
Control goal: to allow the bar to reach a desired temperature distribution in steady state
as fast as possible, while satisfying the process constraints
The control of the temperature profile of the bar is achieved indirectly by controlling the
POD coefficients. The reference for the POD coefficients are calculated as follows:
Temperature
profile
a ref ( k ) MPC u(k ) Full order Model T( k )
Controller of the Bar y (k )
Measurement
Points
aˆ (k ) Kalman
Filter
Kalman Filter
Observer equations:
aˆ (k 1) Aa (k ) L y (k ) yˆ (k )
ˆ (k ) Bu the measured temperatures from
Tn(k)
y (k ) Measured outputs y1(k) and y2(k)
yˆ ( k ) C s Tˆ n ( k ) C s Φ n aˆ ( k )
L Estimator Gain (Kalman gain)
Th Kalman
The K l gain
i is
i the
th one that
th t minimizes
i i i th steady-state
the t d t t covariance
i lim
k
li x(k ) xˆ (k ) x(k ) xˆ (k )
T
of the estimation error x(k ) xˆ (k ) .
For
o calculating
ca cu at g the
t e Kalman
a a gagain tthe
e following
o o g design
des g matrices e e used:
at ces were
106 0
RV 6 R W I10 x10
0 10
Covariance matrix of the measurement Covariance matrix of the process Noise. It tries to
Noise. Its diagonal contains the noise explain unknown disturbances or imperfections in
variance
a a ce oof eac
each p
process
ocess Output ((For
o tthiss the model of the p plant. There is not an specific
p
example such values were assumed). way to select its parameters. (trial and error).
subject to:
(k i ) B
a(k i 1) Aa
A (k i ),
Bu ) i 0,
0 , Np 1
u(k i ) u(k i 1) u(k i ), i 0, , N c 1
u(k i ) u(k i 1), i N c , , N p 1
u min u(k i ) u max , i 0,
0 , Nc 1
The control horizon Nc was set to 7 and the prediction horizon Np was selected according the
following criterion:
Prediction
d h
horizon (Np) = Controll horizon
h (Nc) + Largest settling
l time = 80 samples
l
Parameters:
u min 0 0 0 , u max 150 150 150 , Q I10 , R I 3
T T
40 150
Temperatur
mperature [°C]
20 100
Reference
Temp(C)
Closed-loop
0
Tem
0 0 01
0.01 0 02
0.02 0 03
0.03 0 04
0.04 0 05
0.05 0 06
0.06 0 07
0.07 0 08
0.08 0 09
0.09 01
0.1 50
T
x [m]
Absolute error
0.06 0
ylabel re [°C]
0
0.05
Temperatur
50
0.04
100
0.03 0.1
tk 0.08
150 0.06
0.02 0.04
0 0 01
0.01 0 02
0.02 0 03
0.03 0 04
0.04 0 05
0.05 0 06
0.06 0 07
0.07 0 08
0.08 0 09
0.09 01
0.1 0 02
0.02 x
200 0
x [m] x [m]
[°C]
40
30
rature
y2labrature
30
el
el
y1labe
y1(k) - Temper
y2(k) - Temper
20
20
10
10
0 0
0 50 100 150 200 0 50 100 150 200
samples
samples- -kk samples
samples -- kk
130 150 80
[[°C]
[°C]
[°°C]
104
125 60
u2(k) - Temperature
Temperature
Temperature
78
u1label
u2label
u3label
100 40
52
u1(k) - T
u3(k) - T
75 20
26
0 50 0
0 100 200 0 100 200 0 100 200
samples
samples --kk samples
samples--kk samples
samples -- kk
ylabel [°C]
20°C +
40
Temperature
20
y1 (t ) y2 (t ) Reference
Closed-loop
0
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
xlabel
x [m]
T ( x 0, t ) u1 (t ) 20C Absolute error
15
ylabel [°C]
maximum
10 deviation =14.22 °C
mperature
Remark :
5
The poor performance was an
Tem
with a N P a( k 1); a(k 2); ; a( k N p ) u Nc u(k ); u(k 1); ; u(k N c 1)
Since the disturbance d(k) and the state a(k) are unknown, they must be estimated by a new
Kalman filter:
aˆ (k 1) A F aˆ (k ) B
La
ˆ
0 1 ˆ u ( k ) L y (k ) yˆ (k )
d (k 1) 0
d (k ) d
yˆ ( k ) C s Tˆ n ( k ) C s Φ n aˆ ( k )
The number of disturbance terms that can be estimated without losing observability is
equal to the number of sensors.
Disturbance model
Since we are interested in rejecting the disturbance associated to the input u1(k), the matrix
F was chosen as follows:
F B (:,1) first column of the matrix B
60 60
150 80
kk201
= 201 kk210
= 210
k k1 k k20
l [°C]
l [°C]
=1 = 20 50
ylabel e [°C]
ylabel e [°C]
60 40
ure
ure
100 40
Temperature
Temperature
ylabel
ylabel
Temperatu
Temperatu
40 30
20
50
20 20
0 10
0 0 0 0.05 0.1 0 0.05 0.1
0 0.05
0 05 01
0.1 0 0.05
0 05 01
0.1
xlabel
x [m] xlabel
x [m]
xlabel
x [m] xxlabel
[m]
60 60
80 60 kk220
= 220 kk400
= 400
ylabel ure [°C]
k40 k200
k= 200
[°C]
el [°C]
k = 40 50 50
ylabel e [°C]
60
ure
ure
40 40
0 40
0
Temperatu
el
ylabe
ylabe
Temperatu
Temperatu
Temperatur
40
30 30
20
20 20 20
10 10
0 0 0 0.05 0.1 0 0.05 0.1
0 0.05
0 05 01
0.1 0 0.05
0 05 01
0.1
xlabel
x [m] xlabel
x [m]
xlabel
x [m] xlabel
x [m]
50 150
Temperature [((C)
mperature [°C]
40
Temperature
30 100
Reference
emp(C)
20 Closed loop response
Tem
Te
10 50
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
x x[m]
SteadyAbsolute error Error
State Absolute
0.25 0
0
C]
0.2
C)
(C
Temperature [°
100
0.15
Temperature
0.1 200
0.1
0.05 kt 300 0.08
0.06
0 04
0.04
0 400 0.02
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0 x x [m]
x x[m]
C] 50 40
C]
[°C
[°C
40
emperature
emperature
30
30
1label
2label
ddk 20
20
(k) ddk
(k)
y1
y2
y1(k) - Te
y2(k) - Te
10
10
0 0
0 100 200 300 400 0 100 200 300 400
xlabel - k
samples xlabel - k
samples
130 150 80
u1label ure [°C]
u2((k) - Temperatu
u3((k) - Temperatu
78 ddk
(k) ddk
(k)
100 40
52
75 20
26
0 50 0
0 200 400 0 200 400 0 200 400
xlabel - k
samples xlabel - k
samples xlabel - k
samples