# Error using cvx/pow_cvx (line 144) Disciplined convex programming error: Illegal operation: pow_p( {convex}, {-1} ) Error in cvx/inv_pos (line 5) y = pow_cvx( x, -1, 'pow_p' );

``````cvx_begin
variables x_1 y_1

phi_0 = (T2*inv_pos((1-x_1-(x_1.*T2))))
phi_1 = T2*inv_pos(1-y_1-(y_1.*T2))
phi_2 = T2*inv_pos(1-y_1-(y_1.*T2))

T = ((R_1.*((a*inv_pos((b.*phi_0)+(a)))+(c*inv_pos((d.*phi_1)+c))))+(R_2.*((a*inv_pos((b.*phi_0)+a))+(f*inv_pos((g.*phi_2)+f)))))
maximize(T)
subject to
x_1+x_2 == 1
y_1+y_2 == 1
0 < x_1 <= 0.47
0 < y_1 <= 0.47
cvx_end
``````

%%%%%%%%%%%%%%%%%%%%%%%%%
It gives this error. Can anyone help?

Error using cvx/pow_cvx (line 144)
Disciplined convex programming error:
Illegal operation: pow_p( {convex}, {-1} )

Error in cvx/inv_pos (line 5)
y = pow_cvx( x, -1, ‘pow_p’ );

Error in my_test1 (line 76)
T =
((R_1.((ainv_pos((b.phi_0)+(a)))+(cinv_pos((d.phi_1)+c))))+(R_2.((a*inv_pos((b.phi_0)+a))+(finv_pos((g.*phi_2)+f)))))

help inv_pos

inv_pos Reciprocal of a positive quantity.
inv_pos(X) returns 1./X if X is positive, and +Inf otherwise.
X must be real.

`````` For matrices and N-D arrays, the function is applied to each element.

Disciplined convex programming information:
inv_pos is convex and nonincreasing; therefore, when used in CVX
specifications, its argument must be concave (or affine).
``````

The argument of `inv_pos` must be concave, but your argument is convex, because it is the output of another `inv_pos`.

Have you proven this problem is convex?

Yes. I have proven that. Since it is a maximization problem, I have tried and proved that it is concave.

" The argument of `inv_pos` must be concave, but your argument is convex, because it is the output of another `inv_pos`" What can I do for this?

Did it manually. Proved by using the Hessian matrix and by taking its determinant, the determinant is less than zero for the considered range of x_1 and y_1.

Show us. We don’t even know the values of the constants.

Even if your objective function is concave, if it is concave on the constraint set, but not concave over the entirety of its natural domain, you have little prospect of reformulating it in a way which CVX will accept.