I have an optimization problem where I attempt to minimize a project cost, typically valued at $100 million to $ 5 Billion. I am using COBYLA available part of Scipy package in Python 2.7.
newsol = minimize(ObjectiveFunction,X0,bounds=Bounds,constraints = Constraints,method='COBYLA')
I have formulated 5 inconstraint equations within the COBYLA. If they are violated, I add a penalty cost of $1 trillion to the project cost.
# 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
My question: is this penalty value out of range considering the order of magnitude of the project costs provided. Is there an effect of this value to the optimization convergence?