numpy.polynomial.legendre.leggauss()

numpy.polynomial.legendre.leggauss(deg) [source] Gauss-Legendre quadrature. Computes the sample points and weights for Gauss-Legendre quadrature. These sample points and weights will correctly integrate polynomials of degree or less over the interval with the weight function . Parameters: deg : int Number of sample points and weights. It must be >= 1. Returns: x : ndarray 1-D ndarray containing the sample points. y : ndarray 1-D ndarray containing the weights. Notes The resul

numpy.polynomial.legendre.legfromroots()

numpy.polynomial.legendre.legfromroots(roots) [source] Generate a Legendre series with given roots. The function returns the coefficients of the polynomial in Legendre form, where the r_n are the roots specified in roots. If a zero has multiplicity n, then it must appear in roots n times. For instance, if 2 is a root of multiplicity three and 3 is a root of multiplicity 2, then roots looks something like [2, 2, 2, 3, 3]. The roots can appear in any order. If the returned coefficients are

numpy.polynomial.legendre.legfit()

numpy.polynomial.legendre.legfit(x, y, deg, rcond=None, full=False, w=None) [source] Least squares fit of Legendre series to data. Return the coefficients of a Legendre series of degree deg that is the least squares fit to the data values y given at points x. If y is 1-D the returned coefficients will also be 1-D. If y is 2-D multiple fits are done, one for each column of y, and the resulting coefficients are stored in the corresponding columns of a 2-D return. The fitted polynomial(s) are

numpy.polynomial.legendre.Legendre()

class numpy.polynomial.legendre.Legendre(coef, domain=None, window=None) [source] A Legendre series class. The Legendre class provides the standard Python numerical methods ?+?, ?-?, ?*?, ?//?, ?%?, ?divmod?, ?**?, and ?()? as well as the attributes and methods listed in the ABCPolyBase documentation. Parameters: coef : array_like Legendre coefficients in order of increasing degree, i.e., (1, 2, 3) gives 1*P_0(x) + 2*P_1(x) + 3*P_2(x). domain : (2,) array_like, optional Domain to use. T

numpy.polynomial.legendre.legdomain

numpy.polynomial.legendre.legdomain = array([-1, 1])

numpy.polynomial.legendre.legdiv()

numpy.polynomial.legendre.legdiv(c1, c2) [source] Divide one Legendre series by another. Returns the quotient-with-remainder of two Legendre series c1 / c2. The arguments are sequences of coefficients from lowest order ?term? to highest, e.g., [1,2,3] represents the series P_0 + 2*P_1 + 3*P_2. Parameters: c1, c2 : array_like 1-D arrays of Legendre series coefficients ordered from low to high. Returns: quo, rem : ndarrays Of Legendre series coefficients representing the quotient and re

numpy.polynomial.legendre.legder()

numpy.polynomial.legendre.legder(c, m=1, scl=1, axis=0) [source] Differentiate a Legendre series. Returns the Legendre 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 low to high degree along each axis, e.g., [1,2,3] represents the series 1*L_0 + 2*L_1 + 3*L_2 while [[1,2],[1,2]] represents 1*L_0(x)*L_0(y) + 1*L_1(x)*L_0(y

numpy.polynomial.legendre.legcompanion()

numpy.polynomial.legendre.legcompanion(c) [source] Return the scaled companion matrix of c. The basis polynomials are scaled so that the companion matrix is symmetric when c is an Legendre basis polynomial. This provides better eigenvalue estimates than the unscaled case and for basis polynomials the eigenvalues are guaranteed to be real if numpy.linalg.eigvalsh is used to obtain them. Parameters: c : array_like 1-D array of Legendre series coefficients ordered from low to high degree.

numpy.polynomial.legendre.legadd()

numpy.polynomial.legendre.legadd(c1, c2) [source] Add one Legendre series to another. Returns the sum of two Legendre series c1 + c2. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series P_0 + 2*P_1 + 3*P_2. Parameters: c1, c2 : array_like 1-D arrays of Legendre series coefficients ordered from low to high. Returns: out : ndarray Array representing the Legendre series of their sum. See also legsub, legmul, legdiv

numpy.polynomial.legendre.leg2poly()

numpy.polynomial.legendre.leg2poly(c) [source] Convert a Legendre series to a polynomial. Convert an array representing the coefficients of a Legendre series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the ?standard? basis) ordered from lowest to highest degree. Parameters: c : array_like 1-D array containing the Legendre series coefficients, ordered from lowest order term to highest. Returns: pol : ndarray 1-D arra