0% found this document useful (0 votes)
2 views

2019-solution

Uploaded by

t&n cameroun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

2019-solution

Uploaded by

t&n cameroun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

EXAMINATION INFORMATION PAGE

Written examination

Subject code: Subject name:


IIA4117 Model Predictive Control
Examination date: Examination time Total hours:
03.12.2018 from/to: 09:00 – 12:00 3
Responsible subject teacher:
Roshan Sharma
Campus: Faculty:
Porsgrunn Faculty of Technology
No. of assignments: No. of attachments: No. of pages incl. front page
3 0 and attachments: 4
Permitted aids:

None, only pen or pencil

Information regarding attachments:

No attachments

Comments:

Please use ball pen. This makes it easier for the examiner to read your answers.
This exam counts 60% for the final grade i.e. if you add the scores for all the tasks given in this exam,
you will count it to be 60. Remaining 40% comes from the group project work.

Select the type of examination paper


Spreadsheets Line sheets

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
This exam counts 60% for the final grade.

Problem 1

Let us consider the following process model,


𝑥𝑘+1 = 𝐴𝑥𝑘 + 𝐵𝑢𝑘 + 𝑣𝑘 , 𝑥0 is known, (1)
𝑦𝑘 = 𝐶𝑥𝑘 + 𝑤𝑘 , (2)
where the states are 𝑥𝑘 ∈ ℝ 𝑛𝑥 , control inputs are 𝑢𝑘 ∈ ℝ𝑛𝑢 , process outputs are 𝑦𝑘 ∈ ℝ𝑛𝑦 , disturbance is
𝑣𝑘 ∈ ℝ𝑛𝑥 and the measurement noise is 𝑤𝑘 ∈ ℝ 𝑛𝑦 . Assume that 𝑣𝑘 and 𝑤𝑘 are known.
The process model is to be used for designing an optimal controller for controlling the outputs to their
desired setpoints. Let us consider a quadratic objective function 𝐽 as,
𝑁
1
𝐽= ∑ 𝑒𝑘𝑇 𝑃𝑘 𝑒𝑘 + 𝑢𝑇𝑘−1 𝑄𝑘−1 𝑢𝑘−1 + ∆𝑢𝑇𝑘−1 𝑅𝑘−1 ∆𝑢𝑘−1 ,
2
𝑘=1

where, (3)
𝑒𝑘 = 𝑟𝑘 − 𝑦𝑘 , (4)
∆𝑢𝑘 = 𝑢𝑘 − 𝑢𝑘−1.

Here, 𝑟𝑘 is the reference for the output 𝑦𝑘 and is considered to be known. Assume 𝑢 −1 is known. 𝑃𝑘 >
0, 𝑄𝑘 ≥ 0 and 𝑅𝑘 ≥ 0 are the weighting matrices of appropriate sizes. We want to formulate an optimal
control problem as a standard QP problem of the form,
𝑚𝑖𝑛 1 𝑇
𝑧 𝐻𝑧 + 𝑐 𝑇 𝑧,
𝑧 2

𝑠. 𝑡
𝐴𝜀 𝑧 = 𝑏𝜀 , (5)
𝐴𝑖 𝑧 ≤ 𝑏𝑖 ,
𝑧 𝐿 ≤ 𝑧 ≤ 𝑧 𝐻.

The vector of unknowns, 𝑧, is defined as,


𝑧 𝑇 = [ 𝑢𝑇𝑜 , … , 𝑢𝑇𝑁−1 , ∆𝑢𝑇𝑜 , … , ∆𝑢𝑇𝑁−1 , 𝑒1𝑇 , … , 𝑒𝑁𝑇 , 𝑦1𝑇 , … , 𝑦𝑁𝑇 , 𝑥1𝑇 , … , 𝑥𝑁𝑇 ]. (6)

Tasks:
 (8%) Find the expression for matrix 𝐻 and vector 𝑐.

Suggested Solution:

The LQ optimal control problem taken into consideration is,


𝑁
1
𝐽 = ∑ 𝑒𝑘𝑇 𝑃𝑘 𝑒𝑘 + 𝑢𝑇𝑘−1 𝑄𝑘−1 𝑢𝑘−1 + ∆𝑢𝑇𝑘−1 𝑅𝑘−1 ∆𝑢𝑘−1 , (13)
2
𝑘=1
1 (14)
𝐽 = (𝑒1𝑇 𝑃1 𝑒1 + ⋯ , 𝑒𝑁𝑇 𝑃𝑁 𝑒𝑁 + 𝑢𝑇0 𝑄0 𝑢0+, … , 𝑢𝑇𝑁−1 𝑄𝑁−1𝑢𝑁−1 + ∆𝑢𝑇0 𝑅0 ∆𝑢0 +,… , ∆𝑢𝑇𝑁−1𝑅𝑁−1 ∆𝑢𝑁−1)
2

