Status failed but with results

I am running below codes by cvx toolbox:

variable w(M*J,1) complex
minimize max(abs(C_clo’*w))
subject to
for i = 1:subband
abs(Ck(:,i)’*w) <= 0.01;
real(C0’*w) == f0;

However, the status shown failed. I verified both of the constraints and found that the second one (real(C0’*w) == f0) seems not satisfied by logical operation, while the difference could be very slight as shown in the graph. May I know in this situation can the results be used?

I will be appreciated if anyone can help with this!

We don’t know what you mean by Status failed because you haven’t shown the CVX and solver output.

Even if the solver and CVX claim to have succeeded in finding an optimum, (equality) constrains only need be satisfied to within a feasibility tolerance. Therefore, you can’t expect equality constraints be satisfied as logical equalities The results you displayed showed those elements of the equality constraint are satisfied to at least 4 decimal places.

See . I recommend you keep tolerances at default values.

Hi Mark,

Very thanks for your reply. My result is shown as below. That might be the issue of precision. I will set the precision as “low” and check again. Thanks for your suggestion!

You still haven’;t shown the solver output.

And I did not recommend changing the precision from the default. I recommended keeping it at the default.

Hi Mark,
Below is my output. Hope you could give me some advice. Many thanks!

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

num. of constraints = 1723
dim. of socp var = 3966, num. of socp blk = 1322
dim. of linear var = 1323
dim. of free var = 80 *** convert ublk to lblk

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|1.3e+03|3.8e+02|1.0e+07| 3.464102e-01 0.000000e+00| 0:0:00| spchol 2 1
1|0.068|0.539|1.2e+03|1.7e+02|3.6e+06| 5.936808e-01 -3.234891e+02| 0:0:01| chol 1 1
2|0.845|0.301|1.9e+02|1.2e+02|6.1e+05| 1.815026e+01 -3.708450e+02| 0:0:01| chol 1 1
3|0.981|0.981|3.5e+00|2.4e+00|1.0e+04| 1.824056e+01 -3.935877e+02| 0:0:02| chol 1 1
4|0.996|0.985|1.3e-02|4.2e-02|3.7e+02| 1.732875e+01 -3.057461e+02| 0:0:03| chol 2 2
5|1.000|0.983|1.6e-04|5.7e-03|1.5e+01| 3.348566e+00 -1.084047e+01| 0:0:03| chol 1 1
6|0.980|0.728|9.1e-05|1.8e-03|4.0e+00| 8.369040e-02 -3.898831e+00| 0:0:04| chol 3 4
7|1.000|0.123|1.7e-05|1.6e-03|3.5e+00|-1.477483e-01 -3.588926e+00| 0:0:04| chol 5 5
8|1.000|0.645|5.9e-05|5.8e-04|1.5e+00|-2.566909e-01 -1.745660e+00| 0:0:05| chol 2 2
9|1.000|0.321|3.4e-05|4.0e-04|1.0e+00|-4.973709e-01 -1.494242e+00| 0:0:05| chol 29 26
10|0.948|0.398|1.2e-04|2.5e-04|6.0e-01|-7.115155e-01 -1.296761e+00| 0:0:06| chol 3 3
11|1.000|0.350|6.1e-05|1.7e-04|3.7e-01|-8.396022e-01 -1.192435e+00| 0:0:07| chol 3 3
12|0.891|0.352|1.2e-04|1.2e-04|2.4e-01|-8.921473e-01 -1.123280e+00| 0:0:07| chol 4 4
13|0.437|0.252|1.5e-04|1.1e-04|1.9e-01|-9.063960e-01 -1.091329e+00| 0:0:08| chol 4 4
14|0.214|0.112|1.4e-04|1.2e-04|1.8e-01|-9.111056e-01 -1.080930e+00| 0:0:08| chol 5 5
15|0.212|0.066|1.1e-04|1.4e-04|1.7e-01|-9.144602e-01 -1.075595e+00| 0:0:09| chol 8 8
16|0.281|0.121|8.5e-05|1.5e-04|1.5e-01|-9.205942e-01 -1.066403e+00| 0:0:09| chol 12 15
17|0.295|0.138|6.2e-05|1.4e-04|1.4e-01|-9.258004e-01 -1.057299e+00| 0:0:10| chol
linsysolve: Schur complement matrix not positive definite
switch to LU factor. lu 30 ^ 9
18|0.548|0.345|3.0e-05|1.1e-04|9.7e-02|-9.433229e-01 -1.036956e+00| 0:0:11| lu 11 30
19|0.026|0.023|6.5e-05|1.1e-04|9.3e-02|-9.446592e-01 -1.036024e+00| 0:0:11| lu 30 ^20
20|0.190|0.153|5.5e-05|1.0e-04|8.1e-02|-9.489952e-01 -1.028177e+00| 0:0:12| lu 30 30
21|0.419|0.341|3.8e-05|7.7e-05|5.7e-02|-9.590876e-01 -1.014361e+00| 0:0:13| lu 30 ^14
22|0.604|0.386|1.7e-05|5.5e-05|2.9e-02|-9.785441e-01 -1.006564e+00| 0:0:14| lu 30 30
23|0.555|0.205|1.5e-05|4.7e-05|1.9e-02|-9.855100e-01 -1.004685e+00| 0:0:15| lu 11 30
24|0.249|0.160|1.8e-05|4.2e-05|1.6e-02|-9.873955e-01 -1.003822e+00| 0:0:16| lu 30 30
25|0.271|0.149|1.4e-05|3.9e-05|1.4e-02|-9.892877e-01 -1.003048e+00| 0:0:17| lu 30 ^21
26|0.680|0.080|8.8e-06|3.9e-05|1.0e-02|-9.924876e-01 -1.002718e+00| 0:0:18| lu 30 ^28
27|0.083|0.039|1.5e-05|3.9e-05|9.8e-03|-9.928091e-01 -1.002583e+00| 0:0:19| lu 30 ^ 9
28|0.057|0.030|1.9e-05|4.1e-05|9.6e-03|-9.930359e-01 -1.002471e+00| 0:0:20|
stop: progress is bad

