MPT dealing with problem.

41 views
Skip to first unread message

Hussein Mazeh

unread,
Jul 28, 2019, 2:47:22 AM7/28/19
to YALMIP
Dear Mr. John,
Thank you for this effort.
I am a phd student and I have been using mpt from about two years. Also I wrote two papers and cited your libraries, it was great. My domain is control engineering.
Previously I worked on a multi parametric programming problem using mpt and I had good results. I tested these results experimentally and were fine.
My problem was:



kf=3*10^-5;
kt=3*10^-7;
L=0.23;
B=[ 1           1        1              1              1            1             
   -L/2        -L       -L/2            L/2            L            L/2   
   L*sqrt(3)/2  0       -L*sqrt(3)/2   -L*sqrt(3)/2    0            L*sqrt(3)/2  
    kt/kf       kt/kf   -kt/kf          kt/kf         -kt/kf         -kt/kf        ]


v=sdpvar(4,1);
u=sdpvar(6,1);
gamma1=sdpvar(1,1);
gamma2=sdpvar(1,1);
gamma3=sdpvar(1,1);
gamma4=sdpvar(1,1);
gamma5=sdpvar(1,1);
gamma6=sdpvar(1,1);

a=[v;gamma1;gamma2;gamma3;gamma4;gamma5;gamma6];
Qu=1*eye(6,6);
obj=(0.5).*u'*Qu*u;
ops = sdpsettings('solver','mpt','debug',1);
F=[B*u==v,1>=gamma1,1>=gamma2,1>=gamma3,1>=gamma4,1>=gamma5,1>=gamma6,gamma1>=0,gamma2>=0,gamma3>=0,gamma4>=0,gamma5>=0,gamma6>=0,u(1)>=0,u(2)>=0,u(3)>=0,u(4)>=0,u(5)>=0,u(6)>=0,gamma1*9.5>=u(1),gamma2*9.5>=u(2),gamma3*9.5>=u(3),gamma4*9.5>=u(4),gamma5*9.5>=u(5),gamma6*9.5>=u(6)];
[sol,diagnostics,aux,Valuefunction,Optimizer] = solvemp(F,obj,ops,a,u)
assign(a,[16;0;0;0;1;1;1;1;1;1]);
value(Optimizer)


Recently, I formatted my PC, and installed the new MPT3 from the official site https://www.mpt3.org/Main/Installation. When I run the script above I received the following message:
Error using quadprog (line 403)
Option Algorithm = 'trust-region-reflective' but this algorithm does not solve problems with
the constraints you have specified. Run a different algorithm by setting the Algorithm
option. For information on applicable algorithms, see Choosing the Algorithm in the
documentation.
I am confused:
The script was working before!!!
I tried " Edit the file “mpt_solvers_options.m” and look for the following lines: 


        options.quadprog.Algorithm = 'trust-region-reflective’; 
        %options.quadprog.Algorithm = 'interior-point-convex’; 

Try to comment out the first one and uncomment the second one" from your previous forums and it did not work.
My matlab is 2017b and is doing great with my other work.
please help
Regards

Johan Löfberg

unread,
Jul 28, 2019, 9:03:16 AM7/28/19
to YALMIP
sounds like you have multiple versions of quadprog in your path. hence check "which quadprog -all"

Hussein Mazeh

unread,
Jul 28, 2019, 9:53:22 AM7/28/19
to YALMIP
hello and thanks for fast response 
i tried "which quadprog -all", then i received:
C:\Program Files\MATLAB\R2017b\toolbox\optim\optim\quadprog.m
any suggestions please
regards

Johan Löfberg

unread,
Jul 28, 2019, 11:21:04 AM7/28/19
to yal...@googlegroups.com
MPTOPTIONS = mptopt;MPTOPTIONS.modules.solvers.quadprog.Algorithm = 'interior-point-convex';

appears to work, but mpt still crashes on other place due to failure in QP solve. I would recommend you to install better QP solver (gurobi/mosek/cplex) or at least enable the lcp module from tbxmanager

Hussein Mazeh

unread,
Jul 28, 2019, 12:58:19 PM7/28/19
to YALMIP
Thanks again
I tried enabling lcp from tlbxmanager but the problem remained. My question is that same script was working previously?
Please help
Regards

Johan Löfberg

unread,
Jul 28, 2019, 1:23:50 PM7/28/19
to yal...@googlegroups.com
i think you have to run mpt_init again to select qp solver and/or simply restart matlab

best though is to install a better qp solver

Hussein Mazeh

unread,
Jul 28, 2019, 5:25:35 PM7/28/19
to YALMIP
Thanks prof.
It was solved using "mosek" perfectly.
Regards
Reply all
Reply to author
Forward
0 new messages