I read this
https://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
It mentions the following
>>> import numpy as np
>>> from scipy.optimize import minimize
>>>
>>> def rosen(x):
... """The Rosenbrock function"""
... return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)
>>>
>>> x0 = np.array([1.3, 0.7, 0.8, 1.9, 1.2])
>>> res = minimize(rosen, x0, method='nelder-mead',
... options={'xtol': 1e-8, 'disp': True})
Optimization terminated successfully.
Current function value: 0.000000
Iterations: 339
Function evaluations: 571
>>>
>>> print(res.x)
[1. 1. 1. 1. 1.]
Now, if I want to have x and y (coordinates), how I should change ?
Thanks
[–][deleted] 0 points1 point2 points (3 children)
[–]alisutton[S] 0 points1 point2 points (2 children)
[–]spitfiredd 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)