HOW CAN I solve the issue “Cannot perform the operation: {log-affine} .* {real affine} ”

exp(Z)*Z for `Z being a CVX variable violates CVX’s rules for log-convexity, as described in @mcg’s post at Log of sigmoid function - #3 by mcg

However, .exp(Z)*Z is the lambert W function, which can be handled in CVX by using the formulation in section 5.2.9 “Lambert W-function” of the Mosek Modeling Cookbook.

You will need to use rotated_lorentz for the rotated second order cone (adjusted with an appropriate factor for CVX vs. the Mosek Modeling Cookbook due to the different convention used in CVX. And exponential cone arguments are in a different order in CVX.

I believe the Mosek Modeling Cookbook formulation in CVX for exp(Z)*Z would be:(if I haven’t made a mistake)

{1,u,t} == rotated_lorentz(1)
{u,t,Z} == exponential(1)

You’ll need to put this in a double loop over i and j, and have u,t,Z` all of the same dimensions as Z., and then index all of them by i,j. I was a little rushed, so might have made mistakes; so please check it.

1 Like