Sum of sigmoid function and linear function

I try to play with this toy example using the summation of linear function and sigmoid function. However, the cvx shows me an illegal operation. Can someone give me suggestions? Thank you very much!!

cvx_begin
variable a
maximize 1./(1+exp(-a)) + a
subject to
1 + 1 - exp(a) >= 0
a >= 0
cvx_end

I know this optimization is not convex. But, when I just play with 1/(1+exp(-a)), it is solvable. However, when I add a linear component, it becomes unsolvable. As we all know, the linear component does not change the convexity property of the original problem. So I think there much be some way to transform the problem into a cvx-solvable one.

Take a look at the CVX manual for “log-convexity”. Your problem is not, in fact, CVX solvable. I concede that the issue is obscured by the fact that CVX accepted a non-convex result, but you got lucky there. It is non-convex and you’re not going to be able to take it further.