
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Raise a Chebyshev series to a power in Python
To raise a Chebyshev series to a power, use the chebyshev.chebpow() method in Python Numpy. Returns the Chebyshev series c raised to the power pow. The argument c is a sequence of coefficients ordered from low to high. i.e., [1,2,3] is the series T_0 + 2*T_1 + 3*T_2. The method returns the Chebyshev series of power.
The parameter, c is a 1-D array of Chebyshev series coefficients ordered from low to high. The parameter, power is a power to which the series will be raised. The parameter, maxpower is the maximum power allowed. This is mainly to limit growth of the series to unmanageable size. Default is 16.
Steps
At first, import the required libraries -
import numpy as np from numpy.polynomial import chebyshev as C
Create 1-D array of Chebyshev series coefficient −
c = np.array([1,2,3])
Display the coefficient array −
print("Our coefficient 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 raise a Chebyshev series to a power, use the chebyshev.chebpow() method in Python Numpy. Returns the Chebyshev series c raised to the power pow. The argument c is a sequence of coefficients ordered from low to high. i.e., [1,2,3] is the series T_0 + 2*T_1 + 3*T_2 −
print("\nResult...\n",C.chebdiv(c,3))
Example
import numpy as np from numpy.polynomial import chebyshev as C # Create 1-D array of Chebyshev series coefficient c = np.array([1,2,3]) # Display the coefficient array print("Our coefficient 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 raise a Chebyshev series to a power, use the chebyshev.chebpow() method in Python Numpy print("\nResult...\n",C.chebdiv(c,3))
Output
Our coefficient Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result... (array([0.33333333, 0.66666667, 1. ]), array([0.]))
- Related Articles
- Raise a Laguerre series to a power in Python
- Raise a Hermite series to a power in Python
- Raise a Legendre series to a power in Python
- Raise a Hermite_e series to a power in Python
- Raise a polynomial to a power in Python
- Integrate a Chebyshev series in Python
- Differentiate a Chebyshev series in Python
- Convert a Chebyshev series to a polynomial in Python
- Convert a polynomial to a Chebyshev series in Python
- Generate a Chebyshev series with given roots in Python
- Integrate a Chebyshev series over specific axis in Python
- Integrate a Chebyshev series over axis 0 in Python
- Integrate a Chebyshev series over axis 1 in Python
- Compute the roots of a Chebyshev series in Python
- Evaluate a Chebyshev series at points x in Python
