{"action":"closed","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/9442","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/9442/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/9442/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/9442/events","html_url":"https://github.com/scipy/scipy/issues/9442","id":377595339,"node_id":"MDU6SXNzdWUzNzc1OTUzMzk=","number":9442,"title":"Error in Defintion of Rosenbrock Function","user":{"login":"rshanker779","id":37957367,"node_id":"MDQ6VXNlcjM3OTU3MzY3","avatar_url":"https://avatars3.githubusercontent.com/u/37957367?v=4","gravatar_id":"","url":"https://api.github.com/users/rshanker779","html_url":"https://github.com/rshanker779","followers_url":"https://api.github.com/users/rshanker779/followers","following_url":"https://api.github.com/users/rshanker779/following{/other_user}","gists_url":"https://api.github.com/users/rshanker779/gists{/gist_id}","starred_url":"https://api.github.com/users/rshanker779/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rshanker779/subscriptions","organizations_url":"https://api.github.com/users/rshanker779/orgs","repos_url":"https://api.github.com/users/rshanker779/repos","events_url":"https://api.github.com/users/rshanker779/events{/privacy}","received_events_url":"https://api.github.com/users/rshanker779/received_events","type":"User","site_admin":false},"labels":[{"id":37345775,"node_id":"MDU6TGFiZWwzNzM0NTc3NQ==","url":"https://api.github.com/repos/scipy/scipy/labels/Documentation","name":"Documentation","color":"207de5","default":false},{"id":37341011,"node_id":"MDU6TGFiZWwzNzM0MTAxMQ==","url":"https://api.github.com/repos/scipy/scipy/labels/scipy.optimize","name":"scipy.optimize","color":"207de5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scipy/scipy/milestones/36","html_url":"https://github.com/scipy/scipy/milestone/36","labels_url":"https://api.github.com/repos/scipy/scipy/milestones/36/labels","id":3257163,"node_id":"MDk6TWlsZXN0b25lMzI1NzE2Mw==","number":36,"title":"1.2.0","description":"","creator":{"login":"pv","id":35046,"node_id":"MDQ6VXNlcjM1MDQ2","avatar_url":"https://avatars1.githubusercontent.com/u/35046?v=4","gravatar_id":"","url":"https://api.github.com/users/pv","html_url":"https://github.com/pv","followers_url":"https://api.github.com/users/pv/followers","following_url":"https://api.github.com/users/pv/following{/other_user}","gists_url":"https://api.github.com/users/pv/gists{/gist_id}","starred_url":"https://api.github.com/users/pv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pv/subscriptions","organizations_url":"https://api.github.com/users/pv/orgs","repos_url":"https://api.github.com/users/pv/repos","events_url":"https://api.github.com/users/pv/events{/privacy}","received_events_url":"https://api.github.com/users/pv/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":270,"state":"open","created_at":"2018-04-10T20:26:02Z","updated_at":"2018-11-05T22:42:46Z","due_on":"2018-11-09T08:00:00Z","closed_at":null},"comments":2,"created_at":"2018-11-05T21:43:42Z","updated_at":"2018-11-05T22:42:46Z","closed_at":"2018-11-05T22:42:46Z","author_association":"NONE","body":"<!-- \r\nThank you for taking the time to report a SciPy issue.\r\nPlease describe the issue in detail, and for bug reports\r\nfill in the fields below. You can delete the sections that \r\ndon't apply to your issue. You can view the final output\r\nby clicking the preview button above.\r\n-->\r\nThe Rosenbrock function in the docs is incorrectly defined.\r\nThis occurs in the section **Constrained minimization of multivariate scalar functions**  at https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html\r\nThe correct definition is on wikipedia: https://en.wikipedia.org/wiki/Rosenbrock_function.\r\n\r\nThe definition used in docs is:\r\n```\r\n100 * (x_0 - x_1 ^2) ^2 + (1 - x_0) ^2\r\n```\r\nwhich should be\r\n```\r\n100 * (x_1 - x_0 ^2) ^2 + (1 - x_0) ^2\r\n```\r\nAs a verification, this block of code (with index swapped) gives the minimum as defined in the docs.\r\n\r\n### Reproducing code example:\r\n<!-- \r\nIf you place your code between the triple backticks below, \r\nit will be marked as a code block automatically \r\n-->\r\n```\r\nfrom scipy.optimize import minimize\r\n\r\ndef rosenbrock(x):\r\n    return 100 * (x[1] - x[0]**2) ** 2 + (1 - x[0]) ** 2\r\n\r\nros_cons = [{'type': 'ineq', 'fun': lambda x: 1 - 2 * x[1] - x[0]},\r\n            {'type': 'ineq', 'fun': lambda x: 1 - x[0] ** 2 - x[1]},\r\n            {'type': 'ineq', 'fun': lambda x: 1 + x[1] - x[0] ** 2},\r\n            {'type': 'eq', 'fun': lambda x: 2 * x[0] + x[1] - 1}]\r\nopt_res = minimize(rosenbrock, x0=[2, -1], constraints=ros_cons, bounds=[(0, 1), (-0.5, 2)])```\r\nprint(opt_res.x)\r\n```\r\n```\r\n[0.41494395 0.17011211]\r\n```\r\n\r\n\r\n### Scipy/Numpy/Python version information:\r\n<!-- You can simply run the following and paste the result in a code block-->\r\n```\r\nimport sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)\r\n```\r\n```1.1.0 1.15.1 sys.version_info(major=3, minor=6, micro=5, releaselevel='final', serial=0)```\r\n\r\n"}}
{"actor":{"display_login":"ilayn"}}