CVX giving 'Solved' outcome not satisfying the constraints

Hello,

I’m trying to solve an optimization problem, but sometimes (it depends on the setup), even if the problem is ‘Solved’, the constraints are violated (of a non-negligible value for my purpose).

The constraint is not ignored: the solver tries to solve it, since the solution changes if I remove the constraint.

Do you know what can be the possible reason for it?

Please post the log output from the optimizer.

Hi, here is the log output:

Calling SDPT3 4.0: 12702 variables, 828 equality constraints
   For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------

 num. of constraints = 828
 dim. of sdp    var  = 69,   num. of sdp  blk  =  1
 dim. of socp   var  = 10285,   num. of socp blk  = 237
 dim. of linear var  =  2
*******************************************************************
   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.4e+02|1.7e+01|6.6e+05|-9.275310e+01  0.000000e+00| 0:0:01| chol  1  1 
 1|0.913|0.527|3.8e+01|8.2e+00|9.3e+04| 1.686667e+03 -4.170506e+03| 0:0:03| chol  1  1 
 2|0.775|0.384|8.6e+00|5.1e+00|7.8e+04| 8.206826e+03 -3.324472e+03| 0:0:03| chol  1  1 
 3|0.521|0.541|4.1e+00|2.4e+00|3.6e+04| 6.318042e+03 -2.351082e+03| 0:0:03| chol  1  1 
 4|0.067|0.079|3.8e+00|2.2e+00|3.3e+04| 5.390059e+03 -2.433373e+03| 0:0:04| chol  1  1 
 5|0.123|0.213|3.4e+00|1.7e+00|2.7e+04| 3.943323e+03 -2.768705e+03| 0:0:04| chol  1  1 
 6|0.139|0.298|2.9e+00|1.2e+00|2.0e+04| 1.901893e+03 -3.379967e+03| 0:0:05| chol  1  1 
 7|0.074|0.168|2.7e+00|1.0e+00|1.7e+04| 7.055639e+02 -3.978860e+03| 0:0:05| chol  1  1 
 8|0.255|0.234|2.0e+00|7.7e-01|1.3e+04|-2.206246e+03 -4.990655e+03| 0:0:05| chol  1  1 
 9|0.165|0.553|1.7e+00|3.5e-01|8.9e+03|-3.808614e+03 -7.664588e+03| 0:0:06| chol  1  1 
10|0.130|0.121|1.5e+00|3.0e-01|7.9e+03|-5.582948e+03 -8.070865e+03| 0:0:06| chol  1  1 
11|0.302|0.272|1.0e+00|2.2e-01|5.9e+03|-8.413481e+03 -9.202364e+03| 0:0:06| chol  1  1 
12|0.459|0.879|5.5e-01|2.7e-02|2.2e+03|-9.830209e+03 -1.132723e+04| 0:0:07| chol  1  1 
13|0.708|0.830|1.6e-01|4.6e-03|5.9e+02|-1.092732e+04 -1.138595e+04| 0:0:07| chol  2  1 
14|0.861|0.942|2.2e-02|3.0e-04|7.4e+01|-1.128115e+04 -1.134428e+04| 0:0:07| chol  2  2 
15|0.917|0.934|1.8e-03|6.1e-05|6.8e+00|-1.133422e+04 -1.133926e+04| 0:0:08| chol  2  2 
16|0.911|0.949|1.7e-04|1.3e-05|6.1e-01|-1.133872e+04 -1.133899e+04| 0:0:08| chol  2  2 
17|0.896|0.956|1.7e-05|8.2e-07|6.1e-02|-1.133911e+04 -1.133915e+04| 0:0:08| chol  3  3 
18|0.898|0.939|1.8e-06|7.5e-08|6.5e-03|-1.133916e+04 -1.133916e+04| 0:0:09| chol  7  8 
19|0.844|0.926|2.7e-07|9.7e-09|1.0e-03|-1.133916e+04 -1.133916e+04| 0:0:09| chol 
  linsysolve: Schur complement matrix not positive definite
  switch to LU factor. lu 30  20 
