CVX doesn’t allow dividing CVX variables (except in gp mode). And inv_pos is not a way around that rule. In this case, specifically you are multiplying a CVX variable by a convex expression ( inv_pos(....) ), which is not allowed.

I don’t know how, if at all, CVX can be used for your problem, because I don’t know what you want to do with mu.

Your first task is to determine whether your optimization problem is convex.

If you do have a convex optimization problem which can be formulated in CVX, things might not go well numerically unless you get the input numbers much closer to 1 in magnitude (by rescaling).

The portion of the program you show doesn’t have integer or binary variable declarations, so I removed the categorization of MIDCP.