Problem does not follow DCP rules, while it does? #2398
Replies: 2 comments 1 reply
-
Below is the complete error message: DCPError: Problem does not follow DCP rules. Specifically: |
Beta Was this translation helpful? Give feedback.
-
Hi @siyuanpurdue you can specify non-negativity constraints directly when you initialise your variables.
This should fix your issue :). |
Beta Was this translation helpful? Give feedback.
-
I have an expression of this form: x[i] * cp.abs((lot+tau*all1)@v0). It is of type Expression(UNKNOWN, UNKNOWN, (2, 6)), which is surprising to me since I have follows.
x = cp.Variable(numNodes+1)
obj_constraints = []
I have constraints saying x are all non-negative.
for i in range(numNodes+1):
obj_constraints += [x[i] >= 0]
However, cp.abs((lot+tau * all1 ) @ v0) is Expression(CONVEX, NONNEGATIVE, (2, 6)).
x[i] is Expression(AFFINE, UNKNOWN, ())?? I thought x[i] should be non-negative so that the overall expression x[i] * cp.abs((lot+tau*all1)@v0) would be judged convex?
If I want to follow DCP rules, what should I do/formulate my expression/problem?
Beta Was this translation helpful? Give feedback.
All reactions