My optimization problem is acceptable for CVX, but a wrong solution will be computed. It should be noted that ‘cvx_bound’ is ‘Inf’ but ‘cvx_optval’ is caculated as ‘9.667’ which may be reason for wrong solution. The optimization problem is formulated as:
The code you show should not be accepted by CVX. In particular, the (1-y) * (1-x) term in the 2nd argument of rel_entr violates CVX’s DVP rules.
Moreover, according to my calculations, the Hessian of (1-x)*log(((1-x)*(1-y)+y)/(1-x)) is indefinite. Therefore, the objective function is neither convex nor concave, and therefore can not be reformulated to be acepeted by CVX.
If you have a run in which your program was accepted and CVX produced an optimal solution, please show all the output.
Please start a new MATLAB session. Then copy and paste your program into that new session and run it. Show us all the output. Also show the output from running cvx_version .
Please copy and paste, using Preformatted text icon, that MATLAB session into a post. Do not post an image. I am still trying to figure out how your program could execute without an error message from CVX in your maximize statement.
I think this program must have been accepted by CVX due to a bug in CVX 3.0beta. CVX 3.0beta does extend he DCP rules and allow some programs which CVX 2,1 does not, but this program should not be accepted. I have no idea what problem CVX 3.0beta actually is submitting to the solver, but youy should consider any answer provided to be wrong.
Edit: I see you used CvX 3.0beta Build 1175, which is not the most recent build of 3.0beta. I still recommend that you not use CVX 3.0beta, but if you do, at least change to 3.0beta Build 1183, which is the most recent 3.0beta vuild.
Edit2: I ran this program under CVX 30beta Build 1183, and duplicated your results. I then specified cvx_solver scs, which utilized scs’ native exponential cone capability, and got the same result (to several decimal places). So apparently CVX 3.0beta is formulating the same wrong problem both for its successive approximation method and for utilization of the native exponential cone capability of scs.
A little birdie told me the optimal solution to your non-convex problem above is
optimal objective = 4.9010
optimal x = 0.4322
optimal z = [1.0001 0.9799 1.0196]’
Note that the norm(z) <= sqrt(N) constraint is active (satisfied with equality) at the optimum.
I will not assess whether the problem you provided is a good real-world model of whatever you are trying to apply it to, but it is a “valid” mathematical optimization problem which has a solution. if that is the problem you actually want to solve, I recommend you use something other than CVX.