I'm sure this question has been addressed several times but unfortunately, none of the methods presented helped my situation. I am trying to solve a complicated study using Scipy fsolve, but the solver is extremely sensitive to the initial conditions.
My question: Is there any alternative fsolve? if not is there any way to adjust the sensitivity?
For fsolve, you can adjust the xtol so that it terminates if the relative error is at most xtol (ie convergence parameter). Meaning that xtol measures the relative error desired in the approximate solution. Toggling this will decrease the sensitivity of the solver. You can find out to change that in the scipy docs: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fsolve.html
如果您使用fsolve
求解方程f(x) = 0
,您有时可以使用scipy.optimize.fmin
或scipy.optimize.minimize
在函数|f(x)|²
求解最小值来代替它
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.