'Solver not applicable (cplex)' for SOCP in CPLEX 12.8.0 + MATLAB crashes in CPLEX 12.7.1

171 views
Skip to first unread message

PengXiang Liu

unread,
Jan 29, 2018, 8:40:10 AM1/29/18
to YALMIP
Dear Löfberg,
I have two problems here and I'm really looking forward to your advice. My yalmip version is R20171121.

(1) 'Solver not applicable (cplex)' for SOCP in CPLEX 12.8.0

I'm trying to use yalmip and cplex to solve a SOCP model. Most of the codes are copied from your homepage: https://yalmip.github.io/tutorial/socpprogramming/

clear all
clc
x = [1 2 3 4 5 6]';
t = (0:0.02:2*pi)';
A = [sin(t) sin(2*t) sin(3*t) sin(4*t) sin(5*t) sin(6*t)];
e = (-4+8*rand(length(A),1));
y = A*x+e;
xhat = sdpvar(6,1);
sdpvar u v
Constraint = [cone(y-A*xhat,u), cone(xhat,v)];
Objective = u + v;
options = sdpsettings('solver','cplex');
disp('Start')
diagnostics=optimize(Constraint,Objective,options);

This code works perfectly under gurobi 7.5.2 when changing options = sdpsettings('solver','cplex'); to options = sdpsettings('solver','gurobi');
This code works under MATLAB R2017a+Cplex 12.7.1 most of time, but will crash occasionally. I will illustrate it in the second problem.
However, the biggest problem is that when I want to apply cplex 12.8.0, something goes wrong. It shows that 'Warning: Solver not applicable (cplex)'

(2) MATLAB crash in CPLEX 12.7.1

In another program, I am running a mixed-integer SOCP within a genetic algorithm, hence I need several runs of the same problem with varying input parameters. 
The problem is that MATLAB crashes and exits during the one of the several runs.(MATLAB R2017a + Cplex 12.7.1)

The report shows that 'access violation detected'

What should I do?

Thank you!

Johan Löfberg

unread,
Jan 29, 2018, 8:48:23 AM1/29/18
to YALMIP
cplex 12.7 simply does not work with matlab, it is too buggy

I am surprised you got 12.8 to hook up with the latest official YALMIP release. It's not supposed to detect that version.

I've checked in a fix in the develop version so that 12.8 is detected correctly, and socp thus applicable

PengXiang Liu

unread,
Jan 29, 2018, 8:49:24 PM1/29/18
to YALMIP
yalmip could find cplex 12.8.0 through yalmiptest

|         CPLEX|       IBM 12.8.0|       found|
|         CPLEX|       IBM 12.7.1|   not found|
|         CPLEX|       IBM 12.7.1|   not found|

and it works fine with LP and QP

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|                   Test|   Solution|                    Solver message|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|   Core functionalities|        N/A|      Successfully solved (YALMIP)|
|                     LP|    Correct|   Successfully solved (CPLEX-IBM)|
|                     LP|    Correct|   Successfully solved (CPLEX-IBM)|
|                     QP|    Correct|   Successfully solved (CPLEX-IBM)|
|                     QP|    Correct|   Successfully solved (CPLEX-IBM)|
|                   SOCP|    Correct|       Successfully solved (MOSEK)|
|                   SOCP|    Correct|       Successfully solved (MOSEK)|
|                   SOCP|    Correct|       Successfully solved (MOSEK)|
|                    SDP|    Correct|       Successfully solved (MOSEK)|
|                    SDP|    Correct|       Successfully solved (MOSEK)|
|                    SDP|    Correct|       Successfully solved (MOSEK)|
|                    SDP|    Correct|       Successfully solved (MOSEK)|
|                 MAXDET|    Correct|       Successfully solved (MOSEK)|
|                 MAXDET|    Correct|       Successfully solved (MOSEK)|
|          Infeasible LP|        N/A|    Infeasible problem (CPLEX-IBM)|
|          Infeasible QP|        N/A|    Infeasible problem (CPLEX-IBM)|
|         Infeasible SDP|        N/A|        Infeasible problem (MOSEK)|
|      Moment relaxation|    Correct|       Successfully solved (MOSEK)|
|         Sum-of-squares|    Correct|       Successfully solved (MOSEK)|
|           Bilinear SDP|        N/A|                No suitable solver|
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Maybe I should try gurobi then

thanks you !
Message has been deleted

Johan Löfberg

unread,
Jan 30, 2018, 12:30:47 AM1/30/18
to YALMIP
Did you really install the develop version with the changes checked in yesterday? The fact that iyt detects the QP but not SOCP capabilities of cplex 12.8 indicates that you still use the official november release

PengXiang Liu

unread,
Jan 30, 2018, 9:59:03 PM1/30/18
to YALMIP
I have two versions of CPLEX in my computer: 12.7.1 and 12.8. But CPLEX 12.8 is the only one in my MATLAB path. I downloaded the CPLEX Optimization Studio v12.8 - Student (CJ2IKML) after the academic version was officially announced. Maybe around 24th December?

I downloaded CPLEX 12.8 from IBM website again just now, and reinstalled it on my computer, the problem is still there.

Johan Löfberg

unread,
Jan 31, 2018, 1:30:15 AM1/31/18
to YALMIP
As I said, you should use 12.8 since 12.7 constantly crashes, but the official version of YALMIP is not yet supporting 12.8 fully, so you have to install the developer version of YALMIP on github where the fix for 12.8 was checked in yesterday.

PengXiang Liu

unread,
Jan 31, 2018, 2:20:11 AM1/31/18
to YALMIP
Sorry for misunderstanding your point. I have corrected order on cplex 12.8.0 definitions in definesolvers.m according to your update on Github.

Now CPLEX 12.8 is working perfectly when solving SOCP! Thank you very much!

Actually, Yalmip R20171121 has most of the addition in definesolvers.m, except this:
(line 139~141)
+solver(i).objective.quadratic.convex = 1;
+solver(i).constraint.inequalities.elementwise.quadratic.convex = 1;
+solver(i).constraint.inequalities.secondordercone.linear = 1;
(line 662)
+solver(i).supportsinitial = 1;

So I think that is why Yalmip+CPLEX 12.8 can solve LP and QP, but cannot solve SOCP.

I'm running my SOCP program under GA now, with MATLAB R2017b and CPLEX 12.8. For now, all works well.
Hoping that IBM has fixed those bugs in version 12.8.

Thank you for your support ! Very useful ! ^_^

Johan Löfberg

unread,
Jan 31, 2018, 2:25:32 AM1/31/18
to YALMIP
Yes, that is what was updated yesterday
Reply all
Reply to author
Forward
0 new messages