# Could the objective function value reported by the CVX be fake?

We solved the CVX optimization problem with the CVX tool.
The variables in the optimization problem are all continuous. Mosek solver was successfully utilized. The CVX claimed that the problem has been solved and print that “Status: Solved”

However, we found that the objective function value claimed by the CVX tool (shown in the red box)
is different from the one (shown in the green box) obtained by substituting the resulting solutions into the objective function.

It is weird. Could you plz explain this to us? Thanks so much!

You haven’t shown the entirety of what you have done, so I can not determine conclusively what is going on.

However, after CVX conclusion with optimal solution, only CVVX variables are guaranteed to have their optimal values. CVX expressions (other than CVX variables) do not necessarily have their optimal values, and must be recomputed after CVX conclusion using CVX variables. Nevertheless, CVX expressions are still used correctly inside the optimization problem, but their values after CVX conclusion are not necessarily their final “optimal” values used inside the optimization problem.

1 Like

Dear Sir:
Thanks so much for your fast reply and explanation. It helps us a lot.
I think we got your point.
Just for a double-check. Could you plz look at the attached picture, wherein the question is presented.

Optimal value (cvx_optval) should be correct.

If you compute the optimal objective value yourself after CVX execution ends, you must start from CVX variables, not CVX expressions.

1 Like

Thanks, sir!

Do you mean Optimal value (cvx_optval) is exactly the final optimal objective function value after the CVX execution ends?

Yes, that is what I mean. …

1 Like