I am trying to use a Scipy global optimizer to find a global min of a function, but instead of giving the global min as an answer, it stuck in a local min. The code:
def f(x):
return x**2 + 10*np.sin(x)
x = np.arange(-10, 10, 0.1)
print(optimize.basinhopping(f, 3))
Can anyone tell me why? And which method in Scipy you think is the best one to solve global optimization?