Evaluate a Hermite_e series at tuple of points x in Python

Evaluate a Hermite_e series at tuple of points x in Python

To evaluate a Hermite_e series at a tuple of points x using NumPy, you essentially follow the same method as you would for a list of points. The only difference would be that your input x would be a tuple instead of a list.

Here's how you can do it:

  • Ensure you have NumPy installed:
pip install numpy 
  • Now, use the hermeval function to evaluate the Hermite_e series for a tuple of points:
import numpy as np # Define the Hermite_e series coefficients # For instance: c[0], c[1], c[2] would be the coefficients of H_0, H_1, and H_2 respectively. coefficients = [1, 2, 3] # Tuple of x points to evaluate x_points = (0, 0.5, 1, 1.5, 2) results = np.polynomial.hermite_e.hermeval(x_points, coefficients) print(results) 

In this case, the Hermite_e series is:

f(x)=1∗H0​(x)+2∗H1​(x)+3∗H2​(x)

Simply adjust the coefficients list and the x_points tuple as needed for your application. The function will return a list of evaluated values corresponding to each point in x_points.


More Tags

typeorm-activerecord hive google-maps-api-3 punctuation git-difftool microsoft-metro numeric-input fiddler managedthreadfactory visual-studio-addins

More Programming Guides

Other Guides

More Programming Examples