Numpy Articles

Page 16 of 81

Evaluate a Legendre series at array of points x in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 342 Views

To evaluate a Legendre series at an array of points x, use the polynomial.legendre.legval() method in Python NumPy. This method takes coefficients of a Legendre polynomial and evaluates it at specified points. Syntax numpy.polynomial.legendre.legval(x, c, tensor=True) Parameters x: Array of points at which to evaluate the series. If x is a list or tuple, it is converted to an ndarray. The elements must support addition and multiplication operations. c: Array of coefficients ordered so that coefficients for terms of degree n are in c[n]. For multidimensional arrays, remaining indices enumerate multiple polynomials. ...

Read More

Evaluate a Legendre series at points x broadcast over the columns of the coefficient in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 184 Views

To evaluate a Legendre series at points x, use the polynomial.legendre.legval() method in Python NumPy. This function broadcasts x over the columns of the coefficient array, making it useful for evaluating multiple polynomials simultaneously. Syntax numpy.polynomial.legendre.legval(x, c, tensor=True) Parameters x: Array of points at which to evaluate the series. If x is a list or tuple, it is converted to an ndarray, otherwise treated as a scalar. c: Array of coefficients ordered so that coefficients for terms of degree n are in c[n]. If multidimensional, remaining indices enumerate multiple polynomials stored in columns. ...

Read More

Evaluate a Legendre series at points x in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 223 Views

To evaluate a Legendre series at specific points x in Python, use the polynomial.legendre.legval() method from NumPy. This function computes the value of a Legendre polynomial series at given points using the provided coefficients. Syntax numpy.polynomial.legendre.legval(x, c, tensor=True) Parameters x: Points at which to evaluate the Legendre series. Can be a scalar, list, tuple, or ndarray. c: Array of coefficients ordered so that coefficients for terms of degree n are in c[n]. For multidimensional arrays, remaining indices enumerate multiple polynomials. tensor: If True (default), the coefficient array shape is extended for broadcasting. ...

Read More

Raise a Legendre series to a power in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 191 Views

To raise a Legendre series to a power, use the polynomial.legendre.legpow() method in Python NumPy. The method returns the Legendre series c raised to the power pow. The argument c is a sequence of coefficients ordered from low to high. For example, [1, 2, 3] represents the series P₀ + 2*P₁ + 3*P₂. Syntax numpy.polynomial.legendre.legpow(c, pow, maxpower=16) Parameters The function accepts the following parameters ? c ? 1-D array of Legendre series coefficients ordered from low to high pow ? Power to which the series will be raised maxpower ? Maximum power ...

Read More

Integrate a Hermite series in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 323 Views

To integrate a Hermite series in Python, use the hermite.hermint() method from NumPy. This function performs polynomial integration on Hermite series coefficients and returns the integrated coefficients. Syntax numpy.polynomial.hermite.hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0) Parameters c − Array of Hermite series coefficients. For multidimensional arrays, different axes correspond to different variables m − Order of integration (must be positive, default: 1) k − Integration constant(s). If empty list (default), all constants are zero lbnd − Lower bound of the integral (default: 0) scl − Scalar multiplier applied after each integration (default: 1) axis ...

Read More

Generate a Pseudo Vandermonde matrix of the Laguerre polynomial and x, y, z floating array of points in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 180 Views

To generate a pseudo Vandermonde matrix of the Laguerre polynomial with x, y, z sample points, use the laguerre.lagvander3d() in Python NumPy. The parameters x, y, z are arrays of points with the same shape. The parameter deg is a list of maximum degrees of the form [x_deg, y_deg, z_deg]. Syntax numpy.polynomial.laguerre.lagvander3d(x, y, z, deg) Parameters The function accepts the following parameters ? x, y, z − Arrays of point coordinates, all of the same shape deg − List of maximum degrees [x_deg, y_deg, z_deg] Example Let's create arrays ...

Read More

Divide one Legendre series by another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 185 Views

To divide one Legendre series by another, use the polynomial.legendre.legdiv() method in Python NumPy. The method returns a tuple containing the quotient and remainder of Legendre series coefficients. The function performs polynomial division where the arguments are sequences of coefficients from lowest order "term" to highest. For example, [1, 2, 3] represents the series P_0 + 2*P_1 + 3*P_2. The parameters c1 and c2 are 1-D arrays of Legendre series coefficients ordered from low to high. Syntax numpy.polynomial.legendre.legdiv(c1, c2) Parameters: c1 − 1-D array of Legendre series coefficients (dividend) c2 − 1-D array ...

Read More

Multiply one Legendre series to another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 189 Views

To multiply one Legendre series with another, use the polynomial.legendre.legmul() method in NumPy. The method returns an array representing the Legendre series of their product. 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. Syntax numpy.polynomial.legendre.legmul(c1, c2) Parameters The parameters c1 and c2 are 1-D arrays of Legendre series coefficients ordered from low to high degree. Example Let's multiply two Legendre series using coefficient arrays ? import numpy as np from numpy.polynomial import legendre ...

Read More

Multiply a Legendre series by an independent variable in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 249 Views

To multiply a Legendre series by an independent variable x, use the polynomial.legendre.legmulx() method in NumPy. This method takes a 1-D array of Legendre series coefficients and returns the result of multiplying the series by x. Syntax numpy.polynomial.legendre.legmulx(c) Parameters The parameter c is a 1-D array of Legendre series coefficients ordered from low to high degree. For example, [1, 2, 3] represents the series P₀ + 2×P₁ + 3×P₂, where Pₙ are Legendre polynomials. Example Let's create a Legendre series and multiply it by x ? import numpy as np ...

Read More

Subtract one Legendre series from another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 181 Views

To subtract one Legendre series from another, use the polynomial.legendre.legsub() method in Python NumPy. The method returns an array representing the Legendre series of their difference. The function computes the difference 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. The parameters c1 and c2 are 1-D arrays of Legendre series coefficients ordered from low to high. Syntax numpy.polynomial.legendre.legsub(c1, c2) Parameters c1, c2 − 1-D arrays of Legendre series ...

Read More
Showing 151–160 of 802 articles
« Prev 1 14 15 16 17 18 81 Next »
Advertisements