The value of the variable in the optimization process is inconsistent with the calculation result of the optimization result

I use CVX “sdpt3” and my constraint is a string related to “ren_entr” function, and find the value of variable y has error, things will not happen when I use log function,why? This is my code.


The result of “test_rate"is -1.3e20, well if i use the optimization results of “s” and :miu” to re-calculate “test_rate” in the command window, the result of “test_rate” is “5.09”, note that the CVX status is “solved”

test_rate is an expression. In order to reliably have the optimal values of expressions after CVX completes, they must be reconstructed starting from CVX variable values. That is due to a design decision in CVX. CVX could have been designed to automatically do this, but it does not. However, the correct values of the expressions are used internally in performing the optimization.

“the value of variable y has error, things will not happen when I use log function,why”. I have no idea what error things you are talking about. You need to show actual code and error messages or describe why results are erroneous…

In the future, please copy and paste code, using Preformattted text icon, rather than posting an image of the code.

It is a very bad idea to use min, the name of a MATLAB built-in function, and which is overloaded for CVX, as a variable (or expression) name, although I don’t know what bad things if any result from that in your program.

Thanks for answering,I re-construct a simple example to describe my question, would you please see my latest topic and give me some advise. Thanks a lot