numpy.polynomial.hermite.hermroots#
- polynomial.hermite.hermroots(c)[源代码]#
计算埃尔米特级数的根.
返回多项式的根(又名"零点")
\[p(x) = \sum_i c[i] * H_i(x).\]- 参数:
- c1-D 类数组
系数的一维数组.
- 返回:
- outndarray
级数的根的数组.如果所有根都是实数,则 out 也是实数,否则它是复数.
参见
注释
根估计值作为伴随矩阵的特征值获得.由于此类值的级数的数值不稳定性,远离复平面原点的根可能具有较大的误差. 重复度大于 1 的根也会显示出更大的误差,因为此类点附近的级数的值对根中的误差相对不敏感.可以通过牛顿法的几次迭代来改善原点附近的孤立根.
The Hermite series basis polynomials aren’t powers of x so the results of this function may seem unintuitive.
示例
>>> from numpy.polynomial.hermite import hermroots, hermfromroots >>> coef = hermfromroots([-1, 0, 1]) >>> coef array([0. , 0.25 , 0. , 0.125]) >>> hermroots(coef) array([-1.00000000e+00, -1.38777878e-17, 1.00000000e+00])