20|0.871|0.920|4.5e-08|1.3e-09|1.4e-04|-1.133916e+04 -1.133916e+04| 0:0:10| lu 30  30 
21|0.706|0.852|5.5e-08|3.6e-10|4.1e-05|-1.133916e+04 -1.133916e+04| 0:0:10| lu 30  30 
22|0.141|0.246|7.8e-08|4.1e-10|3.7e-05|-1.133916e+04 -1.133916e+04| 0:0:11| lu 30  30 
23|0.057|0.168|8.8e-08|4.9e-10|3.7e-05|-1.133916e+04 -1.133916e+04| 0:0:11|
  stop: progress is too slow
  stop: progress is bad
  lack of progress in infeas
-------------------------------------------------------------------
 number of iterations   = 23
 primal objective value = -1.13391597e+04
 dual   objective value = -1.13391598e+04
 gap := trace(XZ)       = 1.43e-04
 relative gap           = 6.31e-09
 actual relative gap    = 4.65e-09
 rel. primal infeas (scaled problem)   = 4.54e-08
 rel. dual     "        "       "      = 1.33e-09
 rel. primal infeas (unscaled problem) = 0.00e+00
 rel. dual     "        "       "      = 0.00e+00
 norm(X), norm(y), norm(Z) = 1.4e+04, 8.6e+02, 1.1e+03
 norm(A), norm(b), norm(C) = 1.4e+02, 1.2e+02, 1.9e+01
 Total CPU time (secs)  = 11.20  
 CPU time per iteration = 0.49  
 termination code       = -5
 DIMACS: 4.9e-07  0.0e+00  6.3e-09  0.0e+00  4.7e-09  6.3e-09
-------------------------------------------------------------------
 
------------------------------------------------------------
Status: Inaccurate/Solved
Optimal value (cvx_optval): +10569

The decision variable is a matrix called K and the critical constraint is:

beta-alpha'*(I+BBB*K)*AAA*mu_0_aug-(norm(((Sig_op)^0.5*(I+BBB*K)'*alpha,2)+norm((Sig_aug)^0.5*alpha,2))*failnorm <= 0;

but the final value that should be lower than zero is 1.7796 instead.

This is just an example of Inaccurate/Solved but it happens on a similar scale also when the problem is marked as Solved.

SDPT3 has a hard time to solve the problem. I cannot say from the log output why. Data seems reasonable scaled and solutions too.

You could try another optimizer like Mosek.

How did you evaluate the LHS of the critical constraint? The only reliable way to do so is starting from the optimal values of CVX variables, and building up the LHS from those. The numerical values of CVX expressions after CVX completes may not be the actual optimal values used internally by CVX and the solver, so evaluating the LHS starting with CVX expressions, as opposed to CVX variables, could result in an incorrect determination as to whether the constraint is actually satisfied.

One other possibility is bad scaling, perhaps with subtraction of large numbers on the LHS. The optimal objective value of 10569 is rather large and suggests your scaling is not very good.

Thanks but Mosek doesn’t solve the problem, since it even marks it as infeasible.
SeDuMi gives the same solution of SDPT3.

Hello!

So if I’m not wrong you mean that if I have inside of CVX something like

variable K
a = f(K) %generic function of K
minimize J(K)
subject to
a<0

I should take K and compute a again instead of using the a that is given as output from the CVX environment, am I right?

If that’s the case, I already do it and it doesn’t change anything.

After CVX successfully completes, you can directly use anything declared as a CVX variable, and it will have the optimal value. Anything else might not have the optimal value, even though CVX and the solver actually correctly solved the problem; but it’s just that CVX doesn’t guarantee that CVX expressions will be populated with their final optimal values.

So if you did that “properly”, that leaves bad numerical scaling as the prime suspect.

One other possibility is a bug. In particular, CVX 3.0beta has many bugs, including not correctly imposing constraints in some cases. So use CVX 2.2 rather than CVX 3.0beta.

Yes, I imagined that that was what you meant since I had similar problems previously so I already noticed that expressions that are related to the cvx variable may not be the correct ones after the optimisation.

