I used CVX to solve a convex optimization problem and got an result of “Failed”. One of the constraints which is further rewritten as the SOC form(see the picture).
I want to know if the corresponding code is correct?.
variable pai2(E,N) nonnegative
expression F_45(E,N) %(45)
for e=1:E %(F45)
for e=1:E %(45)
If you write them carefully, they will be correct. For SOC definition, check https://docs.mosek.com/modeling-cookbook/cqo.html
And, please show your failed output, it might help.
Thank you for your reply.
cvx_quiet true, and show all solver and CVX output.
Also, try a different solver, such as sedumi, and if available to you, mosek or gurobi.
One of the most common reasons for solver failure is “bad” input data, such as from poor scaling, with some input data many orders of magnitude from one.
Thank you for your reply!
I will try to download other solvers.
The output is shown as below after removing
That output shows that CVX"s successive approximation method was used, which means there must be some exponential cone (including log) type functions in your code. Apparently, they must be in code which you omitted. That was indeed a crucial omission.
In light of that, use CVX 2.2 with mosek as solver. If that is not available to you, follow the directions at CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions
Thank you for your help,I will consider using mosek as solver.
Do you know what is wrong according to the result ? And my solver is mosek.
You are getting a rather suspicious infeasibility certificate. First fix the scaling (see all the warnings) to get a numerically more stable problem where the coefficients and the expected solution are in reasonable range. Sections 8.1, 8.2 here will be useful https://docs.mosek.com/latest/toolbox/debugging-tutorials.html