How can I deal with error:log({convex})?

I think you will need to combine log(x) - log(y) into log(x/y) and see whether you can reformulate the x/y into a concave expression, possibly affine - inv_pos(concave) . For instance, something such as Can CVX solve this kind of function {x-log(1+0.01*x/(x+1))} . I don’t know whether that is possible, or indeed whether your original expression is convex or concave - if neither, it can’t be used in CVX.