s. t,
𝑥𝑘+1 = 𝐴𝑥𝑘 + 𝐵𝑢𝑘 + 𝑣𝑘 , 𝑥0 is known, (15)
𝑦𝑘 = 𝐶𝑥𝑘 + 𝑤𝑘 , (16)
𝑒𝑘 = 𝑟𝑘 − 𝑦𝑘 (17)
∆𝑢𝑘 = 𝑢𝑘 − 𝑢𝑘−1

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
(18)
We want to express equations (13) – (18) as a standard QP problem of the form,
𝑚𝑖𝑛 1 𝑇 (19)
𝑧 𝐻𝑧 + 𝑐 𝑇 𝑧,
𝑧 2

𝑠. 𝑡
𝐴𝜀 𝑧 = 𝑏𝜀 , (20)
𝐴𝑖 𝑧 ≤ 𝑏𝑖 , (21)
𝑧 𝐿 ≤ 𝑧 ≤ 𝑧 𝐻. (22)

The vector of unknowns, 𝑧, is defined as,


𝑧 𝑇 = [𝑢𝑇 , ∆𝑢𝑇 , 𝑒 𝑇 , 𝑦 𝑇 , 𝑥 𝑇 ] (23)
Where,
𝑢𝑇 = [𝑢𝑇𝑜 , … , 𝑢𝑇𝑁−1 ]
∆𝑢𝑇 = [∆𝑢𝑇𝑜 , … , ∆𝑢𝑇𝑁−1 ]
𝑒 𝑇 = [𝑒1𝑇 , … , 𝑒𝑁𝑇 ]
𝑦 𝑇 = [𝑦1𝑇 , … , 𝑦𝑁𝑇 ] (24)
𝑥 𝑇 = [𝑥1𝑇 , … , 𝑥𝑁𝑇 ]

The number of unknowns are nZ = N (nu + nu + ny + ny + nx ).


1
Now 2 𝑧𝑇 𝐻𝑧 from equation (18) can be written as,
𝑢 𝑇 𝐻11 0 0 0 0 𝑢 𝑐1 𝑇 𝑢
1 𝑇 1 ∆𝑢 0 𝐻 22 0 0 0 ∆𝑢 𝑐2 ∆𝑢
𝑧 𝐻𝑧 = 𝑒 0 0 𝐻33 0 0 𝑒 + 𝑐3 𝑒 (25)
2 2 𝑦 𝑦 𝑐 𝑦
0 0 0 𝐻44 0 4
(𝑥) ( ) ( )
( 0 0 0 0 𝐻55 ) 𝑥 (𝑐5 )(1×𝑛𝑧 ) 𝑥

1 𝑇 1
𝑧 𝐻𝑧 = (𝑢𝑇 𝐻11 𝑢 + ∆𝑢𝑇 𝐻22 ∆𝑢 + 𝑒 𝑇 𝐻33 𝑒 + 𝑦 𝑇 𝐻44 𝑦 + 𝑥 𝑇 𝐻55 𝑥 ) (26)
2 2
Comparing (26) and (14) we get,
𝑢0 𝑇 𝑄0 0 0 𝑢0
𝑢 ⋯ 𝑢
1 0 𝑄 0 (27)
𝑇
𝑢 𝐻11 𝑢 = ( ) [ 1
] ( 1 )
⋮ ⋮ ⋱ ⋮ ⋮
𝑢𝑁−1 0 ⋯ 𝑄𝑁−1 𝑢𝑁−1
If 𝑄0 = 𝑄1 = ⋯ , = 𝑄𝑁−1 = 𝑄, then we have,
𝑄 0 0

0 𝑄 0 (28)
𝐻11 = [ ] = 𝐼𝑁  𝑄
⋮ ⋱ ⋮
0 ⋯ 𝑄
where  is the Kronecker product between matrices. In addition, comparing (26) and (14) we get,
∆𝑢0 𝑇 𝑅0 0 0 ∆𝑢0
⋯ (29)
𝑇 ∆𝑢1 0 𝑅1 0 ∆𝑢1
∆𝑢 𝐻22 ∆𝑢 = ( ) [ ]( )
⋮ ⋮ ⋱ ⋮ ⋮
∆𝑢𝑁−1 0 ⋯ 𝑅𝑁−1 ∆𝑢𝑁−1
If 𝑅0 = 𝑅1 = ⋯ , = 𝑅𝑁−1 = 𝑅, then we have,
𝑅 0 ⋯ 0
𝐻22 = [ 0 𝑅 0] = 𝐼  𝑅
𝑁
(28)
⋮ ⋱ ⋮
0 ⋯ 𝑅
Also,
𝑒1 𝑇 𝑃1 0 0 𝑒1
𝑒 ⋯ 𝑒
2 0 𝑃 0 (27)
𝑇
𝑒 𝐻33 𝑒 = ( ) [ 2
] ( 2)
⋮ ⋮ ⋱ ⋮ ⋮
𝑒𝑁 0 ⋯ 𝑃𝑁 𝑒𝑁

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
If 𝑃1 = 𝑃2 = ⋯ , = 𝑃𝑁 = 𝑃, then we have,
𝑃 0 0

