我有一个优化问题,我试图使项目成本最小化,通常其价值在1亿到50亿美元之间。我正在使用Python 2.7中Scipy包的COBYLA可用部分。
newsol = minimize(ObjectiveFunction,X0,bounds=Bounds,constraints = Constraints,method='COBYLA')
我在COBYLA中制定了5个约束方程。如果违反,我将在项目成本中增加1万亿美元的罚款。
# check constraints - for each constraint violated add a large penalty ####
for constraint in Constraints:
constraintValue = constraint["fun"](newsol.x)
numViolations = np.sum(constraintValue < 0 )
if(numViolations):
penaltyCost = 1e12
penaltyMult = 1.0
if("penaltyMultiplier" in constraint):
penaltyMult = constraint["penaltyMultiplier"](newsol.x)
OptimizedProjectCost += penaltyMult*numViolations*penaltyCost
我的问题:考虑到所提供的项目成本的数量级,该罚款值是否超出范围?此值对优化收敛有影响吗?