我用纸浆来解决一些最小化问题 有约束,上下界。 它非常简单和干净。在
但我只需要用小精灵和小精灵 模块。在
我在读: http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
Constrained minimization of multivariate scalar functions
但我有点迷路了。。。一些优秀的灵魂可以发布一个小例子 这是西皮的肉酱吗?在
提前谢谢。 毫米
from pulp import *
'''
Minimize 1.800A + 0.433B + 0.180C
Constraint 1A + 1B + 1C = 100
Constraint 0.480A + 0.080B + 0.020C >= 24
Constraint 0.744A + 0.800B + 0.142C >= 76
Constraint 1C <= 2
'''
...
考虑以下因素:
^{1}$需要注意的是,
eq
条件应该等于零,而ineq
函数对于大于零的任何值都将返回true。在我们获得:
^{pr2}$再次检查等式:
舍入来自两点精度误差:
相关问题 更多 >
编程相关推荐