0

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?

M.Khaled
  • 95
  • 1
  • 8
  • 2
    You may want to think about scaling things. Note that `1 + 1e12 = 1e12` when using standard floating point arithmetic. – Erwin Kalvelagen Oct 29 '18 at 18:57
  • Thanks for your answer. Do you mean I should use a higher penalty value? – M.Khaled Oct 30 '18 at 07:05
  • 1
    No. (1) your problem would benefit from better scaling: use more appropriate units (e.g. billions $) . (2) Cobyla can handle constraints directly, so adding a penalty to the objective is a bad idea. – Erwin Kalvelagen Oct 30 '18 at 20:49

0 Answers0