'Scipy's minimize function doesn't converge with a callabe jac

i've been trying to minimize a absolute qudratic error given by : quad_error = ((prediction-obs)**2).sum()/(obs.size-1)

Where prediction depend if a number of variable (h0, x0, y0, ra, rb and theta) in the hope that the gradient of prediction would provide a better result, i have created a functionjac who calculated the derivatives of prediction and return them in an array, so i can call jac in scipy.optimize.minimze.

However each time i call jacin minimize, the ladder return success : False for all the methods that require jac. I have already redo my calculation of the derivatives so i don't think it come from the gradient expression. I don't know what i'm missing, every bit of help is welcome.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source