Log of a convex function multiplied by convex function

Hello everyone,

I am working on optimization of a function of (variable h) i.e,

max f(h)=log ( h^2 + a^2 ) * ( a + 2 sqrt (h^2+a^2) ) ,

where a and h both are non negative.

Also ‘(h^2 + a^2)’ is convex inside the log function and ‘sqrt (h^2+a^2)’ is also convex.

I also proved that the second derivative of this function ‘f(h)’ itself is positive. Therefore I wanted to write it in CVX but it is giving me an error 'invalid log(convex ) ’ function. Please guide me if there is a way to write it in cvx.

My calculations in MAPLE show that this is not convex for all nonnegative a and h. For instance, the 2nd derivative w.r.t. h is negative for a= 0.1, h = 0.01.

Yeah, my mistake.

If we put a condition on a that is a>2 (just for the safe side although non-negativity seems true if a>0.3)the second derivative is positive.

Then would I be able to write it in CVX? Now its convex in the range defined.

x^2 + a^2 rears it ugly head again. If this can not be handled by one of the Mosek posters, it’s another candidate for @Erling’s convex modeling challenge Express 1/(a^2+x^2) in cvx

Note that in this case, with a, which is an input value (i.e., constant) suitably restricted, the function appears to be convex over the entirety of its domain.

BTW, your plot is not accepted on this forum as being a proof. I think it is convex for a >= 0.23, but I haven’t proven it.

I did prove it theoretically for a>2 (because of its simplified form), but I just showed it here with the graph.

It means there is no other way but a numerical solution to solve this type of problem in CVX or elsewhere so far.

Are you sure you want to maximize? For that the function would have to be concave.

Whoops, I wasn’t even paying attention to that.

max f(h)=-log ( h^2 + a^2 ) * ( a + 2 sqrt (h^2+a^2) ) ,

Sorry this is the problem or
min f(h)=log ( h^2 + a^2 ) * ( a + 2 sqrt (h^2+a^2) ) ,

My mistake. But I do want to solve this problem.

That seems hard to write in conic form. The a + in the second bracket is the main problem.

If we don’t have ‘a’ here then can we write it in CVX. If yes then how. Really appreciate your response.

In conic form you can do

t\geq 4u\log(u),\quad u\geq \sqrt(x^2+a^2)

(entropy and quadratic cone). If a is large enough to ensure you fall in the range where u\log(u) is increasing then this is the same as

t\geq 2\log(x^2+a^2)\sqrt(x^2+a^2)

1 Like

Hi again Sir,

I tried to write the problem by addition of some other terms now the problem looks like this

max f(h)=z/y;
where
z=- log ( h^2 + a^2 ) * ( M * (a + 2 sqrt (h^2+a^2))-N h ) ,

, y=P * (a + 2 sqrt (h^2+a^2))-Q h
, N=8.31,M=5.19,P=1.76;Q=2.28. I proved that for a>2 the function z is concave and y is alwasys convex. There are references that says global optimal exists but I still could not write it in CVX . Please guide me thanks.

This is extremely unlikely to be representable in conic form.