我有一个隐式函数需要解决:
因此,我尝试使用scipy.optimize中的根查找函数:
- fsolve : RuntimeWarning: The iteration is not making good progress, as
measured by the improvement from the last ten iterations.
- excitingmixing : NoConvergence
-brent: RuntimeWarning: invalid value encountered in double_scalars (but
without a chance to set constraints)
我必须承认我不确定正确的求解器。能有人帮忙吗?
最小工作示例:
from scipy.optimize import fsolve, newton, brent, excitingmixing
import numpy as np
def func_zeta(zeta):
k= 1.2
Re = 5000.
d = 0.03
return (2.51 /Re/np.sqrt(zeta)+k/d/3.71) + 10**(0.5/ np.sqrt(zeta))
zeta = fsolve(func_zeta, 64/Re)