当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python SciPy special.itstruve0用法及代码示例


本文简要介绍 python 语言中 scipy.special.itstruve0 的用法。

用法:

scipy.special.itstruve0(x, out=None) = <ufunc 'itstruve0'>#

0 阶 Struve 函数的积分。

参数

x array_like

积分上限(浮点数)。

out ndarray,可选

函数值的可选输出数组

返回

I 标量或 ndarray

积分为\(H_0\) 从 0 到x.

注意

Wrapper for a Fortran routine created by Shanjie Zhang and Jianming Jin [1].

参考

[1]

张善杰和金建明。 “特殊函数的计算”,John Wiley and Sons,1996 年。https://people.sc.fsu.edu/~jburkardt/f_src/special_functions/special_functions.html

例子

在某一点评估函数。

>>> import numpy as np
>>> from scipy.special import itstruve0
>>> itstruve0(1.)
0.30109042670805547

通过提供 x 的数组,在多个点评估该函数。

>>> points = np.array([1., 2., 3.5])
>>> itstruve0(points)
array([0.30109043, 1.01870116, 1.96804581])

绘制 -20 到 20 范围内的函数。

>>> import matplotlib.pyplot as plt
>>> x = np.linspace(-20., 20., 1000)
>>> istruve0_values = itstruve0(x)
>>> fig, ax = plt.subplots()
>>> ax.plot(x, istruve0_values)
>>> ax.set_xlabel(r'$x$')
>>> ax.set_ylabel(r'$\int_0^{x}H_0(t)\,dt$')
>>> plt.show()
scipy-special-itstruve0-1.png

相关用法


注:本文由纯净天空筛选整理自scipy.org大神的英文原创作品 scipy.special.itstruve0。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。