What's the possible reason for my Failed status?

Calling SDPT3 4.0: 36599 variables, 17879 equality constraints
------------------------------------------------------------

 num. of constraints = 17879
 dim. of linear var  = 35339
 dim. of free   var  = 1260 *** convert ublk to lblk
 checkdepconstr: AAt is not pos. def.
*******************************************************************
   SDPT3: Infeasible path-following algorithms
*******************************************************************
 version  predcorr  gam  expon  scale_data
    NT      1      0.000   1        0    
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
 0|0.000|0.000|4.4e+02|3.6e+02|1.6e+10| 1.967068e+02  0.000000e+00| 0:0:01| spchol  1  1 
 1|0.741|0.351|1.1e+02|2.4e+02|4.6e+09| 2.327744e+03 -5.156482e+04| 0:0:02| spchol  1  1 
 2|0.047|0.043|1.1e+02|2.3e+02|4.4e+09| 1.962290e+04 -1.731730e+05| 0:0:04| spchol  1  1 
 3|0.151|0.183|9.3e+01|1.9e+02|4.1e+09| 4.409609e+04 -8.833084e+05| 0:0:05| spchol  1  1 
 4|0.360|0.426|5.9e+01|1.1e+02|3.2e+09| 8.579104e+04 -3.055050e+06| 0:0:06| spchol  1  2 
 5|0.402|0.145|3.6e+01|9.1e+01|2.2e+09| 1.028990e+05 -4.058666e+06| 0:0:07| spchol  1  2 
 6|0.615|0.313|1.4e+01|6.2e+01|1.1e+09| 1.011901e+05 -7.014681e+06| 0:0:09| spchol  2  2 
 7|0.587|0.366|5.7e+00|4.0e+01|5.4e+08| 1.061615e+05 -1.057685e+07| 0:0:10| spchol  2  2 
 8|0.754|0.318|1.4e+00|2.7e+01|1.9e+08| 1.248445e+05 -1.322572e+07| 0:0:11| spchol  1  2 
 9|0.661|0.424|4.7e-01|1.6e+01|9.3e+07| 1.312369e+05 -1.578301e+07| 0:0:13| spchol  2  2 