I actually already have the 2.2 version, since I don’t even see the 3.0beta in the download page.

Any suggestion or some good source about how to perform a proper scaling?

Change units or whatever to try to get non-zero numbers to be within a small number of orders of magnitude of one.

Does Mosek show any warnings, such as very large or small numbers? if so, you should pay attention to that.

Perhaps if you show the Mosek output, including any warnings, @Erling or someone else form Mosek can give a better assessment.

The CVX 3.0beta link is http://cvxr.com/cvx/beta/ . It has a low profile because its use is not recommended at this point.

The Mosek output is the following:

Calling Mosek 9.1.9: 12702 variables, 828 equality constraints
   For improved efficiency, Mosek is solving the dual problem.
------------------------------------------------------------

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (12) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (13) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (14) of matrix 'A'.
MOSEK warning 710: #6 (nearly) zero elements are specified in sparse col '' (15) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (16) of matrix 'A'.
MOSEK warning 710: #6 (nearly) zero elements are specified in sparse col '' (17) of matrix 'A'.
MOSEK warning 710: #12 (nearly) zero elements are specified in sparse col '' (18) of matrix 'A'.
MOSEK warning 710: #9 (nearly) zero elements are specified in sparse col '' (19) of matrix 'A'.
MOSEK warning 710: #11 (nearly) zero elements are specified in sparse col '' (20) of matrix 'A'.
MOSEK warning 710: #20 (nearly) zero elements are specified in sparse col '' (21) of matrix 'A'.
Warning number 710 is disabled.
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 828             
  Cones                  : 237             
  Scalar variables       : 10287           
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 1
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.02            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.08    
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 828             
  Cones                  : 237             
  Scalar variables       : 10287           
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer  - threads                : 4               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 827
Optimizer  - Cones                  : 237
Optimizer  - Scalar variables       : 5013              conic                  : 5012            
Optimizer  - Semi-definite variables: 1                 scalarized             : 2415            
Factor     - setup time             : 0.03              dense det. time        : 0.00            
Factor     - ML order time          : 0.00              GP order time          : 0.00            
Factor     - nonzeros before factor : 2.20e+05          after factor           : 2.28e+05        
Factor     - dense dim.             : 0                 flops                  : 2.68e+08        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   6.9e+01  4.0e+00  2.0e+00  0.00e+00   -3.043578051e+00  0.000000000e+00   1.0e+00  0.19  
Optimizer terminated. Time: 0.33    


Interior-point solution summary
  Problem status  : DUAL_INFEASIBLE
  Solution status : DUAL_INFEASIBLE_CER
  Primal.  obj: -3.0435780510e+00   nrm: 1e+00    Viol.  con: 7e+01    var: 0e+00    barvar: 0e+00    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 0.33    
    Interior-point          - iterations : 0         time: 0.28    
      Basis identification  -                        time: 0.00    
        Primal              - iterations : 0         time: 0.00    
        Dual                - iterations : 0         time: 0.00    
        Clean primal        - iterations : 0         time: 0.00    
        Clean dual          - iterations : 0         time: 0.00    
    Simplex                 -                        time: 0.00    
      Primal simplex        - iterations : 0         time: 0.00    
      Dual simplex          - iterations : 0         time: 0.00    
    Mixed integer           - relaxations: 0         time: 0.00    

------------------------------------------------------------
Status: Infeasible
Optimal value (cvx_optval): +Inf

The problem is the exact same as the previous one. Moreover, I forgot to say that it worked properly with SDPT3 and SeDuMi with additional constraints that I decided to remove later.

About the scaling, the variable I get at the end is a 20*66 matrix that is lower-block triangular (about 753 decision variables). The highest element after the (wrong) optimization is done with SDPT3 or SeDuMi is 32.5802, the lowest is -58.5389.

Talking about absolute values, the highest is of course 58.5389 while the lowest (non-zero) is 0.001. Is it enough to consider the problem badly scaled?

The problem is that this matrix represents a sequence of feedback control actions and I can’t predict which ones will be big or small (and therefore need to be scaled) before the optimisation is performed.

