Compute the roots of a Chebyshev series using NumPy in Python
This article will discuss how to compute the roots of a Chebyshev series in NumPy using Python.
Chebyshev polynomials are important in approximation theory these are never formally generated. Only the coefficients are required for all calculations. If we want to compute the roots of a polynomial we have to use the chebyshev.chebroots() method in NumPy module available in python which returns an array that contains the series of roots. Out is real if all the roots are real; otherwise, it is complex. The c parameter is a one-dimensional array of coefficients.
- integers are the sequence of numbers separated by a comma.
It will return an array of the roots of the given series of integers. If all the roots are real, then output is also real, otherwise the output is complex.
In this example. we will import the Chebyshev module to create regular series with 5 integers and get the roots, data type, and shape.
[-0.96766052 -0.39810338 0.11832406 0.9141065 ] float64 (4,)
In this example. we will import the Chebyshev module to create complex series with 2 data and get the roots, data type, and shape.
[-0.61538462-0.07692308j] (1,) complex128