কম্পিউটার

পাইথনে একটি Legendre সিরিজের শিকড় গণনা করুন


একটি Legendre সিরিজের মূল গণনা করতে, Python-এ polynomial.legendre.legroots() পদ্ধতি ব্যবহার করুন। পদ্ধতিটি সিরিজের শিকড়গুলির একটি অ্যারে প্রদান করে। যদি সমস্ত শিকড় বাস্তব হয়, তাহলে আউটও বাস্তব, অন্যথায় এটি জটিল। প্যারামিটার c হল একটি 1-D অ্যারে সহগ।

পদক্ষেপ

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

from numpy.polynomial import legendre as L

একটি Legendre সিরিজের মূল গণনা করতে, Python -

-এ polynomial.legendre.legroots() পদ্ধতি ব্যবহার করুন
print("Result...\n",L.legroots((0, 1, 2)))

ডেটাটাইপ −

পান
print("\nType...\n",L.legroots((0, 1, 2)).dtype)

আকৃতি −

পান
print("\nShape...\n",L.legroots((0, 1, 2)).shape)

উদাহরণ

L# হিসাবে numpy.polynomial import legendre থেকে
from numpy.polynomial import legendre as L

# To compute the roots of a Legendre series, use the polynomial.legendre.legroots() method in Python
print("Result...\n",L.legroots((0, 1, 2)))

# Get the datatype
print("\nType...\n",L.legroots((0, 1, 2)).dtype)

# Get the shape
print("\nShape...\n",L.legroots((0, 1, 2)).shape)

আউটপুট

Result...
   [-0.76759188 0.43425855]

Type...
float64

Shape...
(2,)

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

  2. পাইথনে একটি Laguerre সিরিজের শিকড় গণনা করুন

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

  4. পাইথনে একটি চেবিশেভ সিরিজের শিকড় গণনা করুন