【问题标题】:Python equivalent to Excel Solver: get max value knowing constraintsPython相当于Excel Solver:获取最大值知道约束
【发布时间】:2019-01-21 00:09:58
【问题描述】:

我对 Python 很陌生,并试图找到一个与 Excel Solver 函数等效的 Python。 假设我有以下输入:

import math

totalvolflow=150585.6894
gaspercentvol=0.1
prodmod=1224
blpower=562.57
powercons=6

gasvolflow=totalvolflow*gaspercentvol
quantity=math.ceil(gasvolflow/prodmod)
maxpercentvol=powercons*totalvolflow*prodmod/blpower

我想通过改变gaspercentvol来找到maxpercentvol的最大值 具有以下约束:

quantity*powercon<blpower

任何帮助将不胜感激。

【问题讨论】:

    标签: python excel solver maximize


    【解决方案1】:

    根据:

    maxpercentvol=powercons*totalvolflow*prodmod/blpower

    maxpercentvol 是 1,965,802.12765274,无论 gaspercentvol 的值如何。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-27
      • 1970-01-01
      相关资源
      最近更新 更多