number of iterations = 28
primal objective value = -9.93035860e-01
dual objective value = -1.00247094e+00
gap := trace(XZ) = 9.60e-03
relative gap = 3.21e-03
actual relative gap = 3.15e-03
rel. primal infeas (scaled problem) = 1.94e-05
rel. dual " " " = 4.05e-05
rel. primal infeas (unscaled problem) = 0.00e+00
rel. dual " " " = 0.00e+00
norm(X), norm(y), norm(Z) = 5.3e+01, 1.2e+03, 3.1e+01
norm(A), norm(b), norm© = 7.4e+02, 2.0e+00, 7.3e+00
Total CPU time (secs) = 19.63
CPU time per iteration = 0.70
termination code = -5
DIMACS: 1.9e-05 0.0e+00 1.5e-04 0.0e+00 3.1e-03 3.2e-03

Status: Failed
Optimal value (cvx_optval): NaN

Maybe your problem is near infeasible and therefore giving SDPT3 a hard time.

I would try Sedumi and/or Mosek to see what happens since they are better at dealing with infeasible problems.

Follow @Erling’s advice.

I am surprised if the CVX variable w had any value other than NaN after the solver failed. In any event, the values of the CVX variables should be considered to be meaningless after the solver fails, and should not be used for anything.

Hi Erling,

Many thanks for your advice! I will try them!

Hi Mark,

Many thanks for your reply! I am surprised about the results as well since the obtained w can satisfy both of the constraints (although the logical operation seems inconsistent but the tolerance seems acceptable) while the status shows failed. As you said the variable should be considered to be meaningless in this case, I will try Mosek and Sedumi then.