Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Numpy Articles
Page 17 of 81
Add one Legendre series to another in Python
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 MoreConvert a polynomial to Laguerre series in Python
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 MoreConvert a Laguerre series to a polynomial in Python
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 MoreRemove small trailing coefficients from Laguerre polynomial in Python
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 MoreGenerate a Pseudo Vandermonde matrix of the Hermite polynomial with float array of points coordinates in Python
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 MoreGenerate a Pseudo Vandermonde matrix of the Hermite polynomial in Python
To generate a pseudo Vandermonde matrix of the Hermite polynomial, use the hermite.hermvander2d() method in Python NumPy. This method returns a 2D pseudo-Vandermonde matrix where each row corresponds to a point and each column represents a basis function. The parameter x, y 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 a list of maximum degrees of the form [x_deg, y_deg]. Syntax numpy.polynomial.hermite.hermvander2d(x, y, deg) ...
Read MoreGenerate a Vandermonde matrix of the Hermite polynomial with complex array of points in Python
To generate a Vandermonde matrix of the Hermite polynomial with complex array points, use the hermite.hermvander() function in Python NumPy. This method returns the pseudo-Vandermonde matrix where each row corresponds to an evaluation point and each column represents a different degree of the Hermite polynomial. The returned matrix has shape x.shape + (deg + 1, ), where the last index corresponds to the degree of the Hermite polynomial. The dtype will match the converted input array. Parameters x − Array of points. Converts to float64 or complex128 depending on whether elements are complex. Scalar inputs are ...
Read MoreIntegrate a Hermite series over axis 1 in Python
To integrate a Hermite series over a specific axis, use the hermite.hermint() method in Python. This function integrates Hermite series coefficients along the specified axis, which is useful for multidimensional polynomial operations. Parameters The hermite.hermint() method accepts the following 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) (default: []) lbnd: Lower bound of the integral (default: 0) scl: Scalar multiplier applied after each integration (default: 1) axis: Axis over which the integral is taken ...
Read MoreIntegrate a Hermite series over specific axis in Python
To integrate a Hermite series, use the hermite.hermint() method in Python. This method integrates Hermite series coefficients over a specified axis, making it useful for polynomial integration in scientific computing. Syntax numpy.polynomial.hermite.hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0) Parameters Parameter Description Default c Array of Hermite series coefficients Required m Order of integration (must be positive) 1 k Integration constant(s) [] (zero) lbnd Lower bound of the integral 0 scl Scalar multiplier after each integration 1 axis Axis over which integration ...
Read MoreEvaluate a 3-D Laguerre series on the Cartesian product of x, y and z with 4d array of coefficient in Python
To evaluate a 3-D Laguerre series on the Cartesian product of x, y and z, use the polynomial.laguerre.laggrid3d() method in Python. The method returns the values of the three-dimensional Laguerre series at points in the Cartesian product of x, y and z. If the coefficient array c has fewer than three dimensions, ones are implicitly appended to its shape to make it 3-D. The shape of the result will be c.shape[3:] + x.shape + y.shape + z.shape. Syntax numpy.polynomial.laguerre.laggrid3d(x, y, z, c) Parameters x, y, z − The three-dimensional series is evaluated at ...
Read More