𝐻33 = [ 0 𝑃 0] = 𝐼  𝑃 (28)
⋮ ⋱ ⋮ 𝑁

0 ⋯ 𝑃
There are no ’y’ and ‘x’ terms in equation (14), so we have,
𝐻44 = 𝐼𝑁  0𝑛𝑦 = 0𝑁.𝑛𝑦 (29)
𝐻55 = 𝐼𝑁  0𝑛𝑥 = 0𝑁.𝑛𝑥 (30)
Then we have,
𝐻 = 𝑏𝑙𝑘𝑑𝑖𝑎𝑔 (𝐻11 , 𝐻22 , 𝐻33 , 𝐻44 , 𝐻55 ) (31)
𝐻 = 𝑏𝑙𝑘𝑑𝑖𝑎𝑔 (𝐼𝑁  𝑄, 𝐼𝑁  𝑅, 𝐼𝑁  𝑃, 0𝑁.𝑛𝑦 ,0𝑁.𝑛𝑥 )
Here blkdiag means block diagonal matrix.
Also, in equation (14) we do not have linear terms, so we have,
𝑐1
𝑐2
𝑐 = 𝑐3 = 0𝑛𝑧 ×1 (32)
𝑐4
(𝑐5 )

 (10%) Find the expression for matrix 𝐴𝜀 and vector 𝑏𝜀 .

Suggested Solution:
Now let us express the equality constraints of equations 15-18 in the form 𝐴𝜀 𝑧 = 𝑏𝜀 . We have in total 4
equality constraints, therefore, let us group them into 4 groups as,
Aϵ,1u Aϵ,1∆u Aϵ,1e Aϵ,1y Aϵ,1x 𝑢 𝑏𝜖,1
Aϵ,2u Aϵ,2∆u Aϵ,2e Aϵ,2y Aϵ,2x ∆𝑢 𝑏𝜖,2
[𝑒 ]= (33)
Aϵ,3u Aϵ,3∆u Aϵ,3e Aϵ,3y Aϵ,3x 𝑦 𝑏𝜖,3
[Aϵ,4u Aϵ,4∆u Aϵ,4e Aϵ,4y Aϵ,4x ] 𝑥 [𝑏𝜖,4 ]
Each row of equation (33) corresponds to each equality constraints of equations 15-18.
Let us first consider the equality constraints given by equation (15),
𝑥𝑘+1 = 𝐴𝑥𝑘 + 𝐵𝑢𝑘 + 𝑣𝑘 → 𝑥𝑘 − 𝐴𝑥𝑘−1 − 𝐵𝑢𝑘−1 = 𝑣𝑘−1 (34)
For, k=1 to k=N, we have,
𝑥1 − 𝐵𝑢0 = 𝐴𝑥0 + 𝑣0
𝑥2 − 𝐴𝑥1 − 𝐵𝑢1 = 𝑣1
⋮ ⋮ (35)
𝑥𝑁 − 𝐴𝑥𝑁−1 − 𝐵𝑢𝑁−1 = 𝑣𝑁−1

Arranging equation (35) in matrix form we get,


I 0 0 … 0
0 0 0 … 0 0 0 0 … 0 0 0 0 … 0
−B 0 0 … 0 −A I 0 … 0
0 0 0 … ⋮ 0 0 0 … ⋮ 0 0 0 … 0 ⋮ 0 −A I … 0
0 −B 0 … 0 …
0 0 −B … 0 ⋮ 0 0 0 … ⋮ ⋮ 0 0 0 … ⋮ ⋮ 0 0 0

0 ⋮ ⋱ ⋱ ⋱ ⋮
⋱ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⋮ ⏟0 −A I
⋮ ⋱ ⋱ ⋮ ⏟ … 0 …
⏟0 … ⏟
0 0 … … 0 ⏟
0 0 … … 0 0 0 … 0
… … −B 𝐴∈,1𝑦
𝐴 ∈,1𝑥
[ 𝐴∈,1𝑢 𝐴∈,1∆𝑢 𝐴∈,1𝑒 ]

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
𝑢0 𝐴𝑥0 + 𝑣0
⋮ 𝑣1
𝑢𝑁−1 ⋮
∆𝑢0 ⋮
⋮ ⋮
∆𝑢𝑁−1 ⋮
𝑒1 ⋮
⋮ = ⋮
𝑒𝑁 ⋮
𝑦1 ⋮
⋮ ⋮
𝑦𝑁 ⋮
𝑥1 ⋮
⋮ ⋮
[ 𝑥𝑁 ] [⏟ 𝑣𝑁−1 ]
𝑏 𝜖,1
Therefor we have,
−𝐵 0 ⋯ 0
𝐴 ∈,1𝑢 =[ 0 −𝐵 ⋯ 0 ] = −𝐼  𝐵
𝑁
⋮ ⋮ ⋱ ⋮ (36)
0 0 ⋯ −𝐵

