Evaluate a 2-D Hermite_e series at points (x,y) with 3D array of coefficient using NumPy in Python

Evaluate a 2-D Hermite_e series at points (x,y) with 3D array of coefficient using NumPy in Python

To evaluate a 2-D Hermite_e series at points (x, y) with a 3D array of coefficients using NumPy, you can use the hermeval2d function from the numpy.polynomial.hermite_e module. This function evaluates a 2-D Hermite_e series at the points (x, y) with given coefficients.

Here's how you can achieve this:

import numpy as np # Example 3D array of coefficients for a 2-D Hermite_e series # coef[i,j,k] is the coefficient of x^i * y^j * He_k coef = np.array([ [[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[10, 11, 12], [13, 14, 15], [16, 17, 18]], [[19, 20, 21], [22, 23, 24], [25, 26, 27]] ]) x = 1 # Example x value y = 2 # Example y value # Evaluate the 2-D Hermite_e series at the point (x, y) result = np.polynomial.hermite_e.hermeval2d(x, y, coef) print(result) 

This code first defines a 3D array of coefficients for a 2-D Hermite_e series. It then evaluates the series at the point (1, 2) and prints the result. Adjust the x and y values to evaluate the series at other points.

Make sure you have the numpy library installed:

pip install numpy 

Now, when you run the code, you'll obtain the value of the 2-D Hermite_e series at the point (x, y) using the given 3D array of coefficients.


More Tags

video.js real-time-clock ms-project google-cloud-dataflow kerberos angular-datatables sqoop time-series netcdf database-schema

More Programming Guides

Other Guides

More Programming Examples