|
在Mathematica中使用Gurobi
reference.wolfram.com/language/ref/method/Gurobi.html
Minimize $x^2 + 2 y^2$ subject to the constraint $x+y=1$ with method "Gurobi":
- NMinimize[{x^2 + 2 y^2, {x + y == 1}}, {x, y}, Method -> "Gurobi"]
复制代码
Minimize $\|\{x, y\}\|$ subject to the constraints $x+y \geq \pi, y \leq 1$ for integer $x$ with method "Gurobi":
- ConvexOptimization[
- Norm[{x, y}], {x + y >= Pi, y <= 1}, {x \[Element] Integers, y},
- Method -> "Gurobi"]
复制代码 |
|