Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.polynomial.chebyshev.chebint

numpy.polynomial.chebyshev.chebint(c,m=1,k=[],lbnd=0,scl=1,axis=0)[source]

Integrate a Chebyshev series.

Returns the Chebyshev series coefficientsc integratedm times fromlbnd alongaxis. At each iteration the resulting series ismultiplied byscl and an integration constant,k, is added.The scaling factor is for use in a linear change of variable. (“Buyerbeware”: note that, depending on what one is doing, one may wantsclto be the reciprocal of what one might expect; for more information,see the Notes section below.) The argumentc is an array ofcoefficients from low to high degree along each axis, e.g., [1,2,3]represents the seriesT_0+2*T_1+3*T_2 while [[1,2],[1,2]]represents1*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) if axis=0 isx and axis=1 isy.

Parameters:

c : array_like

Array of Chebyshev series coefficients. If c is multidimensionalthe different axis correspond to different variables with thedegree in each axis given by the corresponding index.

m : int, optional

Order of integration, must be positive. (Default: 1)

k : {[], list, scalar}, optional

Integration constant(s). The value of the first integral at zerois the first value in the list, the value of the second integralat zero is the second value, etc. Ifk==[] (the default),all constants are set to zero. Ifm==1, a single scalar canbe given instead of a list.

lbnd : scalar, optional

The lower bound of the integral. (Default: 0)

scl : scalar, optional

Following each integration the result ismultiplied bysclbefore the integration constant is added. (Default: 1)

axis : int, optional

Axis over which the integral is taken. (Default: 0).

New in version 1.7.0.

Returns:

S : ndarray

C-series coefficients of the integral.

Raises:

ValueError

Ifm<1,len(k)>m,np.isscalar(lbnd)==False, ornp.isscalar(scl)==False.

See also

chebder

Notes

Note that the result of each integration ismultiplied byscl.Why is this important to note? Say one is making a linear change ofvariableu = ax + b in an integral relative tox. Then.. math::dx = du/a, so one will need to setscl equal to1/a- perhaps not what one would have first thought.

Also note that, in general, the result of integrating a C-series needsto be “reprojected” onto the C-series basis set. Thus, typically,the result of this function is “unintuitive,” albeit correct; seeExamples section below.

Examples

>>>fromnumpy.polynomialimportchebyshevasC>>>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,        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.])

Previous topic

numpy.polynomial.chebyshev.chebder

Next topic

numpy.polynomial.chebyshev.chebadd

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp