use inequality sign in Yalmip #1333
Answered
by
johanlofberg
bioinfor-123
asked this question in
General discussion
-
how to model "x ~= 3" as a constraint in Yalmip ? |
Beta Was this translation helpful? Give feedback.
Answered by
johanlofberg
Sep 25, 2023
Replies: 2 comments 3 replies
-
Although ~= is supported, you should write using a disjunction using two binary variable a and b so you understand what you actually model
Another way is to write it using two integers y and z
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
johanlofberg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Although ~= is supported, you should write using a disjunction using two binary variable a and b so you understand what you actually model
[implies(a,x>=4), implies(b, x<= 2) , a+b == 1]
Another way is to write it using two integers y and z
[x == 3 + y - z, y>=0, z>=0, y+z>=1]