How to express 1/(y *(1-x)) in CVX, and y>0; 0<x<1 are the constraints.
I calculated the Hessian matric
Assume you need
t \geq \frac{1}{x*z},\quad x,z\geq 0.
Therefore,
(t*x*z)^{1/3} \geq 1
implying the geometric mean of (t,x,z) must be greater than one.
As far as I remember there is geo_mean function in cvx.
Yes, geo_mean([t,y,1-x]) >= 1
can be used Then use t
in place of 1/(y*(1-x))
.
Alternatively, prod_inv([y,1-x])
can be directly used in place of 1/(y*(1-x))
. CVX converts this under the hood to the geo_mean
formulation.
Thank you for your answering.
I tried prod_inv([y,1-x]), I wonder whether this is inv_prod(), after I had changed this, it has an error ValueError: The input must be a single CVXPY Expression, not a list. Combine Expressions using atoms such as bmat, hstack, and vstack. And I delet “” as inv_prod(y,1-x), it has an another error TypeError: inv_prod() takes 1 positional argument but 2 were given. So I wonder how to solve it? Thanks!
Thank you for your answering! I will try this method!
This is the CVX forum, for CVX, which runs under MATLAB. prod_inv
is a CVX function.
inv_prod
is the corresponding function for CVXPY. If you need help with that, see FAQ — CVXPY 1.5 documentation .
Thanks a lot! I get it!