10|0.507|0.334|2.3e-01|1.0e+01|6.1e+07| 1.341277e+05 -1.639388e+07| 0:0:14| spchol  2  2 
11|0.605|0.230|9.2e-02|8.0e+00|4.1e+07| 1.363645e+05 -1.614414e+07| 0:0:15| spchol  2  2 
12|0.872|0.348|1.2e-02|5.2e+00|2.4e+07| 1.350086e+05 -1.367192e+07| 0:0:16| spchol  2  2 
13|0.726|0.502|3.2e-03|2.6e+00|1.3e+07| 1.297574e+05 -8.473942e+06| 0:0:18| spchol  2  2 
14|1.000|0.886|3.0e-07|2.9e-01|1.6e+06| 1.131399e+05 -1.065900e+06| 0:0:19| spchol  2  2 
15|0.959|0.672|4.6e-08|9.7e-02|5.3e+05| 5.523185e+04 -3.574158e+05| 0:0:20| spchol  2  2 
16|0.977|0.748|7.0e-09|2.4e-02|1.3e+05| 2.251053e+04 -8.891760e+04| 0:0:22| spchol  2  2 
17|0.954|0.086|1.1e-09|2.2e-02|9.4e+04| 7.285000e+03 -8.133617e+04| 0:0:23| spchol  2  2 
18|0.890|0.535|6.7e-10|1.0e-02|4.3e+04| 4.186803e+03 -3.763081e+04| 0:0:24| spchol  2  2 
19|0.588|0.089|4.5e-10|9.5e-03|3.9e+04| 3.559835e+03 -3.460204e+04| 0:0:26| spchol  2  2 
20|0.620|0.183|6.3e-10|7.8e-03|3.4e+04| 3.379292e+03 -3.008837e+04| 0:0:27| spchol  2  2 
21|0.696|0.474|8.2e-10|4.1e-03|2.1e+04| 3.156139e+03 -1.750492e+04| 0:0:28| spchol  2  2 
22|0.867|0.108|4.3e-10|3.7e-03|2.0e+04| 3.202068e+03 -1.663809e+04| 0:0:30| spchol  2  2 
23|0.897|0.547|1.6e-09|1.7e-03|1.3e+04| 3.023209e+03 -9.413338e+03| 0:0:31| spchol  2  2 
24|0.608|0.246|1.4e-09|1.3e-03|1.1e+04| 2.975422e+03 -7.664009e+03| 0:0:32| spchol  2  2 
25|0.959|0.182|1.7e-09|1.1e-03|9.9e+03| 2.945260e+03 -6.748345e+03| 0:0:33| spchol  2  2 
26|0.751|0.481|1.7e-09|5.6e-04|7.0e+03| 2.887082e+03 -4.036007e+03| 0:0:35| spchol  2  2 
27|0.919|0.271|2.9e-09|4.1e-04|5.8e+03| 2.802621e+03 -2.908505e+03| 0:0:36| spchol  2  2 
28|1.000|0.276|3.8e-09|3.0e-04|4.8e+03| 2.753581e+03 -1.947341e+03| 0:0:37| spchol  2  2 
29|1.000|0.281|5.4e-09|2.1e-04|4.0e+03| 2.725338e+03 -1.188513e+03| 0:0:39| spchol  2  2 
30|1.000|0.284|7.3e-09|1.5e-04|3.3e+03| 2.698996e+03 -5.703276e+02| 0:0:40| spchol  2  2 
31|1.000|0.312|1.3e-08|1.0e-04|2.6e+03| 2.658069e+03  4.501510e+01| 0:0:41| spchol  2  2 
32|1.000|0.311|1.7e-08|7.2e-05|2.1e+03| 2.625369e+03  5.480380e+02| 0:0:43| spchol  2  3 
33|0.980|0.274|2.9e-08|5.2e-05|1.7e+03| 2.610734e+03  8.786132e+02| 0:0:44| spchol  3  2 
34|0.952|0.303|3.3e-08|3.6e-05|1.4e+03| 2.589142e+03  1.194658e+03| 0:0:45| spchol  3  3 
35|1.000|0.247|2.5e-08|2.7e-05|1.2e+03| 2.589575e+03  1.375453e+03| 0:0:47| spchol  3  3 
36|0.682|0.316|5.3e-08|1.9e-05|9.8e+02| 2.573735e+03  1.598366e+03| 0:0:48| spchol  3  3 
37|0.594|0.188|3.4e-08|1.5e-05|9.0e+02| 2.576360e+03  1.677942e+03| 0:0:49| spchol  3  3 
38|0.222|0.227|3.3e-08|1.2e-05|7.9e+02| 2.572716e+03  1.783948e+03| 0:0:51| spchol  3  3 
39|1.000|0.126|3.3e-08|1.0e-05|7.2e+02| 2.550584e+03  1.835490e+03| 0:0:52| spchol  3  3 
40|0.739|0.279|8.9e-08|7.4e-06|6.1e+02| 2.548501e+03  1.941302e+03| 0:0:53| spchol  3  3 
41|0.773|0.216|1.3e-07|5.9e-06|5.5e+02| 2.547363e+03  2.001735e+03| 0:0:55| spchol  3  3 
42|0.245|0.270|1.2e-07|4.3e-06|4.7e+02| 2.544423e+03  2.079773e+03| 0:0:56| spchol  3  3 
43|0.568|0.109|8.5e-08|3.8e-06|4.4e+02| 2.541846e+03  2.100336e+03| 0:0:57| spchol  3  3 
44|0.305|0.150|7.8e-08|3.3e-06|4.3e+02| 2.544745e+03  2.117930e+03| 0:0:59| spchol  3  3 
45|0.837|0.155|1.7e-07|2.8e-06|4.0e+02| 2.537922e+03  2.143963e+03| 0:1:00| spchol  4  4 
46|1.000|0.283|5.0e-07|2.0e-06|3.3e+02| 2.527526e+03  2.196671e+03| 0:1:02|
  stop: progress is too slow
