Since the problem is unconstrained, a minimum can be found. However, when I execute the code, sometimes, cvx_status is ‘Failed’ and the output is ‘NAN’. How does it happen. Is there something wrong with my code? Thank you very much.
You haven’t provided a reproducible problem. So forum readers can’t try for themselves.
If you show the solver and CVX output, perhaps a forum reader will be able to help you.
Does the solver report that it ran into numerical problems? In such a case, a poorly scaled problem (input data) might be a contributing factor. If the solver ran into numerical problems, the CVX variable values might be NaN.
Does CVX status show the problem was determined to be infeasible? If so, the CVX variable values would be NaN.
Have you tried another solver? Gurobi and Mosek are more robust and reliable than SeDuMi. SDPT3, and ECOS.
Thank you for your reply! I’ve tried cvx with Mosek. However, Gurobi still seems unavailable with academic license. I notice that whether the optimization ends up with succeed or failure depends on the specific values of H, J and y. On account that the problem looks convex and bounded, the optimization should always find a minimum. Is there something important that I missed ? Thank you!
Here is the full CVX status of one failed trial. I don’t really understand what “MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (9) of matrix ‘A’.” means, since all the matrices are actually not very sparse.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (9) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (10) of matrix ‘A’.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col ‘’ (11) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (22) of matrix ‘A’.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (23) of matrix ‘A’.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (35) of matrix ‘A’.
MOSEK warning 710: #3 (nearly) zero elements are specified in sparse col ‘’ (46) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (65) of matrix ‘A’.
MOSEK warning 710: #2 (nearly) zero elements are specified in sparse col ‘’ (70) of matrix ‘A’.
MOSEK warning 710: #1 (nearly) zero elements are specified in sparse col ‘’ (71) of matrix ‘A’.
Warning number 710 is disabled.
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 30
Cones : 3
Scalar variables : 130
Matrix variables : 1
Integer variables : 0
MOSEK is complaining about model coefficient values which are too close to zero without being exactly zero. In the run shown, such coefficients are apparently causing such great numerical difficulty that MOSEK is unable to solve the problem (in double precision), even though there might exist an exact solution which could be found if high enough precision arithmetic were used. You should try to get numerical coefficients in your model to be either exactly zero or within a small number of orders of magnitude of one.