orthax.orthint
- orthax.orthint(c, rec, m=1, k=[], lbnd=0, scl=1, axis=0)Source
Integrate an orthogonal series.
Returns the orthogonal series coefficients c integrated m times from lbnd along axis. 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 c is an array of coefficients from low to high degree along each axis, e.g., [1,2,3] represents the series
P_0 + 2*P_1 + 3*P_2while [[1,2],[1,2]] represents1*P_0(x)*P_0(y) + 1*P_1(x)*P_0(y) + 2*P_0(x)*P_1(y) + 2*P_1(x)*P_1(y)if axis=0 isxand axis=1 isy.- Parameters:
c (array_like) – Array of orthogonal series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index.
rec (AbstractRecurrenceRelation) – Recurrence relation for the family of orthogonal polynomials
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
lbndis the first value in the list, the value of the second integral atlbndis the second value, etc. Ifk == [](the default), all constants are set to zero. Ifm == 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)
axis (int, optional) – Axis over which the integral is taken. (Default: 0).
- Returns:
S (ndarray) – Orthogonal series coefficient array of the integral.
- Raises:
ValueError – If
m < 0,len(k) > m,np.ndim(lbnd) != 0, ornp.ndim(scl) != 0.
See also
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.