# Cannot perform the operation: {positive constant} ./ {concave}

Hello dear all,

I’ve come across this error :
Error using .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {positive constant} ./ {concave}

Error in ./ (line 19)
z = times( x, y, ‘./’ );

Error in Scenario_one (line 177)
minimize((1-thau/T)sum(log2(1+ denum./(term1(x^2) + term2*x + constant))))

and my problem is:

and this is my code:

coef=sum(beta)+1/Pd;
coef1=(betajamQT)/thau;
coef2=(betajamQT)/((T-thau)*Pd);

term1=-3coef2.coef1;
term2=coef.coef1+3coef2.coef1-coef2thau
Pt.beta-coef2;
constant=coef
thau
Pt.beta+coef+coef2thauPt.beta+coef2+(thauPt(beta.^2));
denum=thauPt(beta.^2);

cvx_begin
variable x
minimize((1-thau/T)sum(log2(1+ denum./(term1(x^2) + term2*x + constant))))
subject to
0 <= x <= 1
cvx_end

I have actually tried to make the function which goes into the Log, I mean Log(1+1/func) like:
constantx^2 + constantx + constant
and as it is indicated “func” is concave
Log(1+1/x) is convex
so we can say that the final function is Convex but CVX doesn’t work!

I don’t know whether this is a special case of your function. But consider
`log(1+1/(x^2+x+1))`.

The 2nd derivative evaluated at x = 0.1 is negative, and at x= 0.2 is positive. So that function is neither convex nor concave for 0 <= x <= 1.

Also, even if the function is convex, the fact that CVX rejects a program which violates its rules does not mean “CVX doesn’t work”, at least as some people would interpret it. CVX can’t handle all convex optimization problems, even aided by the best conic reformulators.