The Mosek certificate does not look very solid. It has a large violation. So it seems many solvers agree to numerically struggle on your problem. Maybe it is illposed, barely feasible/infeasible? You may also have some extremely small inputs which can affect scaling according to the Mosek warnings.

What does it mean that there is a violation?
I downloaded it from the site following the instructions using my student credentials.

Actually there isn’t a matrix A in my cvx environment. Is it a name given to a specific kind of matrix?

The infeasibility certificate is not too accurate just like the SDPT3 solution is not too accurate. As I wrote before, from the joint behavior of all solvers it seems clear that you have a nasty problem, but without the data it is not possible for us here to deduce why.

Try to solve the problem with zero objective with different solvers to see what they think of feasibility.

If you would like to continue investigating the numerical behavior of Mosek then maybe posting fully reproducible code with input data on https://groups.google.com/g/mosek would be the way to go. You can also save the Mosek task to a file send it to Mosek support. For instructions see https://docs.mosek.com/9.2/faq/faq.html#how-do-i-dump-the-problem-to-a-file-to-attach-with-my-support-question

@Michal_Adamaszek Can you please explain how the accuracy of the infeasibility certificate can be concluded by looking at the Mosek output?

The (linear) constraint violation in solution summary is 7e+1.

Hello,

Here is the outcome for the feasibility problem with the three solvers I used:

SDPT3:

Calling SDPT3 4.0: 12702 variables, 828 equality constraints
   For improved efficiency, SDPT3 is solving the dual problem.
------------------------------------------------------------

 num. of constraints = 828
 dim. of sdp    var  = 69,   num. of sdp  blk  =  1
 dim. of socp   var  = 10285,   num. of socp blk  = 237
 dim. of linear var  =  2
*******************************************************************
   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.8e+03|1.7e+01|7.8e+04|-1.377110e+01  0.000000e+00| 0:0:01| chol  1  1 
 1|0.871|0.518|6.2e+02|8.2e+00|1.6e+04| 5.543706e+02  0.000000e+00| 0:0:03| chol  1  1 
 2|0.508|0.313|3.0e+02|5.7e+00|1.2e+04| 1.281700e+03  0.000000e+00| 0:0:03| chol  1  1 
 3|0.477|0.434|1.6e+02|3.2e+00|6.7e+03| 1.163648e+03  0.000000e+00| 0:0:04| chol  1  1 
 4|0.349|0.496|1.0e+02|1.6e+00|3.7e+03| 1.024569e+03  0.000000e+00| 0:0:04| chol  1  1 
 5|0.623|0.507|3.9e+01|8.0e-01|1.6e+03| 6.845766e+02  0.000000e+00| 0:0:05| chol  1  1 
 6|0.652|0.511|1.4e+01|3.9e-01|6.1e+02| 3.637381e+02  0.000000e+00| 0:0:05| chol  1  1 
 7|0.787|0.736|2.9e+00|1.0e-01|1.4e+02| 1.091292e+02  0.000000e+00| 0:0:05| chol  1  1 
 8|0.488|1.000|1.5e+00|7.4e-07|6.8e+01| 5.781303e+01  0.000000e+00| 0:0:06| chol  1  1 
 9|0.985|1.000|2.2e-02|7.4e-08|1.0e+00| 8.710054e-01  0.000000e+00| 0:0:06| chol  1  1 