𝐴 ∈,1∆𝑢 = 0𝑁.𝑛𝑥 ×𝑁.𝑛𝑢 (37)


𝐴 ∈,1𝑒 = 0𝑁.𝑛𝑥 ×𝑁.𝑛𝑦 (38)
𝐴 ∈,1𝑦 = 0𝑁.𝑛𝑥 ×𝑁.𝑛𝑦 (39)
𝐼 0 0 ⋯ 0
−𝐴 𝐼 0 ⋯ 0
𝐴∈,1𝑥 = 0 −𝐴 𝐼 ⋯ 0 = 𝐼𝑁.𝑛𝑥 − (𝐼𝑁,−1  𝐴)
⋮ ⋱ (40)
[ 0 ⋯ ⋯ −𝐴 𝐼 ]

Furthermore,
𝐴𝑥0 + 𝑣0 (41)
𝑣1
𝑏𝜖,1 = [ ]

𝑣𝑁−1

Now let us consider the equality constraint of equation (16).


𝑦𝑘 = 𝐶𝑥𝑘 + 𝑤𝑘 → 𝑦𝑘 − 𝐶𝑥𝑘 = 𝑤𝑘 (42)
For, k=1 to k=N, we have,

𝑦1 − 𝐶𝑥1 = 𝑤1
𝑦1 − 𝐶𝑥2 = 𝑤2
⋮ ⋮ (43)
𝑦𝑁 − 𝐶𝑥𝑁 = 𝑤𝑁

Arranging equation (43) in matrix form we get,


−𝐶 0 0 … 0
0 0 0 … 0 0 0 0 … 0 𝐼 0 0 … 0
0 0 0 … 0 0 −𝐶 0 … 0
0 0 0 … ⋮ 0 0 0 … ⋮ 0 𝐼 0 … 0 ⋮ 0 0 −𝐶 … 0
0 0 0 … ⋮ …
0 0 0 … ⋮ ⋮ 0 0 0 … ⋮ ⋮ 0 0 0 … ⋮ ⋮ 0 0 𝐼

0 ⋮ ⋱ ⋱ ⋱ ⋮
⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⋮ ⏟0 ⋯ −𝐶
⋮ ⋱ ⋱ ⏟ … 0 …
⏟ … 0 ⏟
0 0 … … 0 ⏟
0 0 … … 0 0 0 … 𝐼
0 0 … 𝐴∈,2𝑦
𝐴∈,2𝑥
[ 𝐴∈,2𝑢 𝐴∈,2∆𝑢 𝐴∈,2𝑒 ]

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
𝑢0 𝑤1
⋮ 𝑤2
𝑢𝑁−1 ⋮
∆𝑢0 ⋮
⋮ ⋮
∆𝑢𝑁−1 ⋮
𝑒1 ⋮
⋮ = ⋮
𝑒𝑁 ⋮
𝑦1 ⋮
⋮ ⋮
𝑦𝑁 ⋮
𝑥1 ⋮
⋮ ⋮
[ 𝑥𝑁 ] [⏟𝑤𝑁 ]
𝑏 𝜖,2
Therefor we have,
𝐴 ∈,2𝑢 = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 (44)

𝐴 ∈,2∆𝑢 = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢


𝐴∈,2𝑒 = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑦

𝐼 0 ⋯ 0 (45)
𝐴 ∈,2𝑦 = [0 𝐼 ⋯ 0] = 𝐼  𝐼 = 𝐼
𝑁 𝑛𝑦 𝑁.𝑛𝑦 (46)
⋮ ⋮ ⋱ ⋮
0 0 ⋯ 𝐼

−𝐶 0 ⋯ 0 (47)
𝐴 ∈,2𝑥 =[ 0 −𝐶 ⋯ 0 ] = −𝐼  𝐶
𝑁
⋮ ⋮ ⋱ ⋮
0 0 ⋯ −𝐶
(48)
𝑤1
𝑤2
𝑏𝜖,2 = [ ⋮ ]
𝑤𝑁

(49)

Similarly, considering the equality constraints of equation (17) we get,


𝑒𝑘 = 𝑟𝑘 − 𝑦𝑘 → 𝑒𝑘 + 𝑦𝑘 = 𝑟𝑘 (50)
For, k=1 to k=N, we have,
𝑒1 + 𝑦1 = 𝑟1
𝑒2 + 𝑦2 = 𝑟2 (51)
⋮ ⋮
𝑒𝑁 + 𝑦𝑁 = 𝑟𝑁

Arranging equation (51) in matrix form we get,

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
0 0 0 … 0
0 0 0 … 0 𝐼 0 0 … 0 𝐼 0 0 … 0
0 0 0 … 0 0 0 0 … ⋮
0 0 0 … ⋮ 0 𝐼 0 … 0 0 𝐼 0 … 0 ⋮ 0 0 0 … ⋮
0 0 0 … ⋮ … 0
0 0 0 … ⋮ ⋮ 0 0 0 … ⋮ ⋮ 0 0 𝐼 … 0 ⋮ 0 0 𝐼
⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮
⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⏟ … 0
⋮ ⋱ ⋱ ⏟ … 𝐼 0 0 …
⏟ … 0 ⏟
0 0 … … 0 ⏟
0 0 … … 𝐼 0 0 …
0 0 … 𝐴∈,3𝑦
𝐴
∈,3𝑥
[ 𝐴∈,3𝑢 𝐴∈,3∆𝑢 𝐴∈,3𝑒 ]

