AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 11 of 840

Convert a polynomial to Legendre series in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 490 Views

To convert a polynomial to a Legendre series, use the legendre.poly2leg() method in Python NumPy. This function converts an array representing the coefficients of a polynomial (ordered from lowest degree to highest) to an array of the coefficients of the equivalent Legendre series. Syntax numpy.polynomial.legendre.poly2leg(pol) Parameters: pol − 1-D array containing the polynomial coefficients ordered from lowest to highest degree Returns: 1-D array containing the coefficients of the equivalent Legendre series. Example Let's convert a polynomial with coefficients [1, 2, 3, 4, 5] to its Legendre series representation ? ...

Read More

Generate a Pseudo Vandermonde matrix of the Legendre polynomial and x, y complex array of points in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 204 Views

To generate a pseudo Vandermonde matrix of the Legendre polynomial, use the legendre.legvander2d() method in Python NumPy. This method returns the pseudo-Vandermonde matrix for two-dimensional Legendre polynomial evaluation. The pseudo Vandermonde matrix is used for polynomial fitting and interpolation. Each row corresponds to a point coordinate, and each column represents a basis function formed by the product of Legendre polynomials of different degrees. Syntax numpy.polynomial.legendre.legvander2d(x, y, deg) Parameters x, y − Arrays of point coordinates with the same shape. Complex numbers are supported. deg − List of maximum degrees in the form [x_deg, ...

Read More

Evaluate a 2D Legendre series on the Cartesian product of x and y in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 217 Views

To evaluate a 2D Legendre series on the Cartesian product of x and y, use the polynomial.legendre.leggrid2d() method in NumPy. This method evaluates a two-dimensional Legendre series at points formed by the Cartesian product of x and y coordinates. The method returns values of the two-dimensional Legendre series at specified grid points. If the coefficient array c has fewer than two dimensions, ones are implicitly appended to make it 2D. The result shape will be c.shape[2:] + x.shape + y.shape. Syntax numpy.polynomial.legendre.leggrid2d(x, y, c) Parameters x, y: The two-dimensional series is evaluated at ...

Read More

Evaluate a 3D Legendre series at points (x,y,z) with 2D array of coefficient in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 228 Views

To evaluate a 3D Legendre series at points (x, y, z), use the polynomial.legendre.legval3d() method in Python NumPy. The method returns the values of the multidimensional polynomial on points formed with triples of corresponding values from x, y, and z. If the coefficient array c has fewer than 3 dimensions, ones are implicitly appended to its shape to make it 3D. The shape of the result will be c.shape[3:] + x.shape. Syntax numpy.polynomial.legendre.legval3d(x, y, z, c) Parameters x, y, z: The three dimensional series is evaluated at the points (x, y, z), where ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 194 Views

To generate a pseudo Vandermonde matrix of the Hermite_e polynomial and x, y, z sample points, use the hermite_e.hermevander3d() in Python NumPy. The method returns the pseudo-Vandermonde matrix. The parameter x, y, z are arrays of point coordinates, all of the same shape. The dtypes will be converted to either float64 or complex128 depending on whether any of the elements are complex. Scalars are converted to 1-D arrays. The parameter deg is the list of maximum degrees of the form [x_deg, y_deg, z_deg]. Syntax numpy.polynomial.hermite_e.hermevander3d(x, y, z, deg) Parameters x, y, z: Arrays of ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 205 Views

To generate a pseudo Vandermonde matrix of the Legendre polynomial, use the legendre.legvander2d() method in Python NumPy. This method creates a 2D pseudo-Vandermonde matrix where each row corresponds to a point coordinate and columns represent different polynomial degrees. The pseudo-Vandermonde matrix evaluates Legendre polynomials at given points for all degree combinations up to specified maximum degrees. The returned matrix shape is x.shape + (deg[0] + 1) * (deg[1] + 1), where the last dimension contains polynomial evaluations. Syntax numpy.polynomial.legendre.legvander2d(x, y, deg) Parameters The function accepts the following parameters: x, y − ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 197 Views

To generate a pseudo Vandermonde matrix of the Legendre polynomial, use the legendre.legvander2d() method in NumPy. This method creates a 2D pseudo-Vandermonde matrix where each column represents evaluations of Legendre polynomial basis functions at given coordinate points. The method returns a matrix with shape x.shape + (deg + 1, ), where the last index corresponds to the degree of the Legendre polynomial. The parameters x and y are arrays of point coordinates with the same shape, and deg is a list specifying maximum degrees as [x_deg, y_deg]. Basic Example Let's create coordinate arrays and generate the pseudo ...

Read More

Generate a Vandermonde matrix of the Legendre polynomial with complex array of points in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 237 Views

To generate a pseudo Vandermonde matrix of the Legendre polynomial with complex points, use the polynomial.legvander() method in NumPy. This method returns a matrix where each row represents the evaluation of Legendre polynomials at a given point, with columns corresponding to different polynomial degrees. The returned matrix has shape x.shape + (deg + 1, ), where the last index represents the degree of the corresponding Legendre polynomial. The data type matches the input array after conversion to float64 or complex128. Syntax numpy.polynomial.legendre.legvander(x, deg) Parameters x − Array of points. Scalar values are ...

Read More

Evaluate a Hermite_e series at points x and the shape of the coefficient array extended for each dimension of x in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 198 Views

To evaluate a Hermite_e series at points x, use the hermite_e.hermeval() method in Python NumPy. This function allows you to evaluate Hermite_e polynomials at specific points and control how the coefficient array is handled for different dimensions. Parameters The hermeval() method accepts three key parameters: x: The evaluation points. 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 where coefficients for terms of degree n are in c[n]. For multidimensional arrays, remaining indices enumerate multiple polynomials. tensor: Boolean parameter controlling ...

Read More

Evaluate a Hermite_e series at points x when coefficients are multi-dimensional in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 226 Views

To evaluate a Hermite_e series at points x with multi-dimensional coefficients, use the hermite_e.hermeval() method in Python NumPy. This function allows you to evaluate multiple Hermite_e polynomials simultaneously when coefficients are stored in a multi-dimensional array. Parameters The hermeval() function takes three main parameters ? x − Evaluation points. Can be a scalar, list, or array. Must support addition and multiplication operations. c − Coefficient array where c[n] contains coefficients for degree n terms. For multi-dimensional arrays, additional dimensions represent multiple polynomials. tensor − Boolean flag (default True). When True, evaluates each column of coefficients for ...

Read More
Showing 101–110 of 8,392 articles
« Prev 1 9 10 11 12 13 840 Next »
Advertisements