當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python SciPy special.it2struve0用法及代碼示例

本文簡要介紹 python 語言中 scipy.special.it2struve0 的用法。

用法:

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

與 0 階 Struve 函數相關的積分。

返回積分,

其中 是 0 階 Struve 函數。

參數

x array_like

積分的下限。

out ndarray,可選

函數值的可選輸出數組

返回

I 標量或 ndarray

積分值。

注意

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 it2struve0
>>> it2struve0(1.)
0.9571973506383524

通過提供 x 的數組,在多個點評估該函數。

>>> points = np.array([1., 2., 3.5])
>>> it2struve0(points)
array([0.95719735, 0.46909296, 0.10366042])

繪製 -10 到 10 之間的函數。

>>> import matplotlib.pyplot as plt
>>> x = np.linspace(-10., 10., 1000)
>>> it2struve0_values = it2struve0(x)
>>> fig, ax = plt.subplots()
>>> ax.plot(x, it2struve0_values)
>>> ax.set_xlabel(r'$x$')
>>> ax.set_ylabel(r'$\int_x^{\infty}\frac{H_0(t)}{t}\,dt$')
>>> plt.show()
scipy-special-it2struve0-1.png

相關用法


注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.special.it2struve0。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。