𝑢0 𝑟1
⋮ 𝑟2
𝑢𝑁−1 ⋮
∆𝑢0 ⋮
⋮ ⋮
∆𝑢𝑁−1 ⋮
𝑒1 ⋮
⋮ = ⋮
𝑒𝑁 ⋮
𝑦1 ⋮
⋮ ⋮
𝑦𝑁 ⋮
𝑥1 ⋮
⋮ ⋮
[ 𝑥𝑁 ] [⏟
𝑟𝑁 ]
𝑏 𝜖,3
Therefor we have,
𝐴 ∈,3𝑢 = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 (52)
𝐴 ∈,3∆𝑢 = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 (53)
(54)
𝐼 0 ⋯ 0
𝐴∈,3𝑒 = [0 𝐼 ⋯ 0] = 𝐼  𝐼 = 𝐼
𝑁 𝑛𝑦 𝑁.𝑛𝑦 (55)
⋮ ⋮ ⋱ ⋮
0 0 ⋯ 𝐼

𝐼 0 ⋯ 0
𝐴∈,3𝑦 =[ 0 𝐼 ⋯ 0] = 𝐼  𝐼 = 𝐼
⋮ ⋮ ⋱ ⋮ 𝑁 𝑛𝑦 𝑁.𝑛𝑦
(56)
0 0 ⋯ 𝐼

𝐴∈,3𝑥 = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑥

𝑟1
𝑟2
𝑏𝜖,3 = [ ⋮ ]
𝑟𝑁 (57)

Finally from the equality constraint of equation (18) we get,


∆𝑢𝑘 = 𝑢𝑘 − 𝑢𝑘−1 → ∆𝑢𝑘−1 − 𝑢𝑘−1 + 𝑢𝑘−2 = 0 (58)
For, k=1 to k=N, we have,
∆𝑢0 − 𝑢0 = −𝑢−1
∆𝑢1 − 𝑢1 + 𝑢0 = 0 (59)
⋮ ⋮
∆𝑢𝑁−1 − 𝑢𝑁−1 + 𝑢𝑁−2 = 0

Arranging equation (59) in matrix form we get,

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
0 0 0 … 0
𝐼 0 0 … 0 0 0 0 … 0 0 0 0 … 0
−𝐼 0 0 … 0 0 0 0 … ⋮
0 𝐼 0 … 0 0 0 0 … ⋮ 0 0 0 … ⋮ ⋮ 0 0 0 … ⋮
𝐼 −𝐼 0 … ⋮ … ⋮
0 𝐼 0 … ⋮ ⋮ 0 0 𝐼 … 0 ⋮ 0 0 0 … ⋮ ⋮ 0 0 0
⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮
⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⋱ ⋮ ⋮ ⋱ ⋱ ⏟ … 0
⋮ ⋱ ⋱ ⏟ … 0 0 0 …
⏟ 0 … 𝐼 −𝐼 ⏟
0 0 … … 𝐼 ⏟
0 0 … … 0 0 0 …
0 𝐴∈,4𝑦
𝐴∈,4𝑥
[ 𝐴∈,4𝑢 𝐴∈,4∆𝑢 𝐴∈,4𝑒 ]

𝑢0 −𝑢−1
⋮ 0
𝑢𝑁−1 ⋮
∆𝑢0 ⋮
⋮ ⋮
∆𝑢𝑁−1 ⋮
𝑒1 ⋮
⋮ = ⋮
𝑒𝑁 ⋮
𝑦1 ⋮
⋮ ⋮
𝑦𝑁 ⋮
𝑥1 ⋮
⋮ ⋮
[ 𝑥𝑁 ] [⏟ 0 ]
𝑏 𝜖,4
Therefor we have,
−𝐼 0 0 ⋯ 0 (60)
𝐼 −𝐼 0 ⋯ 0
𝐴∈,4𝑢 = 0 𝐼 −𝐼 ⋯ 0 = −𝐼𝑁.𝑛𝑢 + (𝐼𝑁,−1  𝐼𝑛𝑢 )
⋮ ⋱
[0 ⋯ ⋯ 𝐼 −𝐼 ]

𝐼 0 ⋯ 0
𝐴 ∈,4∆𝑢 =[ 0 𝐼 ⋯ 0] = 𝐼  𝐼 = 𝐼 (61)
⋮ ⋮ ⋱ ⋮ 𝑁 𝑛𝑢 𝑁.𝑛𝑢

0 0 ⋯ 𝐼

𝐴∈,4𝑒 = 0𝑁.𝑛𝑢 ×𝑁.𝑛𝑦 (62)


