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


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。