SYSC 5807X: Assignment III
Created by Chao Shen
Due: April 12, 2023
1. A dynamic system can be represented by the following state-space model
x(k + 1) =
[
−2 1
0 1
]
x(k) +
[
1
1
]
u(k)
y(k) = [1 1]x(k)
Consider an MPC controller minimizing the predicted performance index
J(k) =
∞∑
i=0
(y2(k + i|k) + u2(k + i|k))
at each time-step k with input constraints
−1 ≤ u(k + i|k) ≤ 2, for i ≥ 0
(a) Consider the dual-mode control strategy in MPC. Show that, if the mode 2
controller is u(k) = [2 − 1]x(k) then the performance index is equal to
J(k) =
N−1∑
i=0
(y2(k + i|k) + u2(k + i|k)) + xT(k + N |k)
[
13 −1
−1 2
]
x(k + N |k)
where N ≥ 1 is the length of mode 1 prediction horizon.
(b) Show that the satisfaction of constraints
−1 ≤ u(k + i|k) ≤ 2, for i = 0, 1, ..., N + 1
ensures that the predictions satisfy 1 ≤ u(k + i|k) ≤ 2 for all i ≥ 0.
(c) Derive a bound on J∗(k+1)−J∗(k), where J∗(k) is the optimal value of J(k).
Then show that, along the closed-loop trajectory we have
∑∞
i=0(y
2(k)+u2(k)) ≤
J∗(0). Comment on the closed-loop stability.
2. Consider the following discrete-time system
x(k + 1) =
[
0.3 −0.9
−0.4 −2.1
]
x(k) +
[
0.5
1
]
u(k)
subject to the constraints
|x1 + x2| ≤ 1, |x1 − x2| ≤ 1
1
where x = [x1, x2]
T is the state variable.
(a) Explain the function of terminal constraints in a model predictive control
for systems with input and/or state constraints. Define two principal properties
that must be satisfied by a terminal constraint set.
(b) If the terminal controller (i.e., the mode 2 control law) is u(k) = Kx(k) with
K = [0.4 1.8], show that the following set
S = {x ∈ R2 : |x1 + x2| ≤ 1, |x1 − x2| ≤ 1}
is a valid terminal set that satisfies the two properties defined in part (a).
(c) Describe a procedure for determining the largest terminal constraint set fo
a general feedback gain K. Find the largest terminal set Xf for K = [0.4 1.8].
(d) What are the main considerations for choosing the prediction horizon N?
(e) Follow the dual-mode control strategy to design an MPC controller with the
following performance index
J(k) =
∞∑
i=0
(‖x(k + i|k)‖2Q + u2(k + i|k))
where Q = I, the identity matrix with appropriate dimension. Find the largest
terminal set Xf for the LQR gain K. Implement your MPC system with ter-
minal constraint Xf in MATLAB and plot the state and control trajectories fo
different initial conditions x(0) and prediction horizons N to back up your claim
in part (d).
3. A production planning problem involves optimizing the quantity u of stock
manufactured in each week. The quantity x of stock that remains unsold at the
start of week k + 1 is given by
x(k + 1) = x(k) + u(k)− w(k)
where the quantity w(k) that is sold in each week is unknown in advance but
there is an estimate ŵ, known and constant. Limits on storage and manufac-
turing capacities imply that x and u can only take values in the intervals
0 ≤ x(k) ≤ x̄, 0 ≤ u(k) ≤ ū
The desired level of stock in storage is x∗, and the planned values u(k|k), u(k +
1|k), ... are to be optimized at week k given the measurement of value of x(k)
y minimizing a cost
J(k) =
∞∑
i=0
e2(k + i|k), with e(k + i|k) = x(k + i|k)− x∗.
(a) What are the advantages of using a receding horizon control strategy in this
application instead of an open-loop control sequence computed at k = 0?
2
(b) Assume that w(k) = ŵ for all k = 0, 1, .... Show that the unconstrained
optimal control is u(k) = ŵ − e(k). Also show that, if we take the dual-mode
control strategy, then the constraints are satisfied over an infinite horizon if
0 ≤ x(k + i|k) ≤ x̄, 0 ≤ u(k + i|k) ≤ ū for 0 ≤ i ≤ N − 1
and
max{0, ŵ + x∗ − ū} ≤ x(k + N |k) ≤ {x̄, ŵ + x∗}
Explain what assumptions on ŵ, x∗, ū and x̄ are needed.
(c) Assume now that the future value of w is unknown and may take any value
in an interval: ŵ − d ≤ w(k) ≤ ŵ + d. Suggest how to express the planned
sequence u(k + i|k) in terms of the free variables in the optimization problem.
Then formulate the production planning problem as a robust model predictive
control problem.
(d) Assume x(0) = 0, x̄ = 100, x∗ = 80, ū = 30, ŵ = 20, and w(k) is discrete
uniform distribution on [16, 24] (i.e., d = 4). Solve the robust MPC problem in
MATLAB (use the built-in function randi to simulate uniform distribution of
w(k)). Plot the state trajectories x(k) and control trajectories u(k) for predic-
tion horizons N = 2, 4, 8. Note: if the problem is not feasible for a large N , use
the constraint relaxation strategy (which we discussed in class).
4. (Bonus Question) For the MPC problem in Question 2, consider additional
constraints on control u such that
−2 ≤ u(k) ≤ 2
solve it as an explicit MPC problem (i.e, formulate it as an mp-QP and solve it
with the MPT toolbox).
3
����
����� ����� ���������� ��
���� ������
�
� �����
��������� ���� ���
��
���� ��
�
�
��
��
��
���������
�
� ��� ���������� ����
� ��� � � � � � � � � � � � � � � � � � � � � �
�
���� ��� �
���� � � � � � � � � � � � � � � � � � � � � � � � � � �
�� ����� ��
��� �� �������� � � � � � � � � � � � � � � � � � � � �
�� ���������
���� ��������� ��
���� � � � � � � � � � � � � � � � � � �
��� ��������� ��
���� � � � � � � � � � � � � � � � � � � � � � � � �
���
��� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
������ ������������ ����������
� � � � � � � � � � � � � � � � �
�� ������
� ����� �� ��� � � � � � � � � � � � � � � � � � � � � � � �
��� ��������� ��� � � � � � � � � � � � � � � � � � � � � � � � �
���
�������� ��� � � � � � � � � � � � � � � � � � � � � � � � � �
���� ������ ��� � � � � � � � � � � � � � � � � � � � � � � � � �
���� ���������� ��� � � � � � � � � � � � � � � � � � � � � � � �
���������
�� �����������
�
� ��
�����
�� �����������
�������� � � � � � � � � � � � � � � � � �
�
������������
�� ��
�����
�� �����������
�������� � � � � � � �
��
����
�� ���������� �
� ����������
����
�� ��
�����
� � � � � �
���
����
�� ����������� � � � � � � � � � � � � � � � � � � � � � �
���
�������� ��
�����
�� � � � � � � � � � � � � � � � � � � � � � �
����
�������� ��
�����
�� � � � � � � � � � � � � � � � � � � � �
�
���� ����������
����
�� ����� ��
�����
� � � � � � � � � � �
�� ����
������� ��
�����
� � � � � � � � � � � � � � � � � � � � � � �
�
��� ����
������� ��������� ��
�����
� � � � � � � � � � � � �
�
���
����
������� ������
� ��
�����
� � � � � � � � � � � � � �
�
�
��
������ � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
�
� ��
��� ���� �
� ��
��� ��
����
� � � � � � � � � � � � � �
�
�
�
���������� �� ��
��� ��
����
� � � � � � � � � � � � � � � � �
�� ������� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
��� ����� ���� �� � ��
��� ���������
� ������� � � � � � � ��
���
���
����
�� ���� � � � � � � � � � � � � � � � � � � � � � � ��
�� ���
� ��� �� ����� ��
��� ���������
� � � � � � � � � � � � � � ��
� ��
���� ��
�
��� �������
�
��
���������
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
��
��
��
���������
�
��� ������� � � � � � � � � � � � � � � � � � �
�
��
� ������ ����� � � � � � � � � � � � � � � � � � � � � � � � � �
�
��
�
��������� � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
��
��
����
�� ��������� � � � � � � � � � � � � � � � � � � � � � �
�
��� ������������� ������� � � � � � � � � � � � � � � � � � � � � � � � � �
��� �������
��� ��
���� � � � � � � � � � � � � � � � � � � � � � � � � � �
��
�������������
��
���� � � � � � � � � � � � � � � � � � � � � � � � �
��
� ������������ � � � � � � � � � � � � � � � � � � � � � � � � � � �
��
�
��
������
���� ��
���� � � � � � � � � � � � � � � � � � � ��
��
�� ��
������������ � � � � � � � � � � � � � � � � � � � � � � � � ��
��
�� ������������
�� ����� �������
� � � � � � � � � � � � � � � �
��� ������������� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
���
�
��� ��������� ���������
�
��� � � � � � � � � � � � � � � � � �
���� ��
�������� ������� ��
���� � � � � � � � � � � � � � � � � �
����
��
���� ���������
� � � � � � � � � � � � � � � � � � � � �
����� ������
�� ���
����� �� ���������� � � � � � � � � � � � � � � �
����� �������
�������
� � � � � � � � � � � � � � � � � � � � � � � � ��
����
�
��� ��������� ���������
� � � � � � � � � � � � � � � � ��
� ����� ���������� ��
���� ��
�� ��� ������
�� �����
��
���� �������� � � � � � � � � � � � � � � ��
�� � ���������
� � � � � � � � � � � � � � � � � � � � � � � � � � � ��
�� �
�����������
� � � � � � � � � � � � � � � � � � � � � � � � � ��
�� �� ������
� �����
������
�����
� � � � � � � � � � � � � ��
�� �� ��������� ���������
� � � � � � � � � � � � � � � � � � � � ��
��
���������
����� � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
��
�
�
��� ���
� ����� � � � � � � � � � � � � � � � � � � � � � ��
��
�
��
��
��� ���
� ����� � � � � � � � � � � � � � � �