(63)
𝐴 ∈,4𝑦 = 0𝑁.𝑛𝑢 ×𝑁.𝑛𝑦
(64)
𝐴∈,4𝑥 = 0𝑁.𝑛𝑢 ×𝑁.𝑛𝑥

−𝑢 −1
0 (65)
𝑏𝜖,4 = [ ⋮ ]
0
Summing it up,
−𝐼𝑁  𝐵 0𝑁.𝑛𝑥×𝑁.𝑛𝑢 0𝑁.𝑛𝑥 ×𝑁.𝑛𝑦 0𝑁.𝑛𝑥 ×𝑁.𝑛𝑦 IN.n − (𝐼𝑁,−1  𝐴)
x
0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑦 IN.ny −𝐼𝑁  𝐶
𝐴∈ = 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 (66)
0𝑁.𝑛𝑦 ×𝑁.𝑛𝑢 IN.ny IN.ny 0𝑁.𝑛𝑦 ×𝑁.𝑛𝑥
[−𝐼𝑁.𝑛𝑢 + (𝐼𝑁,−1  𝐼𝑛𝑢 ) 𝐼𝑁.𝑛𝑢 0𝑁.𝑛𝑢 ×𝑁.𝑛𝑦 0𝑁.𝑛𝑢 ×𝑁.𝑛𝑦 0𝑁.𝑛𝑢 ×𝑁.𝑛𝑥 ]

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
𝐴𝑥0 + 𝑣0 (67)
𝑣1

𝑣𝑁−1
𝑤1
𝑤2

𝑏𝜖 = 𝑤𝑁
𝑟1
𝑟2

𝑟𝑁
−𝑢−1
0

[ 0 ]

Now consider that the control inputs have bounds such that 𝑢𝐿 ≤ 𝑢𝑘 ≤ 𝑢𝐻 , where 𝑢𝐿 and 𝑢𝐻 are the lower
and the upper bounds on the control inputs respectively.

 (5%) How will you formulate the expression for 𝑧𝐿 and 𝑧𝐻 to include the bounds on the control
inputs.

Suggested solution:
If the control inputs have bounds such that 𝑢𝐿 ≤ 𝑢𝑘 ≤ 𝑢𝐻 , where 𝑢𝐿 and 𝑢𝐻 are the lower and the upper
bounds respectively, then 𝑧𝐿 and 𝑧𝐻 can be expressed as shown below:
1  𝑢𝐿
𝑧𝐿 = (−∞ 𝑁×1 )
(𝑛𝑧 − 𝑛𝑢 .𝑁)×1
1𝑁×1  𝑢𝐻
𝑧𝐻 = (+∞ )
(𝑛𝑧 −𝑁.𝑛𝑢 )×1

Problem 2
The Kragerø Waterways is a system consisting of a precipitation catchment, with rivers leading into Lake
Toke. The surface of the lake covers ca. 32 𝑘𝑚2 . Rain and snow falling into the catchment is gradually
transported as influx into Lake Toke, and the water in Lake Toke is then used for hydropower production.
Dalsfos power station is one of several hydro power stations that uses the water from Lake Toke for
electricity generation.

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
Figure 1: Google map for Lake Toke and Dalsfoss Hydropower Plant

The operation of the Dalsfoss hydro power station is strictly constrained by maximum and minimum
allowed level of water at Merkebekk (ca. 5 km before the power plant). There are both economical as well
as environmental reasons behind the establishment of the restriction on the allowed water level at
Merkebekk (details not necessary for this exam). During the flood season (April, May), the level at
Merkebekk has to be controlled by using floodgates located at the hydropower station.

Let us assume that the dynamics of the water level at Merkebekk is expressed by the following nonlinear
ordinary differential equations as,

𝑑ℎ𝑚 (7)
= 𝑓(𝐹𝑖𝑛 , 𝐹𝑔𝑎𝑡𝑒 , 𝐹𝑡𝑢𝑟𝑏𝑖𝑛𝑒 )
𝑑𝑡

Here, 𝑓 is some nonlinear function, 𝐹𝑖𝑛 is the influx (flow of water into lake Toke), 𝐹𝑔𝑎𝑡𝑒 is flow of water
out of Lake Toke through the flood gates, 𝐹𝑡𝑢𝑟𝑏𝑖𝑛𝑒 is the flow of water out of Lake Toke by passing it
through the turbine of the power plant, and ℎ𝑚 is the level of water at Merkebekk. Let us for simplicity
assume that the turbine is operated at the full load condition and hence, the flow 𝐹𝑡𝑢𝑟𝑏𝑖𝑛𝑒 is constant. In
order to regulate the level ℎ𝑚 the flood gate opening can be adjusted, and hence the flow 𝐹𝑔𝑎𝑡𝑒 can be
used a control input (manipulated variable). However, it is desirable to use the rate of change of the flow
through the flood gates ∆𝐹𝑔𝑎𝑡𝑒 during the control problem formulation.

