Programming Articles

Page 201 of 2547

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 178 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 184 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 188 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 247 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 179 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

Add one Legendre series to another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 185 Views

To add one Legendre series to another, use the polynomial.legendre.legadd() method in Python NumPy. The method returns an array representing the Legendre series of their sum. The legadd() function adds 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.legadd(c1, c2) Parameters: c1, c2 − 1-D arrays of Legendre series coefficients ordered from ...

Read More

Convert a polynomial to Laguerre series in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 345 Views

To convert a polynomial to a Laguerre series, use the laguerre.poly2lag() method in Python NumPy. This function converts an array representing polynomial coefficients (ordered from lowest to highest degree) to an array of equivalent Laguerre series coefficients. The method returns a 1-D array containing the coefficients of the equivalent Laguerre series. The parameter pol is a 1-D array containing the polynomial coefficients. Syntax numpy.polynomial.laguerre.poly2lag(pol) Parameters pol: 1-D array containing polynomial coefficients ordered from lowest to highest degree. Return Value Returns a 1-D array containing the coefficients of the equivalent Laguerre series. ...

Read More

Convert a Laguerre series to a polynomial in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 230 Views

To convert a Laguerre series to a polynomial, use the laguerre.lag2poly() method in Python NumPy. This function converts an array representing the coefficients of a Laguerre 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. The method returns a 1-D array containing the coefficients of the equivalent polynomial ordered from lowest order term to highest. The parameter c is a 1-D array containing the Laguerre series coefficients, ordered from lowest order term to highest. Syntax numpy.polynomial.laguerre.lag2poly(c) ...

Read More

Remove small trailing coefficients from Laguerre polynomial in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 209 Views

To remove small trailing coefficients from Laguerre polynomial, use the laguerre.lagtrim() method in Python NumPy. The method returns a 1-d array with trailing zeros removed. If the resulting series would be empty, a series containing a single zero is returned. The small means "small in absolute value" and is controlled by the parameter tol. The trailing means highest order coefficient(s), e.g., in [0, 1, 1, 0, 0] (which represents 0 + x + x**2 + 0*x**3 + 0*x**4) both the 3rd and 4th order coefficients would be trimmed. Syntax numpy.polynomial.laguerre.lagtrim(c, tol=0) Parameters The ...

Read More

Generate a Pseudo Vandermonde matrix of the Hermite polynomial with float array of points coordinates in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 198 Views

To generate a pseudo Vandermonde matrix of the Hermite polynomial, use the hermite.hermvander2d() method in Python NumPy. This method creates a 2D Vandermonde matrix where each row corresponds to a point coordinate and columns represent polynomial basis functions of varying degrees. Syntax numpy.polynomial.hermite.hermvander2d(x, y, deg) Parameters x, y − Arrays of point coordinates with the same shape deg − List of maximum degrees [x_deg, y_deg] Example Let's create a pseudo Vandermonde matrix using float coordinate arrays ? import numpy as np from numpy.polynomial import hermite as H ...

Read More
Showing 2001–2010 of 25,469 articles
« Prev 1 199 200 201 202 203 2547 Next »
Advertisements