-------------------------------------------------------------------
 number of iterations   = 46
 primal objective value =  2.52752568e+03
 dual   objective value =  2.19667101e+03
 gap := trace(XZ)       = 3.33e+02
 relative gap           = 7.05e-02
 actual relative gap    = 7.00e-02
 rel. primal infeas (scaled problem)   = 5.00e-07
 rel. dual     "        "       "      = 2.02e-06
 rel. primal infeas (unscaled problem) = 0.00e+00
 rel. dual     "        "       "      = 0.00e+00
 norm(X), norm(y), norm(Z) = 1.9e+04, 1.8e+03, 5.3e+01
 norm(A), norm(b), norm(C) = 5.9e+02, 1.3e+03, 9.7e+01
 Total CPU time (secs)  = 61.55  
 CPU time per iteration = 1.34  
 termination code       = -5
 DIMACS: 5.8e-07  0.0e+00  1.8e-05  0.0e+00  7.0e-02  7.1e-02
-------------------------------------------------------------------
 
------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN
 

What’s the possible reason for my Failed status?

And there is another Failed problem:

num. of constraints = 17879
 dim. of linear var  = 35339
 dim. of free   var  = 28 *** convert ublk to lblk
 number of nearly dependent constraints = 30
 To remove these constraints, re-run sqlp.m with OPTIONS.rmdepconstr = 1.
*******************************************************************
   SDPT3: Infeasible path-following algorithms
*******************************************************************
 version  predcorr  gam  expon  scale_data
    NT      1      0.000   1        0    
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
 0|0.000|0.000|4.8e+02|3.6e+02|1.4e+10| 1.946901e+02  0.000000e+00| 0:0:01| spchol  1  1 
 1|0.921|0.466|3.7e+01|1.9e+02|1.2e+09| 7.071150e+02 -6.064523e+04| 0:0:02| spchol  1  1 
 2|0.139|0.174|3.2e+01|1.6e+02|1.1e+09| 3.066829e+03 -6.741836e+05| 0:0:02| spchol  1  1 
 3|0.343|0.455|2.1e+01|8.7e+01|9.0e+08| 7.282591e+03 -2.629754e+06| 0:0:03| spchol  1  1 
 4|0.535|0.666|9.8e+00|2.9e+01|5.3e+08| 2.158151e+04 -6.411944e+06| 0:0:04| spchol  1  2 
 5|0.832|0.696|1.7e+00|8.9e+00|1.1e+08| 4.341755e+04 -8.795619e+06| 0:0:05| spchol  1  2 
 6|0.792|0.307|3.4e-01|6.2e+00|3.4e+07| 5.325568e+04 -9.175667e+06| 0:0:06| spchol  1  2 
 7|0.483|0.489|1.8e-01|3.2e+00|2.3e+07| 5.557595e+04 -8.919658e+06| 0:0:07| spchol  2  2 
 8|0.598|0.241|7.2e-02|2.4e+00|1.5e+07| 5.756525e+04 -8.525091e+06| 0:0:08| spchol  2  2 
 9|0.893|0.339|7.7e-03|1.6e+00|8.7e+06| 5.421082e+04 -6.965429e+06| 0:0:09| spchol  2  2 
