কম্পিউটার

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


প্রদত্ত রুট সহ একটি Laguerre সিরিজ তৈরি করতে, PythonNumpy-এ laguerre.lagfromroots() পদ্ধতি ব্যবহার করুন। পদ্ধতিটি সহগগুলির একটি 1-D অ্যারে। যদি সমস্ত রুট বাস্তব হয় তবে আউট হল একটি বাস্তব অ্যারে, যদি কিছু রুট জটিল হয়, তাহলে ফলাফলের সমস্ত সহগ বাস্তব হলেও আউট জটিল। প্যারামিটার রুট হল শিকড় সমন্বিত ক্রম।

পদক্ষেপ

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

from numpy.polynomial import laguerre as L

প্রদত্ত শিকড় সহ একটি Laguerre সিরিজ তৈরি করতে, laguerre.lagfromroots() পদ্ধতি ব্যবহার করুন -

j = complex(0,1)
print("Result...\n",L.lagfromroots((-j, j)))

ডেটাটাইপ −

পান
print("\nType...\n",L.lagfromroots((-j, j)).dtype)

আকৃতি −

পান
print("\nShape...\n",L.lagfromroots((-j, j)).shape)

উদাহরণ

from numpy.polynomial import laguerre as L

# To generate a Laguerre series with given roots, use the laguerre.lagfromroots() method in Python Numpy.
# The method is a 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",L.lagfromroots((-j, j)))

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

# Get the shape
print("\nShape...\n",L.lagfromroots((-j, j)).shape)

আউটপুট

Result...
   [ 3.+0.j -4.+0.j 2.-0.j]

Type...
complex128

Shape...
(3,)

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

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

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

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