Programming Articles

Page 216 of 2547

Multiply one Hermite series to another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 163 Views

To multiply one Hermite series to another, use the polynomial.hermite.hermmul() method in Python NumPy. This method returns an array representing the Hermite series of their product. The arguments are sequences of coefficients ordered from lowest to highest degree, e.g., [1, 2, 3] represents the series P_0 + 2*P_1 + 3*P_2. Syntax numpy.polynomial.hermite.hermmul(c1, c2) Parameters c1, c2: 1-D arrays of Hermite series coefficients ordered from low to high degree. Return Value Returns a 1-D array representing the coefficients of the product Hermite series. Example Let's multiply two Hermite series using coefficient ...

Read More

Multiply a Hermite series by an independent variable in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 176 Views

To multiply the Hermite series by x, where x is the independent variable, use the polynomial.hermite.hermmulx() method in Python NumPy. The method returns an array representing the result of the multiplication. The parameter c is a 1-D array of Hermite series coefficients ordered from low to high. Syntax numpy.polynomial.hermite.hermmulx(c) Parameters c: A 1-D array of Hermite series coefficients ordered from low to high degree. Example Let's create a simple example to demonstrate the multiplication of a Hermite series by the independent variable ? import numpy as np from numpy.polynomial import ...

Read More

Get the Least squares fit of Chebyshev series to data in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 670 Views

To get the least-squares fit of Chebyshev series to data, use the chebyshev.chebfit() function in NumPy. This method returns Chebyshev coefficients ordered from low to high, allowing you to fit polynomial approximations to your data using Chebyshev polynomials. Syntax numpy.polynomial.chebyshev.chebfit(x, y, deg, rcond=None, full=False, w=None) Parameters The function accepts the following parameters: x − The x-coordinates of the M sample points (x[i], y[i]) y − The y-coordinates of the sample points. Can be 2-D array for multiple data sets deg − Degree(s) of the fitting polynomials. If integer, includes all terms up ...

Read More

Differentiate a polynomial with multidimensional coefficients in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 306 Views

To differentiate a polynomial with multidimensional coefficients, use the polynomial.polyder() method in NumPy. This function differentiates polynomial coefficients c along a specified axis, returning the derivative coefficients. The coefficient array represents polynomials where [1, 2, 3] means 1 + 2*x + 3*x², while [[1, 2], [1, 2]] represents 1 + 1*x + 2*y + 2*x*y if axis=0 is x and axis=1 is y. Syntax numpy.polynomial.polynomial.polyder(c, m=1, scl=1, axis=0) Parameters The function accepts the following parameters ? c − Array of polynomial coefficients (multidimensional arrays correspond to different variables) m − Number ...

Read More

Generate a Pseudo-Vandermonde matrix of given degree with complex array of points coordinates in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 176 Views

To generate a Pseudo-Vandermonde matrix of given degree with complex coordinates, use the polyvander2d() function from NumPy's polynomial module. This function creates a 2D Vandermonde matrix from arrays of point coordinates with specified maximum degrees for each dimension. Syntax numpy.polynomial.polynomial.polyvander2d(x, y, deg) Parameters x, y: Arrays of point coordinates with the same shape. Complex values are supported. deg: List of maximum degrees in the form [x_deg, y_deg]. Example Let's create a Pseudo-Vandermonde matrix using complex coordinate arrays ? import numpy as np from numpy.polynomial.polynomial import polyvander2d # Create arrays ...

Read More

Generate a Pseudo-Vandermonde matrix of given degree with float array of points coordinates in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 170 Views

To generate a Pseudo-Vandermonde matrix of given degree, use the polynomial.polyvander2d() in Python NumPy. The method returns the pseudo-Vandermonde matrix of degrees deg and sample points (x, y). The parameters x and 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. The parameter deg is a list of maximum degrees of the form [x_deg, y_deg]. Syntax numpy.polynomial.polynomial.polyvander2d(x, y, deg) Parameters x, y − Arrays of point coordinates, all of the same shape ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 186 Views

The Hermite series evaluation in Python NumPy allows you to compute polynomial values at specific points using the hermite.hermval() method. This function is particularly useful when working with multidimensional coefficient arrays and controlling how the evaluation is broadcast across dimensions. Syntax hermite.hermval(x, c, tensor=True) Parameters The hermval() method accepts three parameters: x: Points at which to evaluate the series. Can be a scalar, list, or array c: Coefficient array where c[n] contains coefficients for degree n terms tensor: Controls broadcasting behavior (default: True) Understanding the tensor Parameter When tensor=True, ...

Read More

Subtract one Hermite series from another in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 178 Views

To subtract one Hermite series from another, use the polynomial.hermite.hermsub() method in Python NumPy. The method returns an array representing the Hermite series of their difference. It computes c1 - c2, where the sequences of coefficients are ordered from lowest to highest order terms, i.e., [1, 2, 3] represents the series P_0 + 2*P_1 + 3*P_2. Syntax numpy.polynomial.hermite.hermsub(c1, c2) Parameters c1, c2 − 1-D arrays of Hermite series coefficients ordered from low to high degree. Example Let's create two Hermite series and subtract one from another ? import numpy as ...

Read More

Generate a Pseudo-Vandermonde matrix of given degree in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 341 Views

To generate a Pseudo-Vandermonde matrix of given degree, use the polynomial.polyvander2d() in Python NumPy. The method returns the pseudo-Vandermonde matrix of degrees deg and sample points (x, y). The parameter, x and 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.polynomial.polyvander2d(x, y, deg) Parameters x, y − Arrays of point ...

Read More

Differentiate a polynomial in Python

AmitDiwan
AmitDiwan
Updated on 26-Mar-2026 1K+ Views

To differentiate a polynomial, use the polynomial.polyder() method in Python NumPy. This method returns the polynomial coefficients differentiated m times along a specified axis. The coefficients are ordered from low to high degree, so [1, 2, 3] represents 1 + 2*x + 3*x². Syntax numpy.polynomial.polynomial.polyder(c, m=1, scl=1, axis=0) Parameters The method accepts the following parameters: c − Array of polynomial coefficients from low to high degree m − Number of derivatives to take (default: 1, must be non-negative) scl − Scaling factor applied at each differentiation (default: 1) axis − Axis over ...

Read More
Showing 2151–2160 of 25,466 articles
« Prev 1 214 215 216 217 218 2547 Next »
Advertisements