Oct-25-2020, 07:12 PM
(Oct-21-2020, 11:44 PM)scidam Wrote: It seems thatf(x, y)
returns too large values. Could you provide implementation off(x, y)
here? Actually, this is not an error, just a warning.
Sorry for the late reply. I got stuck with some other businesses.
Here is a simplified form of my function. If you will compile, you will see two errors.
import math import numpy as np from scipy import optimize def fT(X,T): p=X[0] q=X[1] r=pow(p,2) + pow(p,4) Vtest = (( -(r**4)*(math.log((r**2)/(T**2))) )) return Vtest grid = ((10, 40, 1), (10, 40, 1)) xmin_globalT =optimize.brute(fT, grid, (567,) ) print(xmin_globalT)The errors are
/usr/..:RuntimeWarning: overflow encountered in double_scalars if __name__ == '__main__': /usr/../scipy/optimize/optimize.py:597: RuntimeWarning: invalid value encountered in subtract numpy.max(numpy.abs(fsim[0] - fsim[1:])) <= fatol):Thanks in advance.