本文簡要介紹 python 語言中 numpy.polynomial.chebyshev.chebint
的用法。
用法:
polynomial.chebyshev.chebint(c, m=1, k=[], lbnd=0, scl=1, axis=0)
整合切比雪夫級數。
返回切比雪夫級數係數c融合的m次從lbnd沿著軸.在每次迭代中,結果序列是倍增經過scl和一個積分常數,k, 被添加。比例因子用於變量的線性變化。 (“Buyer beware”:請注意,根據一個人在做什麽,一個人可能想要scl成為人們可能期望的倒數;有關詳細信息,請參閱下麵的注釋部分。)參數c是沿每個軸從低到高的係數數組,例如,[1,2,3] 表示係列
T_0 + 2*T_1 + 3*T_2
而 [[1,2],[1,2]] 表示1*T_0(x)*T_0(y) + 1*T_1(x)*T_0(y) + 2*T_0(x)*T_1(y) + 2*T_1(x)*T_1(y)
如果軸 = 0 是x
和軸= 1 是y
.- c: array_like
切比雪夫級數係數數組。如果 c 是多維的,則不同的軸對應於不同的變量,每個軸的度數由相應的索引給出。
- m: 整數,可選
積分順序,必須是正數。 (默認值:1)
- k: {[],列表,標量},可選
積分常數。第一個零積分的值是列表中的第一個值,第二個零積分的值是第二個值,依此類推。如果
k == []
(默認),所有常量都設置為零。如果m == 1
,可以給出單個標量而不是列表。- lbnd: 標量,可選
積分的下界。 (默認值:0)
- scl: 標量,可選
在每次積分之後,在添加積分常數之前,結果會乘以 scl。 (默認值:1)
- axis: 整數,可選
進行積分的軸。 (默認值:0)。
- S: ndarray
C-series 積分係數。
- ValueError
如果
m < 1
、len(k) > m
、np.ndim(lbnd) != 0
或np.ndim(scl) != 0
。
參數:
返回:
拋出:
注意:
請注意,每次積分的結果是倍增經過scl.為什麽要注意這一點?假設正在對變量進行線性變化
在一個積分相對於x.然後 ,所以需要設置scl等於 - 也許不是人們首先想到的。另請注意,一般情況下,將C-series 積分的結果需要是“reprojected” 到C-series 基組上。因此,通常,此函數的結果是“unintuitive,”,盡管它是正確的;請參閱下麵的示例部分。
例子:
>>> from numpy.polynomial import chebyshev as C >>> c = (1,2,3) >>> C.chebint(c) array([ 0.5, -0.5, 0.5, 0.5]) >>> C.chebint(c,3) array([ 0.03125 , -0.1875 , 0.04166667, -0.05208333, 0.01041667, # may vary 0.00625 ]) >>> C.chebint(c, k=3) array([ 3.5, -0.5, 0.5, 0.5]) >>> C.chebint(c,lbnd=-2) array([ 8.5, -0.5, 0.5, 0.5]) >>> C.chebint(c,scl=-2) array([-1., 1., -1., -1.])
相關用法
- Python numpy chebyshev.chebinterpolate用法及代碼示例
- Python numpy chebyshev.chebsub用法及代碼示例
- Python numpy chebyshev.chebdiv用法及代碼示例
- Python numpy chebyshev.cheb2poly用法及代碼示例
- Python numpy chebyshev.chebx用法及代碼示例
- Python numpy chebyshev.chebmul用法及代碼示例
- Python numpy chebyshev.chebroots用法及代碼示例
- Python numpy chebyshev.chebtrim用法及代碼示例
- Python numpy chebyshev.chebone用法及代碼示例
- Python numpy chebyshev.chebder用法及代碼示例
- Python numpy chebyshev.chebadd用法及代碼示例
- Python numpy chebyshev.chebdomain用法及代碼示例
- Python numpy chebyshev.chebline用法及代碼示例
- Python numpy chebyshev.chebfromroots用法及代碼示例
- Python numpy chebyshev.chebfit用法及代碼示例
- Python numpy chebyshev.chebzero用法及代碼示例
- Python numpy chebyshev.chebpow用法及代碼示例
- Python numpy chebyshev.chebmulx用法及代碼示例
- Python numpy chebyshev.poly2cheb用法及代碼示例
- Python numpy chararray.ndim用法及代碼示例
- Python numpy chararray.nbytes用法及代碼示例
- Python numpy chararray.setflags用法及代碼示例
- Python numpy chararray.flat用法及代碼示例
- Python numpy chararray.strides用法及代碼示例
- Python numpy chararray.view用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.polynomial.chebyshev.chebint。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。