Integrating OR operator without losing linearity
AnsweredHi,
I am quite new to the optimisation scene and I am trying to figure out how I could integrate a component into my optimisation that excludes two of my variables from being positive at the same time without introducing non-linearities. (Specifically, in battery optimisation charging and discharging shouldn't happen at the same time). Is there a neat trick to get around the problem? (e.g. charging * discharging == 0 introduces non-linearities)
0
-
Hi,
By using SOS-1 constraint, it can be solved as MILP. For example, the constraint that the variables x and y cannot be nonzero at the same time can be written as follows:
model.addSOS(GRB.SOS_TYPE1, [x, y])
Thanks,
Ryuta0
Please sign in to leave a comment.
Comments
1 comment