Integrating OR operator without losing linearity
回答済みHi,
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)
-
正式なコメント
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
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,
Ryuta1 -
Hi Ryuta,
Apologies for the late response, I just got around to trying your suggestion. It worked great, thank you very much.
Best,
Adam
0
投稿コメントは受け付けていません。
コメント
3件のコメント