10|0.720|0.564|2.1e-03|6.9e-01|4.3e+06| 4.751279e+04 -3.629254e+06| 0:0:10| spchol  2  2 
11|1.000|0.880|5.0e-07|8.4e-02|5.6e+05| 3.255374e+04 -4.666200e+05| 0:0:11| spchol  2  2 
12|0.954|0.963|1.3e-07|3.3e-03|2.9e+04| 1.325935e+04 -1.468550e+04| 0:0:12| spchol  2  2 
13|0.750|0.008|3.5e-08|3.3e-03|2.1e+04| 5.818666e+03 -1.466252e+04| 0:0:12| spchol  2  2 
14|0.727|0.557|1.8e-07|1.5e-03|1.3e+04| 3.775680e+03 -8.876012e+03| 0:0:13| spchol  2  2 
15|0.563|0.201|1.1e-07|1.2e-03|1.1e+04| 3.321483e+03 -7.757886e+03| 0:0:14| spchol  2  2 
16|0.463|0.192|6.7e-08|9.8e-04|1.0e+04| 3.164164e+03 -6.821762e+03| 0:0:15| spchol  2  2 
17|0.550|0.302|3.3e-08|6.8e-04|8.5e+03| 3.048101e+03 -5.402127e+03| 0:0:16| spchol  2  2 
18|0.390|0.183|2.1e-08|5.6e-04|7.8e+03| 2.997627e+03 -4.717507e+03| 0:0:17| spchol  2  2 
19|0.373|0.255|1.3e-08|4.2e-04|6.9e+03| 2.962775e+03 -3.897104e+03| 0:0:18| spchol  2  2 
20|0.643|0.135|5.4e-09|3.6e-04|6.5e+03| 2.918616e+03 -3.552834e+03| 0:0:19| spchol  2  2 
21|0.298|0.337|4.2e-09|2.4e-04|5.7e+03| 2.907327e+03 -2.734155e+03| 0:0:20| spchol  2  2 
22|0.353|0.132|3.1e-09|2.1e-04|5.4e+03| 2.888580e+03 -2.481850e+03| 0:0:21| spchol  2  2 
23|0.717|0.295|2.0e-09|1.5e-04|4.5e+03| 2.819799e+03 -1.663148e+03| 0:0:22| spchol  2  2 
24|1.000|0.173|2.5e-09|1.2e-04|4.3e+03| 2.818237e+03 -1.422414e+03| 0:0:23| spchol  2  2 
25|0.710|0.527|5.4e-09|5.8e-05|3.0e+03| 2.763594e+03 -2.718117e+02| 0:0:24| spchol  2  2 
26|0.729|0.220|4.5e-09|4.5e-05|2.7e+03| 2.717898e+03  4.453386e+01| 0:0:24| spchol  2  2 
27|0.803|0.255|6.0e-09|3.4e-05|2.3e+03| 2.676920e+03  4.103358e+02| 0:0:25| spchol  3  3 
28|0.846|0.217|1.1e-08|2.6e-05|2.0e+03| 2.671781e+03  6.249632e+02| 0:0:26| spchol  3  3 
29|0.856|0.281|2.0e-08|1.9e-05|1.7e+03| 2.646394e+03  9.089026e+02| 0:0:27| spchol  3  3 
30|0.461|0.243|1.6e-08|1.4e-05|1.5e+03| 2.641075e+03  1.105716e+03| 0:0:28| spchol  3  3 
31|0.827|0.198|1.4e-08|1.2e-05|1.4e+03| 2.618118e+03  1.256318e+03| 0:0:29| spchol  3  3 
32|0.561|0.232|2.6e-08|8.9e-06|1.2e+03| 2.613509e+03  1.405946e+03| 0:0:30| spchol  3  3 
33|1.000|0.203|4.5e-08|7.1e-06|1.1e+03| 2.600836e+03  1.520335e+03| 0:0:31| spchol  3  3 
34|1.000|0.276|8.1e-08|5.1e-06|9.4e+02| 2.596835e+03  1.653065e+03| 0:0:32| spchol  3  3 
35|0.777|0.300|9.0e-08|3.6e-06|8.0e+02| 2.583906e+03  1.788623e+03| 0:0:33| spchol  3  3 
36|0.672|0.244|9.2e-08|2.7e-06|7.0e+02| 2.575800e+03  1.880674e+03| 0:0:34| spchol  3  3 
37|0.966|0.203|1.1e-07|2.2e-06|6.4e+02| 2.573613e+03  1.938156e+03| 0:0:35| spchol  3  4 
38|0.493|0.253|1.1e-07|1.7e-06|5.8e+02| 2.574379e+03  1.993815e+03| 0:0:36| spchol  3  3 
39|0.781|0.220|1.7e-07|1.3e-06|5.1e+02| 2.560407e+03  2.050802e+03| 0:0:37| spchol  4  3 
40|0.205|0.240|1.7e-07|1.0e-06|4.5e+02| 2.558922e+03  2.108066e+03| 0:0:38| spchol  3  3 
41|0.791|0.100|1.8e-07|9.7e-07|4.3e+02| 2.556567e+03  2.124488e+03| 0:0:39| spchol  3  4 
42|0.263|0.195|1.7e-07|8.1e-07|4.2e+02| 2.559248e+03  2.143462e+03| 0:0:40| spchol  3  4 
43|0.861|0.173|3.5e-07|7.1e-07|3.7e+02| 2.545930e+03  2.174570e+03| 0:0:41| spchol  4  5 
44|0.709|0.249|6.3e-07|5.8e-07|3.3e+02| 2.543521e+03  2.215154e+03| 0:0:42|
  stop: progress is too slow
