GUROBI QCP with YALMIP

678 views
Skip to first unread message

Anton Savchenko

unread,
Oct 24, 2013, 2:31:54 PM10/24/13
to yal...@googlegroups.com
Dear Johan,

The gurobi version 5.6 claims that it is capable of solving quadratically constrained problems (including MI type), and YALMIP recognizes quadratic constraints, however, when I try to use solvesdp with quadratic constraints and gurobi as a solver, it reports "Warning: Solver not applicable (gurobi)":
>> x=sdpvar(2,1);
f=x(1)^2+x(2)^2<=4;
f=f+(x(:)>=0);
solvesdp(f,-x(1)-x(2),sdpsettings('solver','gurobi'))
[-1 -1]*double(x(:))
Warning: Solver not applicable (gurobi)

ans = 

    solvertime: 0
          info: 'Solver not applicable (gurobi)'
       problem: -4
    yalmiptime: 0.3138

CPLEX, however, recognizes it as QCP and solves it correctly...

I tried looking for the differences in solver settings via definesolvers function, but they seem to have the same values regarding supported types of inequalities.

I am using gurobi-mex 1.61, MATLAB R2012a and YALMIP 20130628.

Johan Löfberg

unread,
Oct 24, 2013, 3:45:59 PM10/24/13
to yal...@googlegroups.com
Gurobimex is no longer actively supported. Remove it from your path and use Gurobis own MATLAB interface which comes with your standard installation.

Johan Löfberg

unread,
Oct 25, 2013, 2:00:15 AM10/25/13
to yal...@googlegroups.com
Just to make sure there is no misunderstanding: When I say use Gurobis own interface, I mean you use YALMIP and simply make sure YALMIP find Gurobis interface in the path

>> which gurobi
C:\gurobi560\win64\matlab\gurobi.mexw64




hewa saleh

unread,
Dec 20, 2016, 4:02:17 PM12/20/16
to YALMIP
HIi
I for Economic Dispatch problems use that gurobi connect with YALMIP but errors that is ' Error using eval
Undefined function or variable 'interface'.
Error in solvesdp (line 350)
    eval(['output = ' solver.call '(interface);']);
Error in Untitled434 (line 158)
solvesdp(Con,V,opt) '
please help me

Johan Löfberg

unread,
Dec 20, 2016, 4:04:21 PM12/20/16
to YALMIP
where what how? reproducible simple example required

hewa saleh

unread,
Dec 20, 2016, 7:18:00 PM12/20/16
to YALMIP
To connect MATLAB to Gurobi and also YALMIP ,What to do?please Along with steps

Mark L. Stone

unread,
Dec 20, 2016, 10:56:04 PM12/20/16
to YALMIP
Make sure you have the license stuff for Gurobi installed p0er directions from Gurobi.

Then add the matlab directory, which is two levels down from the top level Gurobi directory, to your MATLAB path.  Using win64, the directory to add to the MATLAB path is <top level Gurobi directory>\win64\matlab .

Then YALMIP should find Gurobi and use it if Gurobi is selected as the solver.

hewa saleh

unread,
Dec 21, 2016, 2:28:20 PM12/21/16
to YALMIP
Hi,Dr
In your opinion, what's the problem?
hewa.m

Johan Löfberg

unread,
Dec 21, 2016, 2:37:40 PM12/21/16
to YALMIP
Besides the fact that your code runs slowly as you're doing everything in for-loops instead of vectorizing large parts of your code, I don't know what you want me to have an opinion about. You have a large mixed-integer SOCP. If you are lucky it will be solved, but it can just as well run until the suffers from heat death in 10^500 years before proving optimality

Johan Löfberg

unread,
Dec 21, 2016, 2:38:36 PM12/21/16
to YALMIP
solved to 5% optimality in a minute of so though

Johan Löfberg

unread,
Dec 21, 2016, 2:41:03 PM12/21/16
to YALMIP
and this error can only be the result of a completely failed installation of YALMIP or something similiar
Reply all
Reply to author
Forward
0 new messages