10|0.989|1.000|2.5e-04|4.5e-03|1.1e-02| 9.600938e-03  0.000000e+00| 0:0:07| chol  1  1 
11|0.988|1.000|2.9e-06|4.9e-05|1.3e-04| 1.144955e-04  0.000000e+00| 0:0:07| chol  1  1 
12|0.989|1.000|3.2e-08|5.8e-07|1.5e-06| 1.304675e-06  0.000000e+00| 0:0:07| chol  1  1 
13|0.475|1.000|1.7e-08|6.5e-09|8.1e-07| 6.919944e-07  0.000000e+00| 0:0:08| chol  1  1 
14|0.474|1.000|9.0e-09|3.4e-09|4.3e-07| 3.678439e-07  0.000000e+00| 0:0:08| chol  1  1 
15|0.474|1.000|4.7e-09|1.8e-09|2.3e-07| 1.955423e-07  0.000000e+00| 0:0:08| chol  1  1 
16|0.474|1.000|2.5e-09|9.5e-10|1.2e-07| 1.039518e-07  0.000000e+00| 0:0:09| chol  1  1 
17|0.474|1.000|1.3e-09|5.0e-10|6.6e-08| 5.526333e-08  0.000000e+00| 0:0:09| chol  1  1 
18|0.474|1.000|6.9e-10|2.6e-10|3.5e-08| 2.938027e-08  0.000000e+00| 0:0:09| chol  1  1 
19|0.474|1.000|3.6e-10|1.4e-10|1.9e-08| 1.562025e-08  0.000000e+00| 0:0:10| chol  1  1 
20|0.474|1.000|1.9e-10|7.3e-11|1.0e-08| 8.304876e-09  0.000000e+00| 0:0:10| chol  1  1 
21|0.474|1.000|1.0e-10|3.8e-11|5.4e-09| 4.415615e-09  0.000000e+00| 0:0:11| chol  1  1 
22|0.474|1.000|5.3e-11|2.0e-11|2.9e-09| 2.347804e-09  0.000000e+00| 0:0:11| chol *    1 
23|0.474|1.000|2.8e-11|1.1e-11|1.5e-09| 1.248375e-09  0.000000e+00| 0:0:11| chol *    1 
24|0.474|1.000|1.5e-11|5.6e-12|8.2e-10| 6.638045e-10  0.000000e+00| 0:0:12| chol *    1 
25|0.474|1.000|7.7e-12|2.9e-12|4.4e-10| 3.530169e-10  0.000000e+00| 0:0:12| chol *    1 
26|0.474|1.000|4.1e-12|1.5e-12|2.3e-10| 1.877647e-10  0.000000e+00| 0:0:12| chol *    1 
27|0.474|1.000|2.1e-12|1.0e-12|1.2e-10| 9.988342e-11  0.000000e+00| 0:0:13| chol *    1 
28|0.474|1.000|1.1e-12|1.0e-12|6.6e-11| 5.314135e-11  0.000000e+00| 0:0:13| chol *    1 
29|0.474|1.000|5.9e-13|1.0e-12|3.5e-11| 2.827677e-11  0.000000e+00| 0:0:13| chol *    1 
30|0.473|1.000|3.1e-13|1.0e-12|1.9e-11| 1.504817e-11  0.000000e+00| 0:0:14| chol *    1 
31|0.473|1.000|1.6e-13|1.0e-12|1.0e-11| 8.009272e-12  0.000000e+00| 0:0:14| chol *    1 
32|0.473|1.000|8.6e-14|1.0e-12|5.4e-12| 4.263404e-12  0.000000e+00| 0:0:15| chol *    1 
33|0.473|1.000|4.5e-14|1.0e-12|2.9e-12| 2.269723e-12  0.000000e+00| 0:0:15| chol *    1 
34|0.473|1.000|2.4e-14|1.0e-12|1.5e-12| 1.208485e-12  0.000000e+00| 0:0:15| chol *    1 
35|0.473|1.000|1.3e-14|1.0e-12|8.3e-13| 6.435174e-13  0.000000e+00| 0:0:16| chol *    1 
36|0.473|1.000|6.6e-15|1.0e-12|4.4e-13| 3.427120e-13  0.000000e+00| 0:0:16| chol *    1 
37|0.473|1.000|3.5e-15|1.0e-12|2.4e-13| 1.825354e-13  0.000000e+00| 0:0:17| chol *    1 
38|0.473|1.000|1.8e-15|1.0e-12|1.3e-13| 9.723288e-14  0.000000e+00| 0:0:17|
  lack of progress in infeas
