Log( {convex} )

Part of My code is as follow
variable s nonnegative;
log(1 + gamma .* inv_pos(H^2 + s))
where, gamma and H are constant, s is a variable.

When I running ir , I got this error
Disciplined convex programming error:
Illegal operation: log( {convex} ).

2 Likes

I’ll presume GAMMA > 0. Then the expression is convex.

Reformulate as log(1+1/((H^2+s)/GAMMA))
then apply the first log–sum-inv solution in section 5.2.7 or the last entry in the table in section 5.2.10 of https://docs.mosek.com/modeling-cookbook/expo.html . with (H^2+s)/GAMMA) as x.

The log-sum-inv approach would be

variables s t y
t >= log_sum_exp([0 y])
(H^2+s)/GAMMA >= exp(-y)

Then use t in place of the original expression.

2 Likes