Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以帮我线性化这个含义吗?
作为 x 和 y 整数变量,含义如下
x >= 1 --> y = 0 y >= 1 --> x = 0
我真的很感激一些帮助。
有没有办法两者都为零?因为这似乎是用于电池优化或电源系统优化的常用互补约束以及为此的常用方法,对于x和y存在binary Vars:
x
y
binary
Vars
x + y <= 1
或等式约束:
x + y == 1
这行得通吗?
引入一个参数 t。
y = Max(1 - t, 0) x = Min(t, 0)
然后按照https://or.stackexchange.com/questions/711/how-to-formulate-linearize-a-maximum-function-in-a-constraint中的描述线性化 Max 和 Min