-------------------------------------------------------------------
 number of iterations   = 44
 primal objective value =  2.54352131e+03
 dual   objective value =  2.21515360e+03
 gap := trace(XZ)       = 3.28e+02
 relative gap           = 6.90e-02
 actual relative gap    = 6.90e-02
 rel. primal infeas (scaled problem)   = 6.26e-07
 rel. dual     "        "       "      = 5.84e-07
 rel. primal infeas (unscaled problem) = 0.00e+00
 rel. dual     "        "       "      = 0.00e+00
 norm(X), norm(y), norm(Z) = 1.9e+04, 1.8e+03, 4.5e+01
 norm(A), norm(b), norm(C) = 5.5e+02, 1.3e+03, 9.7e+01
 Total CPU time (secs)  = 41.70  
 CPU time per iteration = 0.95  
 termination code       = -5
 DIMACS: 7.3e-07  0.0e+00  5.2e-06  0.0e+00  6.9e-02  6.9e-02
-------------------------------------------------------------------
 
------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN

Why can’t these two problems run successfully?
Thanks!

You haven’t showed us the problems. We’re not mind readers.

Nevertheless, it appears your problem has bad scaling, which is beyond SDPT3’s ability to handle. Perhaps another solver, such as Mosek, would fare better, and Mosek would provide more informative warning messages.

You should try to improve the scaling so that non-zero coefficients are within 3 or 4 orders of magnitude of 1, if possible…

Thank you very much!
In order to use mosek, I updated my cvx version (on two computers A and B). After installing the latest version of cvx, re-run the same code on the two machines. It can run normally on computer A, but the following error appears on computer B. I suspect that cvx is not installed correctly on machine B. is it? How to solve this?

Undefined function 'vec' for input arguments of type 'double'.
Error in cvx/quad_form (line 43)
v = vec( v );
Error in cvx/mtimes (line 261)
            [ z2, success ] = quad_form( xx, P, Q, R );

vec.m should be in functions\@cvx\ If not, something is messed up with the CVX installation. Try reinstalling, and start a new MATLAB session.

Thank you, Mark. I have confirmed that vec.m is indeed in functions\@cvx\, and I have reinstalled cvx and restarted matlab many times, but to no avail, what might be wrong?

I tested some typical optimization models, such as

m = 20; n = 10; p = 4;
A = randn(m,n); b = randn(m,1);
C = randn(p,n); d = randn(p,1); e = rand;
cvx_begin
    variable x(n)
    minimize( norm( A * x - b, 2 ) )
    subject to
        C * x == d
        norm( x, Inf ) <= e
cvx_end

and they can all be solved successfully. But it reports the error when running my code, and the same code can run successfully on another machine. Why?

The error is located in my objective function: minimize(alpha1' * kerMatrix * alpha1);

There should be another vec.m in functions\vrec_ I believe that is the one you need for double arguments

Thank you very much, Mark! The problem has been solved! I admire your devotion to this forum!

I have checked and confirmed that there is indeed another vec.m in functions\vrec_, and the Installation information of the two machines is the same, except for their matlab versions —

  • Installation information on machine A (normal):
---------------------------------------------------------------------------
CVX: Software for Disciplined Convex Programming       (c)2014 CVX Research
Version 2.2, Build 1148 (62bfcca)                  Tue Jan 28 00:51:35 2020
---------------------------------------------------------------------------
Installation info:
    Path: D:\cvx
    MATLAB version: 9.3 (R2017b)
    OS: Windows 10 amd64 version 10.0
    Java version: 1.8.0_121
  • Installation information on machine B (abnormal):
---------------------------------------------------------------------------
CVX: Software for Disciplined Convex Programming       (c)2014 CVX Research
Version 2.2, Build 1148 (62bfcca)                  Tue Jan 28 00:51:35 2020
---------------------------------------------------------------------------
Installation info:
    Path: C:\xxx\cvx
    MATLAB version: 9.5 (R2018b)
    OS: Windows 10 amd64 version 10.0
    Java version: 1.8.0_152

Following your prompts, I finally found out that functions\vrec_ was not added to the matlab path of machine B, while machine A did. I manually added the path and the problem was solved.

I am sure that I have installed cvx several times in the correct way. I don’t know why this path can’t be added correctly, or if there is a bug in the compatibility of MATLAB version: 9.5 (R2018b) and cvx Version 2.2.