My current understanding is that this is due to the first max_w of J which results in preparing for the worst case disturbance realization of w = -1 since this maximizes the cost function. Thus, the disturbance w=1 is never optimized for. However, this contradicts the fact that the optimization is infeasible at the 4th step (before crossing Y=1), because w=-1 for all t should remain feasible (ie Y should remain below 1).
Could you please help me understand why your example fails with a disturbance within the provided uncertainty bounds. Thank you.
For comparison, the open-loop RMPC response has been attached as well. Note: I have read your IEEE paper where the example comes from as well as your dissertation, but am still a new student to optimization and MPC.
%% NOTE: Lofberg's optimization fails when we realize the worst case disturbances of w = 1 every step
clear all
addpath(genpath('YALMIP-master'))
yalmip('clear')
A = [2.938 -0.7345 0.25;4 0 0;0 1 0];
B = [0.25;0;0];
C = [-0.2072 0.04141 0.07256];
E = [0.0625;0;0];
N = 10;
W = sdpvar(N,1);
x = sdpvar(3,1);
G = [-1 <= W <= 1];
%% Closed loop approximation
V = sdpvar(N,1);
L = sdpvar(N,N,'full').*(tril(ones(N))-eye(N));
U = L*W + V;
Y = [];
xk = x;
for k = 1:N
xk = A*xk + B*U(k)+E*W(k);
Y = [Y;C*xk];
end
F = [Y <= 1, -1 <= U <= 1];
objective = norm(Y-1,1) + norm(U,1)*0.01;
[Frobust,h] = robustify([F, G],objective,[],W);
xk = [0;0;0];
ops = sdpsettings;
for i = 1:25
optimize([Frobust, x == xk(:,end)],h,ops);
%Simulate with random disturbance same as Lofberg's example
% xk = [xk A*xk(:,end) + B*value(U(1)) + E*(-1+2*rand(1))];
%Simulate with worst case disturbance w=1
xk = [xk A*xk(:,end) + B*value(U(1)) + E*1];
end
figure(1)
hold on
plot(C*xk,'b')
xk = [0;0;0];
ops = sdpsettings;
for i = 1:25
optimize([Frobust, x == xk(:,end)],h,ops);
%Simulate with random disturbance same as Lofberg's example
% xk = [xk A*xk(:,end) + B*value(U(1)) + E*(-1+2*rand(1))];
%Simulate with worst case disturbance w=-1
xk = [xk A*xk(:,end) + B*value(U(1)) + E*(-1)];
end
figure(1)
hold on
plot(C*xk,'r')
plot([0,30],[1,1],'g')
legend('Disturbance realizations: +1 for all t','Disturbance realizations: -1 for all t','Constraint')