I’d like to ask everyone: what should I do if the optimization variable is embedded in a very complex objective function?



My optimization variable is embedded in a very complex and lengthy formula, making it impossible for me to directly present real(trace(V*X)) after maximize. What should I do? Should I use an expression?The variable I need to optimize, highlighted in green, is embedded in a very complex formula, as shown in the figure.The second image shows my idea.

Expressions are just a shorthand for writing your model. They don’t fundamentally do anything you can;t do without them. Expressions might make the program easier to write or understand, but their use is usually optional.

If you write a program using expressions, and CVX accepts it and the program does what you want, then declare victory and be happy.

“Can you tell me how to handle situations where the objective function is a complex expression? Thank you.”

Please do no open multiple topics on the same thing. I have moved your other topic to this one.

I have no idea what you did. The problem you showed is non-convex. Yet you show some CVX output, which indicated CVX’s Successive Approximation Method was used (and perhaps failed).

The first step is to prove the optimization problem you want to enter in CVX is a convex optimization problem. If it is, and involves exponential cone related items, such as ln, use Mosek as solver if available, otherwise, follow the advice in.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 ,

As I stated, the first step is to prove your optimization problem is convex.