𝐹𝑖𝑛 , which is the flow of water coming into lake Toke can be thought as input disturbance. 𝐹𝑖𝑛 is predicted
for 15 days into the future using some complex meteorology models. The challenge with 𝐹𝑖𝑛 is that, due
to uncertainty in meteorology models, an ensemble of 50 possible 𝐹𝑖𝑛 is prediction for 15 days into the
future (instead of just one set of prediction) as shown in Figure 2. Assume that each set of 𝐹𝑖𝑛 is equally
probably.

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
Figure 2: 50 possible predictions of 𝐹𝑖𝑛 for 15 days into the future.

Now assume that you are recently hired by Skagerak Energy who operates the hydropower plant as an
automation engineer. Your task is to develop a nonlinear MPC for controlling the level at Merkebekk to a
desired level ℎ𝑟𝑒𝑓 . Having a good background on Multi-Objective Optimization (MOO) methods, you
decided to include all the possible 50 predictions for 𝐹𝑖𝑛 when formulating your MPC.

𝑈
Assume that the maximum possible flow of water through the flood gates is 𝐹𝑔𝑎𝑡𝑒 . The maximum and
𝑈 𝐿
minimum allowed water level at Merkebekk are ℎ𝑚 and ℎ𝑚 respectively. Similarly, assume that maximum
𝑈 𝐿
and minimum allowed rate of change of flow through the flood gates are ∆𝐹𝑔𝑎𝑡𝑒 and ∆𝐹𝑔𝑎𝑡𝑒 respectively.

Tasks

(i) [20%] Explain in detail, how you would formulate nonlinear MPC so that you take into account
all the prediction sets in the whole ensemble. Show your objective function, constraints etc.

Note: Simple assumption that “mean” or “median” values of the ensemble can be used as
𝑭𝒊𝒏 in Equation (7) for predicting the future behavior of the process is NOT an acceptable
answer.

Tips: Any MOO methods that you think can be useful here?

Suggested Solution:

This problem can be solved with a stochastic MPC using the features from multi-objective optimization
(MOO) problems. In a deterministic MPC, the prediction model gives only one set of predicted system
dynamics for a given set of input sequence for the whole prediction horizon. However, for this process,
the future precipitations (leading to influx to Lake Toke) consists of not only 1 set of predicted values but
50 different sets which are equally likely to occur.

A relatively simple method called the weighted sum method can be utilized here.

Let 𝑖 denote different sets of prediction in the ensemble i.e. 𝑖 = 1,2,3, … ,50 since the ensemble contains
50 different predictions for future precipitations for 15 days into the future (see Figure 2).

For any 𝑖 𝑡ℎ set in the ensemble, we can define an 𝑖 𝑡ℎ nonlinear objective function as,
𝑁

𝐽𝑖 = ∑ 𝑒𝑘𝑇 𝑃𝑒𝑘 + ∆𝐹𝑔𝑎𝑡𝑒,𝑘−1


𝑇
𝑅∆𝐹𝑔𝑎𝑡𝑒,𝑘−1
𝑘=1 (68)

To calculate the 𝑖 𝑡ℎ nonlinear objective function 𝐽𝑖 , the following equations are needed to
be considered,

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
𝑖
ℎ𝑚,𝑘+1 = 𝑓𝑘 (𝐹𝑖𝑛,𝑘 , 𝐹𝑔𝑎𝑡𝑒,𝑘 , 𝐹𝑡𝑢𝑟𝑏𝑖𝑛𝑒 ,𝑘 ), ℎ𝑚0 known & 0 ≤ 𝑘 ≤ 𝑁 − 1
𝑒𝑘 = ℎ𝑟𝑒𝑓 − ℎ𝑚,𝑘
𝐹𝑔𝑎𝑡𝑒,𝑘 = ∆𝐹𝑔𝑎𝑡𝑒,𝑘 + 𝐹𝑔𝑎𝑡𝑒,𝑘−1

Here, 𝐽𝑖 is the performance index for any 𝑖 𝑡ℎ set in the ensemble, ∆𝐹𝑔𝑎𝑡𝑒,𝑘 is the sequence of manipulated
variable (throughout the prediction horizon) that is needed to be optimized/minimized. ∆𝐹𝑔𝑎𝑡𝑒,𝑘 is the rate
of change of manipulated variables i.e. rate of change of the flow through the flood gate. 𝐹𝑔𝑎𝑡𝑒,𝑘 is the
flow through the flood gates. The weighting matrices are 𝑃, 𝑄 and 𝑅, and the prediction horizon is denoted
by 𝑁.

𝑖
Note that, 𝐹𝑖𝑛,𝑘 denotes the influx to Lake Toke using at any time 𝑘 using the 𝑖 𝑡ℎ set in the ensemble.

Now, in order to utilize the weighted sum method for solving MPC problem, the following MOO problem
can be formed:
𝑚𝑖𝑛 50

𝐹⏟
𝑔𝑎𝑡𝑒,𝑘 𝐽 = ∑ 𝑤𝑖 𝐽𝑖
0≤𝑘≤𝑁−1 𝑖 =1 (69)

