Adding SCS Solver to CVX's solvers list

Hi all,

I have downloaded CVX 3 beta for using SCS solver because the solvers mosek, sedumi, and sdpt3 do not give me the correct answer. They actually solve my problem but when I check some of the constraints, I see they are violated. I have read in one of the topics here that SCS may be a better option for avoiding this violation. However, I do not know how I can include this solver to the solver list. When I write the command cvx_solver, the table only includes the three aforementioned solvers and SCS is not there. I would appreciate your help.

You need to have SCS running under MATLAB. Then reinstall CVX 3.0beta, and it should be added to the CVX solver list.

if you provide full reproducible code, show all solver/CVX output, and show what the amounts of the constraints violations are, readers might be able to provide advice on solving your actual problem. You have to expect violations at solver feasibility tolerance level, for instance 1e-8.

Thank you very much for your prompt reply Mark.
You are completely right about providing the reproducible code. However, it is not a single CVX code. It is a function whose output is the optimized value of the CVX code and its inputs are taken from another functions.
I also have read in some of your comments in other topics that CVXQUAD is a better option for solving logarithmic problems because it does not use the unreliable successive approximation method. I have installed CVXQUAD and modified my codes based on the functions defined in it. However, when running the code, I still see the message “Successive approximation method to be employed.” and the results from mosek, sdpt3, and sedumi are so much different. Is there anything I need to do to ensure successive approximation is not used for solving the problem?

Actually I am trying different ways to get a reliable output for my problem, but no success so far.

Mark, I found out that I cannot use SCS because my MATLAB version is 2014a and a weired compilation error comes up when I try to run the make_scs command.

I just want to use some method other than successive approximation to get a more accurate and reliable result for my problem. I am trying to use CVXQUAD but it still uses successive approximation. I followed your instructions in this topic to see how I can ensure Pade Approximant is used and not successive approximation. I replaced “log(cvx_expression)” with “-rel_entr(1,cvx_expresion)” but I get the following error :

Capture

What should I do?

What you should do is at least show all the solver/CVX output. It would be good to show your code.

Do NOT use CVX3.0beta with CVXQUAD (as mentioned in my post you linked). Use CVX2.1. If you still have difficulties, try running this (it is not using the successive approximation method, despite the WARNING).

cvx_begin
variable x
maximize(-rel_entr(1,x+1))
CVX Warning:
Models involving “rel_entr” or other functions in the log, exp, and entropy
family are solved using an experimental successive approximation method.
This method is slower and less reliable than the method CVX employs for
other models. Please see the section of the user’s guide entitled
The successive approximation method
for more details about the approach, and for instructions on how to
suppress this warning message in the future.
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
=====================================

1 <= x <= 2
cvx_end

Calling SDPT3 4.0: 21 variables, 8 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 8
dim. of sdp var = 12, num. of sdp blk = 6
dim. of linear var = 3


SDPT3: Infeasible path-following algorithms


version predcorr gam expon scale_data
HKM 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|4.0e+00|7.3e+00|2.6e+03| 1.472333e+02 0.000000e+00| 0:0:07| chol 1 1
1|1.000|0.918|9.3e-07|6.7e-01|3.3e+02| 1.192065e+02 -5.199038e+01| 0:0:13| chol 1 1
2|1.000|0.885|1.4e-06|8.4e-02|5.4e+01| 2.765149e+01 -1.402471e+01| 0:0:13| chol 1 1
3|0.929|1.000|1.4e-07|7.7e-04|8.7e+00|-2.785301e+00 -1.137094e+01| 0:0:13| chol 1 1
4|0.940|0.959|3.4e-08|1.1e-04|5.1e-01|-8.324612e+00 -8.821078e+00| 0:0:13| chol 1 1
5|0.985|0.978|3.4e-08|9.9e-06|3.8e-02|-8.501695e+00 -8.539166e+00| 0:0:13| chol 1 1
6|0.982|0.980|7.0e-09|9.6e-07|7.3e-04|-8.516702e+00 -8.517348e+00| 0:0:13| chol 1 1
7|0.960|0.979|3.4e-10|2.1e-08|2.1e-05|-8.516969e+00 -8.516988e+00| 0:0:13| chol 1 1
8|0.971|0.987|1.1e-11|3.4e-10|1.0e-06|-8.516980e+00 -8.516981e+00| 0:0:13| chol 1 1
9|1.000|1.000|9.5e-15|2.1e-12|1.4e-07|-8.516980e+00 -8.516980e+00| 0:0:13|
stop: max(relative gap, infeasibilities) < 1.49e-08

number of iterations = 9
primal objective value = -8.51698021e+00
dual objective value = -8.51698035e+00
gap := trace(XZ) = 1.40e-07
relative gap = 7.77e-09
actual relative gap = 7.76e-09
rel. primal infeas (scaled problem) = 9.54e-15
rel. dual " " " = 2.12e-12
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 4.2e+01, 2.9e+00, 6.5e+00
norm(A), norm(b), norm© = 4.9e+00, 1.2e+01, 5.0e+00
Total CPU time (secs) = 12.84
CPU time per iteration = 1.43
termination code = 0
DIMACS: 1.3e-14 0.0e+00 3.5e-12 0.0e+00 7.8e-09 7.8e-09


Status: Solved
Optimal value (cvx_optval): +1.09861

1 Like

Thank you very much Mark. As you mentioned, the problem was with CVX 3 and CVXQUAD works well with CVX2.1.