Carleton University Final Exam Winter 2023
Course Number: SYSC5897X Instructor: Chao Shen
Take-Home Exam Due: April 27, 2023
1. [5pts] Solve the following linear programming (LP) problem analytically
min f(x) = c1x1 + c2x2 + ·+ cnxn
s.t. ai ≤ xi ≤ bi for i = 1, 2, ..., n
where ci 6= 0.
2. [8pts] Consider the minimization problem
min f(x) = cTx
s.t. Ax = 0, ‖x‖ ≤ 1
where ‖x‖ denotes the Euclidean norm of x.
(a) Derive the KKT conditions for the solution points of the problem.
(b) Show that if c−ATλ 6= 0 where λ satisfies
AATλ = Ac
then the minimizer is given by
x∗ = − c−A
Tλ
‖c−ATλ‖
3. [9pts] Formulate the following problems as linear programming (LP) prob-
lems in standard (primal or dual) form
(a) Minimize ‖Ax− b‖∞.
(b) Minimize ‖Ax− b‖1 subject to ‖x‖∞ ≤ 1.
(c) Minimize ‖Ax− b‖1 + ‖x‖∞.
4. [8pts] Find the Lagrange dual function of the following convex problems
(a) A quadratic program (QP) subject to linear constraints
min f(x) = xTx
s.t. Ax =
(b) A quadratic program (QP) subject to quadratic constraints
min f(x) =
1
2
xTHx+ pTx+ c
s.t.
1
2
xTP ix+ p
T
i x+ ci ≤ 0 for i = 1, 2, ..., q
1
5. [14pts] Consider the system with the following continuous-time state equation
ẋ(t) =
1 1 −20 1 1
0 0 1
x(t) +
10
1
u
y(t) = [2 0 0] x(t)
We are designing a controller u(t) = pr(t)−Kx(t) so that the closed-loop system
has eigenvalues −2 and −1± j1 and will track any step input signal r(t). Since
the controller will be implemented using a digital computer, we can also design
the system in discrete-time domain.
(a) Using forward Euler method with sampling rate 10 [Hz], find the discrete-
time model of the system. Show how you calculate the discretized system ma-
trices Ad, Bd by hand. Is it open-loop stable?
(b) Design the controller for the discrete-time system and find the feedforward
gain p and feedback gain K. Implement this discrete-time system in MATLAB
and verify your design by plotting the output y(k) for r(k) = −5, 2, and 20.
(Hint: You need to compute the co
esponding discrete-time poles (eigenvalues)
first, and then design the controller.)
6. [20pts] A cart-pendulum system is shown in Figure 1. The objective is to
alance the inverted pendulum by applying a force to the motorized cart (i.e.,
control both the position of the motorized cart x and the angular position of
the pendulum θ using the control force F ). A real-world example that relates
directly is the attitude control of a rocket at takeoff.
Figure 1: A cart-pendulum system.
(a) Denote the mass of the cart by M , the mass of the pendulum by m, the
friction coefficient by b, the length to pendulum center of mass by l, and the
2
mass moment of inertia of the pendulum by I. Perform force analysis and find
the dynamic equations.
(b) Establish a (linear) state-space model for the system assuming that the
angle θ is small. The input is u = F , and the output is y = [x, θ]T. Suppose
M = 0.5 [kg], m = 0.2 [kg], b = 0.1 [N/m/s], l = 0.3 [m], I = 0.006 [kg ·m2] and
the gravitational acceleration g = 9.8 [m/s2], then check the controllability and
observability of the system.
(c) Discretize the system using exact sampling method with sampling period
T = 0.1 [s]. Then design a LQ-optimal controller to regulate the system from
initial condition x(0) = 1 [m], ẋ(0) = 0 [m/s], θ(0) = 0.3491 [rad] and θ̇(0) = 0
[rad/s] to the origin. The design requirements are
R1) The settling time for x and θ is less than 5 seconds and
R2) The angle never deviate more than 0.35 radians, i.e., |θ| ≤ 0.35.
Implement the control system in MATLAB and plot u(k) and y(k) to verify
your design.
(d) We now have an additional requirement on the control:
R3) The control force is bounded by 2.6 [N] in magnitude, i.e., |u| ≤ 2.6.
Check if the requirements can still be met by LQ-optimal control? If not, can
you design a MPC controller to meet all the requirements? Implement the
control system in MATLAB and plot u(k) and y(k) to verify your design.
7. [16pts] The vertical position y of a machine tool positioning platform is
controlled by a motor which applies a vertical force F to the platform (Figure
2). The platform has mass M and ca
ies a variable load of mass m; the
unloaded weight of the platform is balanced by a counter-weight. The force F
is proportional to the voltage V applied to the motor, so F = KV V where KV
is a fixed gain. Assuming m is small such that M +m ≈M , the unknown load
Figure 2: Machine tool and positioning platform.
constitutes a (constant) distu
ance in the discrete-time model of the system:
x(k + 1) = Ax(k) +Bu(k) +Dw, e(k) = Cx(k)
3
A =
[
1 T
0 1
]
, B =
KV
2M
[
T 2/2
T
]
, D = − g
2M
[
T 2/2
T
]
, C = [1 0]
where T is the sampling period, and e is the e
or in y relative to a desired
steady-state height y0. The system state, input, and distu
ance are defined as
x =
[
y − y0
ẏ
]
, u = V, w = m.
(a) For the model parameters M = 10 [kg], KV = 7 [N/Vol] , T = 0.1 [s],
g = 9.8 [m/s2], the LQ-optimal control law with respect to
J(k) =
∞∑
i=0
(e2(k + i|k) + λu2(k + i|k)), λ = 10−4
is u(k) = Kx(k), K = [−66.0,−19.4]. Determine the maximum steady-state
e
or y − y0 with this controller if the mass of the load is limited to the range
m ≤ 0.5
(b) Explain how to modify the cost and model dynamics in order to obtain
a stabilizing LQ-optimal controller giving zero steady-state e
or. Verify you
answer by implement the system in MATLAB and plot the output.
(c) The motor input voltage is subject to the constraints
−1 ≤ V ≤ 1
A predictive controller is to be designed based on the predicted cost:
J(k) =
∞∑
i=0
(e2(k + i|k) + v2(k + i|k) + λu2(k + i|k)), λ = 10−4
where v(i+ 1|k) = v(i|k) + e(i|k) is the prediction of the integrated e
or. Show
that the cost function can be re-written as
J(k) =
N−1∑
i=0
(e2(k + i|k) + v2(k + i|k) + λu2(k + i|k)) + ‖ξT(k +N |k)‖2P
and define ξ and P . What is the implied mode 2 feedback control law?
(d) Explain how the constraints on V can be incorporated in a robust MPC
strategy for this system (i.e. for all values of m in the range m ≤ 0.5 [kg]).
8. (Bonus Question [10pts]) For the MPC problem in Question 6 part (d),
solve it as an explicit MPC problem (i.e, formulate it as an mp-QP and solve it
with the MPT toolbox).
Note: Please also submit the MATLAB code (m-files) for Q5, Q6 (and Q8 if
you choose to answer it).
4
����
����� ����� ���������� ��
���� ������
�
� �����
��������� ���� ���
��
���� ��
�
�
��
��
��
���������
�
� ��� ���������� ����
� ��� � � � � � � � � � � � � � � � � � � � � �
�
���� ��� �
���� � � � � � � � � � � � � � � � � � � � � � � � � � �
�� ����� ��
��� �� �������� � � � � � � � � � � � � � � � � � � � �
�� ���������
���� ��������� ��
���� � � � � � � � � � � � � � � � � � �
��� ��������� ��
���� � � � � � � � � � � � � � � � � � � � � � � � �
���
��� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
������ ������������ ����������
� � � � � � � � � � � � � � � � �
�� ������
� ����� �� ��� � � � � � � � � � � � � � � � � � � � � � � �
��� ��������� ��� � � � � � � � � � � � � � � � � � � � � � � � �
���
�������� ��� � � � � � � � � � � � � � � � � � � � � � � � � �
���� ������ ��� � � � � � � � � � � � � � � � � � � � � � � � � �
���� ���������� ��� � � � � � � � � � � � � � � � � � � � � � � �
���������
�� �����������
�
� ��
�����
�� �����������
�������� � � � � � � � � � � � � � � � � �
�
������������
�� ��
�����
�� �����������
�������� � � � � � � �
��
����
�� ���������� �
� ����������
����
�� ��
�����
� � � � � �
���
����
�� ����������� � � � � � � � � � � � � � � � � � � � � � �
���
�������� ��
�����
�� � � � � � � � � � � � � � � � � � � � � � �
����
�������� ��
�����
�� � � � � � � � � � � � � � � � � � � � �
�
���� ����������
����
�� ����� ��
�����
� � � � � � � � � � �
�� ����
������� ��
�����
� � � � � � � � � � � � � � � � � � � � � � �
�
��� ����
������� ��������� ��
�����
� � � � � � � � � � � � �
�
���
����
������� ������
� ��
�����
� � � � � � � � � � � � � �
�
�
��
������ � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
�
� ��
��� ���� �
� ��
��� ��
����
� � � � � � � � � � � � � �
�
�
�
���������� �� ��
��� ��
����
� � � � � � � � � � � � � � � � �
�� ������� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
��� ����� ���� �� � ��
��� ���������
� ������� � � � � � � ��
���
���
����
�� ���� � � � � � � � � � � � � � � � � � � � � � � ��
�� ���
� ��� �� ����� ��
��� ���������
� � � � � � � � � � � � � � ��
� ��
���� ��
�
��� �������
�
��
���������
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
��
��
��
���������
�
��� ������� � � � � � � � � � � � � � � � � � �
�
��
� ������ ����� � � � � � � � � � � � � � � � � � � � � � � � � �
�
��
�
��������� � � � � � � � � � � � � � � � � � � � � � � � � � � � �
�
��
��
����
�� ��������� � � � � � � � � � � � � � � � � � � � � � �
�
��� ������������� ������� � � � � � � � � � � � � � � � � � � � � � � � � �
��� �������
��� ��
���� � � � � � � � � � � � � � � � � � � � � � � � � � �
��
�������������
��
���� � � � � � � � � � � � � � � � � � � � � � � � �
��
� ������������ � � � � � � � � � � � � � � � � � � � � � � � � � � �
��
�
��
������
���� ��
���� � � � � � � � � � � � � � � � � � � ��
��
�� ��
������������ � � � � � � � � � � � � � � � � � � � � � � � � ��
��
�� ������������
�� ����� �������
� � � � � � � � � � � � � � � �
��� ������������� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � ��
���
�
��� ��������� ���������
�
��� �