# How to solve the problem the operation: {real affine} .* {convex}

Hello, I am new CVX user. So I need help to solve my function. My objective function is (x/(1-x))

I try to solve in CVX software, but results show Disciplined convex programming error:
Cannot perform the operation: {real affine} .* {convex}

How to solve the problem. Please be advise and thanks in advance. Code below:

cvx_begin
cvx_expert true
cvx_precision best
variable x nonnegative
maximize x
subject to
0.1 <= x <= 1;
x.*inv_pos((1-x)) <= 10;
cvx_end

The expression \frac{x}{1-x} is convex on (-\infty; 1] and concave on [1; \infty).

On the convex region you rewrite \frac{x}{1-x} = \frac{1}{1-x} - 1 and represent the epigraph as
t \geq \frac{1}{1-x} - 1 \Longleftrightarrow (t+1)(1-x) \geq 1,
using a rotated quadratic cone (a single second-order cone). As expected, this latter constraint implicitly bounds t+1 \geq 0 and 1-x \geq 0.

On the concave region you rewrite \frac{x}{1-x} = \frac{1}{\frac{1}{x} + \frac{1}{(-1)}} and represent the hypograph as
2t \leq \frac{2}{\frac{1}{x} + \frac{1}{(-1)}}
using the generalized harmonic mean (a single second-order cone). As expected, this latter constraint implicitly bounds x + (-1) \geq 0.

Thank you so much Henrik.

Dear hfriberg, I try to do solution but not yet solve CVX
Code given below:
cvx_begin
variable x semidefinite;
variable t semidefinite;
maximize x
subject to
(t + 1)*(1 - x) >= 1;
(t + 1) >= 0;
(1 - x) >= 0;
cvx_end

How to write code? Thanks in advance

Sorry, but I rarely use cvx. I do know, however, that you can represent sets (http://web.cvxr.com/cvx/doc/basics.html#set-membership) and that the rotated quadratic cone—also known as rotated lorentz cone—is supported (http://web.cvxr.com/cvx/doc/funcref.html?highlight=rotated_lorentz#sets). That should get you going.

Thanks dear Henrik for link