Scipy.optimize terminates successfully for infeasible NLP
问题 Tried solving an NLP using the scipy.optimize SLSQP. The problem is clearly infeasible but the minimize function in scipy.optimize seems to disagree. minimize X^2 + Y^2 subject to X + Y = 11 X, Y >= 6 The code: from scipy.optimize import minimize def obj(varx): return varx[1]**2 + varx[0]**2 def constr1(varx): constr1 = -varx[0]-varx[1]+11 return constr1 bnds = [(6,float('Inf')),(6,float('Inf'))] ops = ({'maxiter':100000, 'disp':'bool'}) cons = ({'type':'eq', 'fun':constr1}) res = minimize