Hello all,
I am using YALMIP in the course of developing hybrid MPC controllers based on SDP and QP relaxations of MIQPs.
I wrote 2 codes, one with QP relaxation, the other with SDP. The codes are 99% the same, and they are parameterized wrt prediction horizon in terms of cycles N_cycle.
This is because intersampling is used in the MPC, in which the MPC runs every M samples (M=cycle length in terms of samples), but its prediction horizon is N=N_cycle*M.
In my case, I am using N_cycle=2 and M=5, so the MPC is solving a 10 step problem.
The optimization variable is the control sequence u, u=sdpvar(3*N,1), and 3 because there is 1 continuous and 2 binary components for every step.
The only difference between the 2 codes is that:
In the QP relaxation the integer constraint on controls is relaxed to 0<=u_i<=1 where i denotes the index of binary controls.
Whereas in the SDP relaxation [U_SDP u;u' 1]=>0 and U_SDP(i,i)==u_i where i the same as before, and U_SDP=sdpvar(3*N,3*N).
in the same thesis it is proven that the feasible sets for QP and SDP relaxations are the same, so losing feasibility etc when using SDP instead of QP is not an issue.
My problem here is that I want to run the MPC for longer horizons to compare the solution times of the 2 relaxations. The QP relaxation (solver quadprog) works without any
problems at all for virtually any N_cycle (I tried 3,4,5,15).
Where it gets interesting is that both QP (solver cplex) and SDP (solver sdpt3) only work for N_cycle=1 or 2, with 3 YALMIP
gives these error:
solvertime: 0
info: 'Solver not applicable (cplex)'
problem: -4
yalmiptime: 0.094999999999999
and
solvertime: 0
info: 'Solver not applicable (sdpt3)'
problem: -4
yalmiptime: 0.148000000000000
for the QP and SDP relaxation based MPC codes, respectively.
If the QP (with quadprog) also did not work for N_cycle=>3, I would guess that there is a problem regarding the parameterization of the code wrt N_cycle, but since it works, I
cannot track down the issue. If anybody has any ideas as to where I should look at, I would be very grateful. Any help will be tremendously appreciated.
General note: By "working" of the SDP code above I mean giving a meaningful output that can be applied to the controlled system. sdpt3 always gives some "numerical errors" or
"lack of progress" type errors, but since it gives a good enough output that manages to control the system, I disregard these. Side question: Can the positive semidefinite matrix variable U_SDP
(in the SDP relaxation code) that is output by sdpt3 as the solution having a terrible condition number (ratio of the largest to the smallest singular value) of 1e13 have anything to do with this?
I am sorry for my long question, and will be very happy to hear any comments or ideas. Thanks a lot in advance.