Legendre সিরিজ c কে x দ্বারা গুন করতে, যেখানে x হল স্বাধীন চলক, Python Numpy-এ thepolynomial.laguerre.legmulx() পদ্ধতি ব্যবহার করুন। পদ্ধতিটি গুণনের ফলাফলের প্রতিনিধিত্বকারী একটি অ্যারে প্রদান করে। দুটি Legendre সিরিজ c1 - c2 এর পার্থক্য প্রদান করে। আর্গুমেন্ট হল সর্বনিম্ন ক্রম পদ থেকে সর্বোচ্চ পর্যন্ত অনুক্রম করা সহগগুলির ক্রম, যেমন, [1,2,3] এইসবের প্রতিনিধিত্ব করে P_0 + 2*P_1 + 3*P_2। প্যারামিটার, c হল Legendre সিরিজের সহগগুলির একটি 1-D অ্যারে যা নিম্ন থেকে উচ্চ পর্যন্ত অর্ডার করা হয়েছে৷
পদক্ষেপ
প্রথমে, প্রয়োজনীয় লাইব্রেরি আমদানি করুন -
import numpy as np from numpy.polynomial import laguerre as L
একটি অ্যারে তৈরি করুন -
c = np.array([1, 2, 3])
অ্যারে প্রদর্শন করুন −
print("Our Array...\n",c) মাত্রা পরীক্ষা করুন −
print("\nDimensions of our Array...\n",c.ndim) ডেটাটাইপ −
পানprint("\nDatatype of our Array object...\n",c.dtype) আকৃতি −
পানprint("\nShape of our Array object...\n",c.shape) Legendre সিরিজ c কে x দ্বারা গুন করতে, যেখানে x হল স্বাধীন চলক, Python Numpy-এ thepolynomial.laguerre.legmulx() পদ্ধতি ব্যবহার করুন −
print("\nResult....\n",L.legmulx(c)) উদাহরণ
import numpy as np
from numpy.polynomial import legendre as L
# Create an array
c = np.array([1, 2, 3])
# Display the array
print("Our Array...\n",c)
# Check the Dimensions
print("\nDimensions of our Array...\n",c.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n",c.dtype)
# Get the Shape
print("\nShape of our Array object...\n",c.shape)
# To multiply the Legendre series c by x, where x is the independent variable, use the polynomial.laguerre.legmulx() method in Python Numpy
print("\nResult....\n",L.legmulx(c)) আউটপুট
Our Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result.... [0.66666667 2.2 1.33333333 1.8 ]