MCPcopy Create free account
hub / github.com/numpy/numpy / hermeder

Function hermeder

numpy/polynomial/hermite_e.py:590–670  ·  view source on GitHub ↗

Differentiate a Hermite_e series. Returns the series coefficients `c` differentiated `m` times along `axis`. At each iteration the result is multiplied by `scl` (the scaling factor is for use in a linear change of variable). The argument `c` is an array of coefficients from lo

(c, m=1, scl=1, axis=0)

Source from the content-addressed store, hash-verified

588
589
590def hermeder(c, m=1, scl=1, axis=0):
591 """
592 Differentiate a Hermite_e series.
593
594 Returns the series coefficients `c` differentiated `m` times along
595 `axis`. At each iteration the result is multiplied by `scl` (the
596 scaling factor is for use in a linear change of variable). The argument
597 `c` is an array of coefficients from low to high degree along each
598 axis, e.g., [1,2,3] represents the series ``1*He_0 + 2*He_1 + 3*He_2``
599 while [[1,2],[1,2]] represents ``1*He_0(x)*He_0(y) + 1*He_1(x)*He_0(y)
600 + 2*He_0(x)*He_1(y) + 2*He_1(x)*He_1(y)`` if axis=0 is ``x`` and axis=1
601 is ``y``.
602
603 Parameters
604 ----------
605 c : array_like
606 Array of Hermite_e series coefficients. If `c` is multidimensional
607 the different axis correspond to different variables with the
608 degree in each axis given by the corresponding index.
609 m : int, optional
610 Number of derivatives taken, must be non-negative. (Default: 1)
611 scl : scalar, optional
612 Each differentiation is multiplied by `scl`. The end result is
613 multiplication by ``scl**m``. This is for use in a linear change of
614 variable. (Default: 1)
615 axis : int, optional
616 Axis over which the derivative is taken. (Default: 0).
617
618 .. versionadded:: 1.7.0
619
620 Returns
621 -------
622 der : ndarray
623 Hermite series of the derivative.
624
625 See Also
626 --------
627 hermeint
628
629 Notes
630 -----
631 In general, the result of differentiating a Hermite series does not
632 resemble the same operation on a power series. Thus the result of this
633 function may be "unintuitive," albeit correct; see Examples section
634 below.
635
636 Examples
637 --------
638 >>> from numpy.polynomial.hermite_e import hermeder
639 >>> hermeder([ 1., 1., 1., 1.])
640 array([1., 2., 3.])
641 >>> hermeder([-0.25, 1., 1./2., 1./3., 1./4 ], m=2)
642 array([1., 2., 3.])
643
644 """
645 c = np.array(c, ndmin=1, copy=True)
646 if c.dtype.char in '?bBhHiIlLqQpP':
647 c = c.astype(np.double)

Callers

nothing calls this directly

Calls 2

normalize_axis_indexFunction · 0.90
astypeMethod · 0.80

Tested by

no test coverage detected