Python Scipy Optimization.minimize using SLSQP showing maximized results

拟墨画扇 提交于 2019-12-05 02:57:51

I think you are hitting a edge case. If you try with a guess that is not symmetric, you converge to the right solution.

Just change x0=[0,0] to something else, like x0=[.2,.9].

EDIT: expanding after @pv comment.

[x,y]=[2.5,2.5] is a local maximum of the constrained function. After jumping to this local maximum, the algorithm calculates again the direction it should take to minimize the target.

It does so by calculating the value at [ 2.50000001 2.5 ] and at [ 2.5 2.50000001]. It finds that this direction is (-1,-1). This direction is however orthogonal to the constraint, and it then stops.

The problem arises because the target and the constraint are symmetric with respect to x=y, and that we are starting with the guess exactly on x=y.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!