𝑠. 𝑡

𝑈
0 ≤ 𝐹𝑔𝑎𝑡𝑒,𝑘 ≤ 𝐹𝑔𝑎𝑡𝑒
𝐿 𝑈
ℎ𝑚 ≤ ℎ𝑚,𝑘 ≤ ℎ𝑚
𝐿 𝑈
∆𝐹𝑔𝑎𝑡𝑒 ≤ ∆𝐹𝑔𝑎𝑡𝑒,𝑘 ≤ ∆𝐹𝑔𝑎𝑡𝑒

ℎ𝐿𝑚 is the lowest allowed level at Merkebekk and ℎ𝑈 𝑚 is the highest allowed level at Merkebekk. Similarly,
𝐿 𝑈
∆𝐹𝑔𝑎𝑡𝑒 is the lower bound for the rate of change of flow through the flood gates, and ∆𝐹𝑔𝑎𝑡𝑒 is the upper
𝑈
bound for the rate of change of flow through the flood gates. Also, 𝐹𝑔𝑎𝑡𝑒 is the maximum possible flow of
water through the flood gates.

For this particular MOO-MPC problem, the weights 𝑤𝑖 for each objective function can be chosen to be the
same. This is because, each set in the ensemble in a statistical point of view is equally likely probable i.e.
each prognosis is equally likely to occur in the future. So there is no point/need to favour one objective
upon the other.

The main advantage of using MOO for solving this MPC problem is that we only need to optimized 𝑁
number of unknown variables i.e. we only need to optimize 𝐹𝑔𝑎𝑡𝑒,𝑘 for 0 ≤ 𝑘 ≤ 𝑁 − 1 even if we consider
all 50 sets in the ensemble. In other words, we do not need to formulate the MPC problem in such a way
that we require 50𝑁 number of variables to optimize, i.e. 𝑁 number of variables to optimize for each set
in the ensemble.

Problem 3 (half 2018)


Tasks

(i) [10%] What is the difference between a state feedback MPC and an output feedback MPC.
Draw necessary signal flow diagrams (block diagrams) to illustrate your reasoning.

Suggested Solution:

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
A state feedback MPC as the name implies is a controller where the states are directly fed back to the
controller. This is only possible if all the states of the process being controlled are available or
measurable i.e. full state information is a necessity. This makes the state feedback MPC an ideal case.
The block diagram in figure (b) illustrates the state feedback MPC.
Ref

uk 𝑦𝑘 = 𝐶𝑥𝑘
MPC Process

𝑥𝑘

Figure (b): State feedback MPC

However, in practice, it may not always be possible to measure all the state of the system. In such
cases, the states of the system should be "ESTIMATED". Estimation of the states can be performed by
utilizing the available measurements. So in this case, the measurements (output) of the process is fed
to an estimator (say a Kalman filter) which instead estimates the states. These estimated states are
then fed to the MPC as shown in the block diagram in Figure (c).
Re
f
uk yk
MPC Proces
s

Estimator

𝑥ො𝑘
𝑦ො k
Figure (c): Output feedback MPC with a full order estimator

In Figure (c) the estimator used is a full order estimator which estimates all the states of the system (both
measured and unmeasured). It is also possible to design reduced order estimators (e.g. a reduced order
nonlinear observer for simplifying calculations and proof of convergence) that estimates only the
unmeasured states. The measured states (probably after low pass filtering if necessary) and the estimated
states are fed to the MPC as shown in Figure (d).

Re
f
uk yk
MPC Proce
ss

Estimato
r
𝑥ො𝑘 𝑦ො k

Figure (d): Output feedback MPC with a reduced order estimator.

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.
(ii) [7%] Comment on MPC features with respect to robustness and stability (e.g. is
robustness/stability guaranteed, can it be improved? etc.)

Suggested Solution:

Robustness is NOT guaranteed in the general/standard framework of MPC since the standard MPC
structure does not explicitly deal with uncertainty. The prediction models can be subjected to
uncertainties and modeling inaccuracies. Both structured (or parametric uncertainties) and
unstructured uncertainties (or unmodeled dynamics) can be considered. Under the presence of such
uncertainties, standard MPC algorithm will not achieve robust performance i.e. the target system
being controlled can greatly deviate from expected trajectories when disturbances enter the system.

Similarly, closed loop stability cannot be guaranteed with the standard MPC framework. It can only be
guaranteed if the length of the prediction horizon tends to infinity. But with finite horizon MPC (which
is the basic framework of standard MPC), it simply loses this property. Nevertheless, stability can be
improved while still having a finite horizon MPC. For this terminal cost (with appropriate terminal
weight) and terminal constraints can be included in the MPC formulation. Details not needed for this
task given that it is only 7%.

Roshan Sharma
22th November 2019, Porsgrunn, Norway

CANDIDATES MUST THEMSELVES CHECK THAT ALL ASSIGNMENTS AND ATTACHMENTS ARE IN ORDER.

You might also like