কম্পিউটার

পাইথনে প্রদত্ত জটিল শিকড় সহ একটি চেবিশেভ সিরিজ তৈরি করুন


প্রদত্ত রুট সহ একটি চেবিশেভ সিরিজ তৈরি করতে, পাইথন নম্পিতে chebyshev.chebfromroots() পদ্ধতি ব্যবহার করুন। পদ্ধতিটি সহগগুলির 1-D অ্যারে প্রদান করে। যদি সমস্ত শিকড় বাস্তব হয় তবে আউট একটি রিয়েল্যারে, যদি কিছু মূল জটিল হয়, তাহলে ফলাফলের সমস্ত সহগ বাস্তব হলেও আউট জটিল। পরামিতি শিকড় হল শিকড় ধারণকারী ক্রম।

পদক্ষেপ

প্রথমে, প্রয়োজনীয় লাইব্রেরি আমদানি করুন -

from numpy.polynomial import chebyshev as C

দেওয়া জটিল শিকড় −

j = complex(0,1)

সিরিজ তৈরি করুন −

print("Result...\n",C.chebfromroots((-j, j)))

ডেটাটাইপ −

পান
print("\nType...\n",C.chebfromroots((-j, j)).dtype)

আকৃতি −

পান
print("\nShape...\n",C.chebfromroots((-j, j)).shape)

উদাহরণ

from numpy.polynomial import chebyshev as C

# To generate a Chebyshev series with given roots, use the chebyshev.chebfromroots() method in Python Numpy.

# The method returns 1-D array of coefficients. If all roots are real then out is a real array, if some of the roots are complex, then out is complex even if all the coefficients in the result are real.

# The parameter roots are the sequence containing the roots.
j = complex(0,1)
print("Result...\n",C.chebfromroots((-j, j)))

# Get the datatype
print("\nType...\n",C.chebfromroots((-j, j)).dtype)

# Get the shape
print("\nShape...\n",C.chebfromroots((-j, j)).shape)

আউটপুট

Result...
   [1.5+0.j 0. +0.j 0.5+0.j]

Type...
complex128

Shape...
(3,)

  1. পাইথনে পয়েন্ট কোঅর্ডিনেটের জটিল অ্যারের সাথে প্রদত্ত ডিগ্রির একটি ছদ্ম-ভান্ডারমন্ড ম্যাট্রিক্স তৈরি করুন

  2. পাইথনে পয়েন্টের জটিল বিন্যাসের সাথে প্রদত্ত ডিগ্রির একটি ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করুন

  3. পাইথনে প্রদত্ত শিকড় সহ একটি মনিক বহুপদ তৈরি করুন

  4. পাইথনে বিন্দুর জটিল বিন্যাস সহ চেবিশেভ বহুপদীর একটি ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করুন