简体   繁体   中英

Is there any alternative Scipy fsolve for python?

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.fminscipy.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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM