একটি হারমাইট সিরিজকে অন্যটিতে গুণ করতে, PythonNumpy-এ polynomial.hermite.hermmul() পদ্ধতি ব্যবহার করুন। পদ্ধতিটি তাদের পণ্যের হারমাইট সিরিজের প্রতিনিধিত্বকারী একটি অ্যারে প্রদান করে। দুটি হারমাইট সিরিজ c1 * c2 এর পণ্য প্রদান করে। আর্গুমেন্ট হল সহগগুলির ক্রম, সর্বনিম্ন "টার্ম" থেকে সর্বোচ্চ পর্যন্ত, যেমন, [1,2,3] P_0 + 2*P_1 + 3*P_2 সিরিজের প্রতিনিধিত্ব করে। হারমাইট সিরিজের সহগগুলির 1-ড্যারে প্যারামিটারগুলি নিম্ন থেকে উচ্চ পর্যন্ত অর্ডার করা হয়েছে৷
পদক্ষেপ
প্রথমে, প্রয়োজনীয় লাইব্রেরি আমদানি করুন -
import numpy as np from numpy.polynomial import hermite as H
হারমাইট সিরিজের সহগগুলির 1-ডি অ্যারে তৈরি করুন −
c1 = np.array([1,2,3]) c2 = np.array([3,2,1])
সহগ-
এর অ্যারে প্রদর্শন করুনprint("Array1...\n",c1)
print("\nArray2...\n",c2) ডেটাটাইপ প্রদর্শন করুন −
print("\nArray1 datatype...\n",c1.dtype)
print("\nArray2 datatype...\n",c2.dtype) উভয় অ্যারের মাত্রা পরীক্ষা করুন −
print("\nDimensions of Array1...\n",c1.ndim)
print("\nDimensions of Array2...\n",c2.ndim) উভয় অ্যারের আকৃতি পরীক্ষা করুন −
print("\nShape of Array1...\n",c1.shape)
print("\nShape of Array2...\n",c2.shape) একটি হারমাইট সিরিজকে অন্যটিতে গুণ করতে, PythonNumpy -
-এ polynomial.hermite.hermmul() পদ্ধতি ব্যবহার করুন।print("\nResult (multiply)....\n",H.hermmul(c1, c2)) উদাহরণ
import numpy as np
from numpy.polynomial import hermite as H
# Create 1-D arrays of Hermite series coefficients
c1 = np.array([1,2,3])
c2 = np.array([3,2,1])
# Display the arrays of coefficients
print("Array1...\n",c1)
print("\nArray2...\n",c2)
# Display the datatype
print("\nArray1 datatype...\n",c1.dtype)
print("\nArray2 datatype...\n",c2.dtype)
# Check the Dimensions of both the arrays
print("\nDimensions of Array1...\n",c1.ndim)
print("\nDimensions of Array2...\n",c2.ndim)
# Check the Shape of both the arrays
print("\nShape of Array1...\n",c1.shape)
print("\nShape of Array2...\n",c2.shape)
# To multiply one Hermite series to another, use the polynomial.hermite.hermmul() method in Python Numpy
# The method returns an array representing the Hermite series of their product.
print("\nResult (multiply)....\n",H.hermmul(c1, c2)) আউটপুট
Array1... [1 2 3] Array2... [3 2 1] Array1 datatype... int64 Array2 datatype... int64 Dimensions of Array1... 1 Dimensions of Array2... 1 Shape of Array1... (3,) Shape of Array2... (3,) Result (multiply).... [35. 40. 38. 8. 3.]