scipy.special.wrightomega#
- scipy.special.wrightomega(z, out=None) = <ufunc 'wrightomega'>#
Wright Omega 函數。
定義為以下方程式的解:
\[\omega + \log(\omega) = z\]其中 \(\log\) 是複對數的主分支。
- 參數:
- zarray_like
評估 Wright Omega 函數的點
- outndarray, optional
函數值的可選輸出陣列
- 回傳值:
- omegascalar or ndarray
Wright Omega 函數的值
另請參閱
lambertw
Lambert W 函數
註解
在版本 0.19.0 中新增。
此函數也可以定義為
\[\omega(z) = W_{K(z)}(e^z)\]其中 \(K(z) = \lceil (\Im(z) - \pi)/(2\pi) \rceil\) 是展開數,而 \(W\) 是 Lambert W 函數。
此處的實作取自 [1]。
參考文獻
[1]Lawrence、Corless 和 Jeffrey,“演算法 917:Wright \(\omega\) 函數的複數雙精度求值”。ACM Transactions on Mathematical Software,2012。DOI:10.1145/2168773.2168779。
範例
>>> import numpy as np >>> from scipy.special import wrightomega, lambertw
>>> wrightomega([-2, -1, 0, 1, 2]) array([0.12002824, 0.27846454, 0.56714329, 1. , 1.5571456 ])
複數輸入
>>> wrightomega(3 + 5j) (1.5804428632097158+3.8213626783287937j)
驗證
wrightomega(z)
滿足w + log(w) = z
>>> w = -5 + 4j >>> wrightomega(w + np.log(w)) (-5+4j)
驗證與
lambertw
的關聯>>> z = 0.5 + 3j >>> wrightomega(z) (0.0966015889280649+1.4937828458191993j) >>> lambertw(np.exp(z)) (0.09660158892806493+1.4937828458191993j)
>>> z = 0.5 + 4j >>> wrightomega(z) (-0.3362123489037213+2.282986001579032j) >>> lambertw(np.exp(z), k=1) (-0.33621234890372115+2.282986001579032j)