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
Integrate a Hermite_e series in Python
The Hermite_e series integration can be performed using NumPy's hermite_e.hermeint() method. This method integrates a Hermite_e polynomial series and returns the coefficients of the integrated series.
Syntax
The hermite_e.hermeint() method accepts several parameters ?
numpy.polynomial.hermite_e.hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0)
Parameters
- c ? Array of Hermite_e series coefficients
- m ? Order of integration (default: 1)
- k ? Integration constants (default: [])
- lbnd ? Lower bound of integral (default: 0)
- scl ? Scalar multiplier (default: 1)
- axis ? Axis over which integration is performed (default: 0)
Basic Integration Example
Let's integrate a simple Hermite_e series with coefficients [1, 2, 3] ?
import numpy as np
from numpy.polynomial import hermite_e as H
# Create an array of coefficients
c = np.array([1, 2, 3])
# Display the original coefficients
print("Original coefficients:", c)
# Integrate the Hermite_e series
result = H.hermeint(c)
print("Integrated coefficients:", result)
Original coefficients: [1 2 3] Integrated coefficients: [1. 1. 1. 1.]
Integration with Custom Parameters
You can specify integration order and constants ?
import numpy as np
from numpy.polynomial import hermite_e as H
# Coefficients for Hermite_e series
coefficients = np.array([2, 4, 6])
# Integration with order m=1 and integration constant k=5
result1 = H.hermeint(coefficients, m=1, k=5)
print("Integration with k=5:", result1)
# Integration with order m=2
result2 = H.hermeint(coefficients, m=2)
print("Double integration:", result2)
Integration with k=5: [5. 2. 2. 2.] Double integration: [0. 0. 1. 1. 1.]
How It Works
The integration increases the degree of the polynomial by 1 for each integration order. The original polynomial c? + c?x + c?x² becomes a polynomial of higher degree after integration, with the integration constant added as the first coefficient.
Conclusion
Use hermite_e.hermeint() to integrate Hermite_e polynomial series in NumPy. The method returns coefficients of the integrated polynomial, with customizable integration order and constants.
