How to resolve this code error?( Invalid constraint: {convex} >= {real constant})

You haven’t show a complete program, with all variable declarations. Nor do I know what values the input data has Nor how your program supposedly corresponds to the problem definition shown in the image…

Nevertheless, based on the error message, it appears that Rlb_n_i(i) and hence sum_Rlb_n_i(i) are convex due to abs(P(n) - Pl(n))). The error message then occurs because convex >= constant is a non-convex constraint. Note that concave >= constant and ``convex <= constant` are convex constraints.

Whether the non-convex constraint in your code is really supposed to be the constraint is for you to determine, since I don’t understand what your problem actually is.given the hodgepodge of symbols with no clear definition as to which are optimization variables, and what any unstated relations may be.

1 Like