numpy.polynomial.hermite_e.hermeint

numpy.polynomial.hermite_e.hermeint(cs, m=1, k=[], lbnd=0, scl=1)

Integrate a Hermite series.

Returns a Hermite series that is the Hermite series cs, integrated m times from lbnd to x. At each iteration the resulting series is multiplied by scl and an integration constant, k, is added. The scaling factor is for use in a linear change of variable. (“Buyer beware”: note that, depending on what one is doing, one may want scl to be the reciprocal of what one might expect; for more information, see the Notes section below.) The argument cs is a sequence of coefficients, from lowest order Hermite series “term” to highest, e.g., [1,2,3] represents the series P_0(x) + 2P_1(x) + 3P_2(x).

Parameters :

cs : array_like

1-d array of Hermite series coefficients, ordered from low to high.

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 lbnd is the first value in the list, the value of the second integral at lbnd is the second value, etc. If k == [] (the default), all constants are set to zero. If m == 1, a single scalar can be given instead of a list.

lbnd : scalar, optional

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

scl : scalar, optional

Following each integration the result is multiplied by scl before the integration constant is added. (Default: 1)

Returns :

S : ndarray

Hermite series coefficients of the integral.

Raises :

ValueError :

If m < 0, len(k) > m, np.isscalar(lbnd) == False, or np.isscalar(scl) == False.

See also

hermeder

Notes

Note that the result of each integration is multiplied by scl. Why is this important to note? Say one is making a linear change of variable u = ax + b in an integral relative to x. Then dx = du/a, so one will need to set scl equal to 1/a - perhaps not what one would have first thought.

Also note that, in general, the result of integrating a C-series needs to be “re-projected” onto the C-series basis set. Thus, typically, the result of this function is “un-intuitive,” albeit correct; see Examples section below.

Examples

>>> from numpy.polynomial.hermite_e import hermeint
>>> hermeint([1, 2, 3]) # integrate once, value 0 at 0.
array([ 1.,  1.,  1.,  1.])
>>> hermeint([1, 2, 3], m=2) # integrate twice, value & deriv 0 at 0 
array([-0.25      ,  1.        ,  0.5       ,  0.33333333,  0.25      ])
>>> hermeint([1, 2, 3], k=1) # integrate once, value 1 at 0.
array([ 2.,  1.,  1.,  1.])
>>> hermeint([1, 2, 3], lbnd=-1) # integrate once, value 0 at -1
array([-1.,  1.,  1.,  1.])
>>> hermeint([1, 2, 3], m=2, k=[1,2], lbnd=-1)
array([ 1.83333333,  0.        ,  0.5       ,  0.33333333,  0.25      ])

Previous topic

numpy.polynomial.hermite_e.hermeder

Next topic

numpy.polynomial.hermite_e.hermeadd

This Page