একটি Chebyshev সিরিজকে বহুপদে রূপান্তর করতে, PythonNumpy-এ chebyshev.cheb2poly() পদ্ধতি ব্যবহার করুন। একটি চেবিশেভ সিরিজের সহগকে প্রতিনিধিত্বকারী একটি বিন্যাস রূপান্তর করুন, সর্বনিম্ন ডিগ্রী থেকে সর্বোচ্চ, সমতুল্য বহুপদীর সহগগুলির একটি বিন্যাসে ("মানক" ভিত্তিতে) সর্বনিম্ন থেকে সর্বোচ্চ ডিগ্রী পর্যন্ত ক্রমানুযায়ী।
পদ্ধতিটি একটি 1-D অ্যারে প্রদান করে যার মধ্যে সমতুল্য বহুপদীর সহগগুলি সর্বনিম্ন ক্রম থেকে সর্বোচ্চ পর্যন্ত অর্ডার করা হয়। পরামিতি c হল একটি 1-D অ্যারে যাতে চেবিশেভ সিরিজের কোফিসিয়েন্ট থাকে, সর্বনিম্ন ক্রম থেকে সর্বোচ্চ পর্যন্ত অর্ডার করা হয়৷
পদক্ষেপ
প্রথমে, প্রয়োজনীয় লাইব্রেরি আমদানি করুন -
import numpy as np from numpy import polynomial as P
numpy.array() পদ্ধতি -
ব্যবহার করে একটি অ্যারে তৈরি করুনc = np.array([1, 2, 3, 4, 5])
অ্যারে প্রদর্শন করুন −
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) চেবিশেভ সিরিজকে বহুপদে রূপান্তর করতে, chebyshev.cheb2poly() পদ্ধতি ব্যবহার করুন −
print("\nResult (chebyshev to polynomial)...\n",P.chebyshev.cheb2poly(c)) উদাহরণ
import numpy as np
from numpy import polynomial as P
# Create an array using the numpy.array() method
c = np.array([1, 2, 3, 4, 5])
# 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 convert a Chebyshev series to a polynomial, use the chebyshev.cheb2poly() method in Python Numpy
print("\nResult (chebyshev to polynomial)...\n",P.chebyshev.cheb2poly(c)) আউটপুট
Our Array... [1 2 3 4 5] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (5,) Result (chebyshev to polynomial)... [ 3. -10. -34. 16. 40.]