-------------------------------------------------------------------
 number of iterations   = 38
 primal objective value =  6.43517365e-13
 dual   objective value =  0.00000000e+00
 gap := trace(XZ)       = 8.26e-13
 relative gap           = 8.26e-13
 actual relative gap    = 6.44e-13
 rel. primal infeas (scaled problem)   = 1.26e-14
 rel. dual     "        "       "      = 9.99e-13
 rel. primal infeas (unscaled problem) = 0.00e+00
 rel. dual     "        "       "      = 0.00e+00
 norm(X), norm(y), norm(Z) = 3.4e-13, 1.5e+03, 2.1e+03
 norm(A), norm(b), norm(C) = 1.4e+02, 1.0e+00, 1.9e+01
 Total CPU time (secs)  = 16.99  
 CPU time per iteration = 0.45  
 termination code       =  0
 DIMACS: 1.3e-14  0.0e+00  4.8e-12  0.0e+00  6.4e-13  8.3e-13
-------------------------------------------------------------------
 
------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): -6.43517e-13

SeDuMi:

Calling SeDuMi 1.3.4: 12702 variables, 828 equality constraints
   For improved efficiency, SeDuMi is solving the dual problem.
------------------------------------------------------------
SeDuMi 1.3.4 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.
Alg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500
eqs m = 828, order n = 546, dim = 15049, blocks = 239
nnz(A) = 507409 + 0, nnz(ADA) = 452540, nnz(L) = 226684
 it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec
  0 :            7.87E+00 0.000
  1 :   0.00E+00 5.94E+00 0.000 0.7555 0.9000 0.9000   7.09  1  1  5.9E+01
  2 :   0.00E+00 4.87E+00 0.000 0.8185 0.9000 0.9000   0.75  1  1  6.3E+01
  3 :   0.00E+00 3.24E+00 0.000 0.6657 0.9000 0.9000   0.67  1  1  5.5E+01
  4 :   0.00E+00 1.99E+00 0.000 0.6156 0.9000 0.9000   0.66  1  1  4.0E+01
  5 :   0.00E+00 1.41E+00 0.000 0.7063 0.9000 0.9000   0.19  1  1  3.1E+01
  6 :   0.00E+00 9.42E-01 0.000 0.6694 0.9000 0.9000   0.04  1  1  2.5E+01
  7 :   0.00E+00 6.63E-01 0.000 0.7030 0.9000 0.9000   0.64  1  1  1.7E+01
  8 :   0.00E+00 4.25E-01 0.000 0.6422 0.9000 0.9000   0.37  1  1  1.3E+01
  9 :   0.00E+00 2.54E-01 0.000 0.5974 0.9000 0.9000   0.92  1  1  6.8E+00
 10 :   0.00E+00 7.31E-02 0.000 0.2876 0.9000 0.9000   1.01  1  1  1.8E+00
 11 :   0.00E+00 1.35E-02 0.000 0.1852 0.9000 0.9076   1.12  1  1  3.2E-01
 12 :   0.00E+00 9.27E-05 0.000 0.0068 0.9990 0.9990   1.02  1  1  2.2E-03
 13 :   0.00E+00 7.96E-07 0.000 0.0086 0.9990 0.9990   1.00  1  1  1.9E-05
 14 :   0.00E+00 6.83E-09 0.000 0.0086 0.9990 0.9990   1.00  1  1  1.6E-07
 15 :   0.00E+00 5.87E-11 0.000 0.0086 0.9990 0.9990   1.00  1  1  1.4E-09
 16 :   0.00E+00 1.94E-11 0.000 0.3300 0.9000 0.6299   1.00  1  1  4.7E-10
 17 :   0.00E+00 8.07E-12 0.000 0.4169 0.9225 0.9000   0.94  1  1  2.0E-10
 18 :   0.00E+00 4.54E-12 0.000 0.5622 0.9247 0.9000   0.77  1  1  1.3E-10
 19 :   0.00E+00 2.92E-12 0.044 0.6441 0.9300 0.9000   0.56  1  1  9.1E-11
 20 :   0.00E+00 2.03E-12 0.288 0.6952 0.9274 0.9000   0.34  1  1  7.4E-11
 21 :   0.00E+00 1.39E-12 0.332 0.6858 0.9416 0.9000   0.14  1  1  6.1E-11
 22 :   0.00E+00 9.36E-13 0.448 0.6717 0.9537 0.9000   0.00  1  1  5.1E-11
 23 :   0.00E+00 8.01E-13 0.499 0.8554 0.9000 0.9000  -0.06  1  1  4.8E-11
 24 :   0.00E+00 5.54E-13 0.000 0.6920 0.9000 0.9117  -0.04  1  1  4.2E-11
 25 :   0.00E+00 3.10E-13 0.000 0.5595 0.9151 0.9000  -0.08  1  1  3.2E-11
 26 :   0.00E+00 2.03E-13 0.000 0.6553 0.9000 0.9362  -0.04  1  1  2.8E-11
 27 :   0.00E+00 1.13E-13 0.000 0.5544 0.9058 0.9000  -0.07  1  1  2.0E-11
 28 :   0.00E+00 6.37E-14 0.000 0.5655 0.9000 0.9084  -0.12  1  1  1.7E-11
 29 :   0.00E+00 3.21E-14 0.000 0.5041 0.9000 0.8638  -0.15  1  1  1.3E-11
 30 :   0.00E+00 1.45E-14 0.000 0.4505 0.9000 0.9000  -0.20  1  1  9.3E-12
 31 :   0.00E+00 7.45E-15 0.000 0.5148 0.9000 0.9000  -0.23  1  1  7.6E-12
 32 :   0.00E+00 3.27E-15 0.000 0.4396 0.9000 0.9000  -0.25  1  1  5.7E-12
 33 :   0.00E+00 1.44E-15 0.000 0.4403 0.9000 0.9000  -0.26  1  1  4.4E-12
 34 :   0.00E+00 6.09E-16 0.000 0.4226 0.9000 0.9000  -0.23  1  1  3.3E-12
 35 :   0.00E+00 2.75E-16 0.000 0.4518 0.9000 0.9000  -0.25  1  1  2.6E-12
 36 :   0.00E+00 1.14E-16 0.000 0.4143 0.9000 0.9000  -0.25  1  1  1.9E-12
 37 :   0.00E+00 4.98E-17 0.000 0.4364 0.9000 0.9000  -0.27  1  1  1.5E-12
 38 :   0.00E+00 2.00E-17 0.000 0.4022 0.9000 0.9000  -0.26  1  1  1.1E-12
 39 :   0.00E+00 8.75E-18 0.000 0.4371 0.9000 0.9000  -0.29  1  1  8.6E-13
 40 :   0.00E+00 3.44E-18 0.000 0.3933 0.9000 0.9000  -0.31  1  1  6.5E-13
 41 :   0.00E+00 1.40E-18 0.000 0.4060 0.9000 0.9000  -0.34  1  1  5.1E-13
 42 :   0.00E+00 5.00E-19 0.000 0.3581 0.9000 0.9000  -0.37  1  1  3.8E-13
 43 :   0.00E+00 1.79E-19 0.000 0.3584 0.9000 0.9000  -0.43 12 13  3.0E-13
 44 :   0.00E+00 1.16E-21 0.134 0.0065 0.9900 0.0000  -0.03 14 15  2.3E-14
