Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slsqp fails to detect infeasible problem #5743

Closed
pv opened this issue Jan 20, 2016 · 4 comments
Closed

slsqp fails to detect infeasible problem #5743

pv opened this issue Jan 20, 2016 · 4 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.optimize
Milestone

Comments

@pv
Copy link
Member

pv commented Jan 20, 2016

From mailing list:

x = [1,2]
optimize.minimize(
    lambda x: x[0]**2+x[1]**2, x,
    constraints = (
        {'type':'eq','fun': lambda x: x[0]+x[1]-1},
        {'type':'ineq','fun': lambda x: x[0]-2}
                  ),
    bounds = ((0,None),(0,None)),
    method='SLSQP')

returns (0.18.0.dev0+1eeef28)

     fun: 2.77777777777712
     jac: array([  3.33333334e+00,   2.98023224e-08,   0.00000000e+00])
 message: 'Optimization terminated successfully.'
    nfev: 8
     nit: 6
    njev: 2
  status: 0
 success: True
       x: array([  1.66666667e+00,   1.39888101e-14])
@dlax dlax added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.optimize labels Jan 20, 2016
@pv pv added this to the 0.18.0 milestone Jun 5, 2016
@ev-br
Copy link
Member

ev-br commented Jun 5, 2016

Fixed by #6024.

@pv
Copy link
Member Author

pv commented Jul 4, 2016

Reopening, not actually fixed.

@pv pv reopened this Jul 4, 2016
@pv pv removed this from the 0.18.0 milestone Jul 4, 2016
@pv
Copy link
Member Author

pv commented Jul 4, 2016

Another example from gh-6349:

import numpy as np
import scipy.optimize
normals = np.concatenate([np.eye(2), -np.eye(2)])
depth = 1
f_ieqcons = lambda x: normals.dot(x) - depth
x, fx, its, imode, smode = scipy.optimize.fmin_slsqp(
    func=lambda x: (x**2).sum(),
    x0=np.zeros(2),
    f_ieqcons=f_ieqcons,
    full_output=True
)
print(f_ieqcons(x))
assert imode==4  # fail

@pv
Copy link
Member Author

pv commented Nov 1, 2018

Neither reports false success in current master.

@pv pv closed this as completed Nov 1, 2018
@pv pv added this to the 1.2.0 milestone Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.optimize
Projects
None yet
Development

No branches or pull requests

3 participants