Responsive Navbar with Google Search
☰ Menu
Home
Python
LaTeX
GNUPlot
Arduino
Feedback
Contact Us
Special Functions: Hermite Polynomial
Special Functions
Bessel Function
Legendre Polynomial
Hermite Polynomial
Hermite Polynomial: Program 1
Plot of Hermite Polynimials
import numpy as np import matplotlib.pyplot as plt from scipy.special import hermite # Define x values x = np.linspace(-5, 5, 500) # List of orders for Legendre polynomials to plot orders = [0, 1, 2, 3, 4] # Plot the Legendre polynomials plt.figure(figsize=(10, 6)) for n in orders: Hn = hermite(n) # Get Legendre polynomial of order n plt.plot(x, Hn(x), label=f'H_{n}(x)') # Add labels and title plt.xlabel('x') plt.ylabel('H_n(x)') plt.title('Hermite Polynomials') plt.legend() plt.grid(True) # Show the plot plt.savefig("plot.png")
Run Code
Output 1