Run into numerical problems.

iter seconds digits       c*x               b*y
 44     20.2  -0.1  4.3177282836e-07  0.0000000000e+00
|Ax-b| =   8.5e-14, [Ay-c]_+ =   0.0E+00, |x|=  9.8e-08, |y|=  2.7e+07
No sensible solution found.

Detailed timing (sec)
   Pre          IPM          Post
4.270E-01    1.538E+01    2.001E-02    
Max-norms: ||b||=0, ||c|| = 3.660474e+00,
Cholesky |add|=0, |skip| = 304, ||L.L|| = 1199.29.
------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN

Mosek:

Calling Mosek 9.1.9: 12702 variables, 828 equality constraints
   For improved efficiency, Mosek is solving the dual problem.
------------------------------------------------------------

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86

MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (12) of matrix 'A'.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col '' (13) of matrix 'A'.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col '' (14) of matrix 'A'.
MOSEK warning 710: #6 (nearly) zero elements are specified in sparse col '' (15) of matrix 'A'.
MOSEK warning 710: #4 (nearly) zero elements are specified in sparse col '' (16) of matrix 'A'.
MOSEK warning 710: #6 (nearly) zero elements are specified in sparse col '' (17) of matrix 'A'.
MOSEK warning 710: #12 (nearly) zero elements are specified in sparse col '' (18) of matrix 'A'.
MOSEK warning 710: #9 (nearly) zero elements are specified in sparse col '' (19) of matrix 'A'.
MOSEK warning 710: #11 (nearly) zero elements are specified in sparse col '' (20) of matrix 'A'.
MOSEK warning 710: #20 (nearly) zero elements are specified in sparse col '' (21) of matrix 'A'.
Warning number 710 is disabled.
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 828             
  Cones                  : 237             
  Scalar variables       : 10287           
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 1
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries                  : 2                 time                   : 0.00            
Lin. dep.  - tries                  : 1                 time                   : 0.01            
Lin. dep.  - number                 : 0               
Presolve terminated. Time: 0.08    
Problem
  Name                   :                 
  Objective sense        : min             
  Type                   : CONIC (conic optimization problem)
  Constraints            : 828             
  Cones                  : 237             
  Scalar variables       : 10287           
  Matrix variables       : 1               
  Integer variables      : 0               

Optimizer  - threads                : 4               
Optimizer  - solved problem         : the primal      
Optimizer  - Constraints            : 827
Optimizer  - Cones                  : 237
Optimizer  - Scalar variables       : 5013              conic                  : 5012            
Optimizer  - Semi-definite variables: 1                 scalarized             : 2415            
Factor     - setup time             : 0.05              dense det. time        : 0.00            
Factor     - ML order time          : 0.02              GP order time          : 0.00            
Factor     - nonzeros before factor : 2.20e+05          after factor           : 2.28e+05        
Factor     - dense dim.             : 0                 flops                  : 2.68e+08        
ITE PFEAS    DFEAS    GFEAS    PRSTATUS   POBJ              DOBJ              MU       TIME  
0   6.9e+01  4.0e+00  2.0e+00  0.00e+00   -3.043578051e+00  0.000000000e+00   1.0e+00  0.19  
Optimizer terminated. Time: 0.33    


Interior-point solution summary
  Problem status  : DUAL_INFEASIBLE
  Solution status : DUAL_INFEASIBLE_CER
  Primal.  obj: -3.0435780510e+00   nrm: 1e+00    Viol.  con: 7e+01    var: 0e+00    barvar: 0e+00    cones: 0e+00  
Optimizer summary
  Optimizer                 -                        time: 0.33    
    Interior-point          - iterations : 0         time: 0.30    
      Basis identification  -                        time: 0.00    
        Primal              - iterations : 0         time: 0.00    
        Dual                - iterations : 0         time: 0.00    
        Clean primal        - iterations : 0         time: 0.00    
        Clean dual          - iterations : 0         time: 0.00    
    Simplex                 -                        time: 0.00    
      Primal simplex        - iterations : 0         time: 0.00    
      Dual simplex          - iterations : 0         time: 0.00    
    Mixed integer           - relaxations: 0         time: 0.00    

------------------------------------------------------------
Status: Infeasible
Optimal value (cvx_optval): +Inf

Looks really weird that for the same problem I get three different outcomes from the three solvers.
It is also weird that as I said the problem was efficently solved with more constraints than these ones (even though the cost function was a bit different, but it shouldn’t affect feasibility).

If you think there’s more to investigate I’ll send the code to the Mosek forum.

Thank you in advance.

The Mosek result looks buggy. We need the problem to debug it.

Alright, then I should send the code to https://groups.google.com/g/mosek as @Michal_Adamaszek suggested, right?

The other solution I suggested is even better: You can also save the Mosek task to a file send it to Mosek support. For instructions see https://docs.mosek.com/9.2/faq/faq.html#how-do-i-dump-the-problem-to-a-file-to-attach-with-my-support-question The email is in https://www.mosek.com/support/