In this article, we will discuss how to Evaluate a 3-D Chebyshev series on the Cartesian product of x, y, and z with a 4d array of coefficients in Python and NumPy.
Chebyshev polynomials are significant in approximation theory because the Chebyshev nodes are used as matching points for optimizing polynomial interpolation.
To perform Chebyshev differentiation, NumPy provides a function called Chebyshev.chebgrid3d which can be used to evaluate the cartesian product of the 3D Chebyshev series. This function converts the parameters x, y, and z to array only if they are tuples or a list, otherwise, it is left unchanged and, if it is not an array, it is treated as a scalar.
In the first example. let us consider a 4D array c of size 32. Let us consider a 3D series [1,2],[1,2],[1,2] to evaluate against the 4D array. Import the necessary packages as shown and pass the appropriate parameters as shown below.
In the second example. let us consider a 4D array c of size 64. Let us consider a 3D series [2,1],[2,1],[2,1] to evaluate against the 4D array. Import the necessary packages as shown and pass the appropriate parameters as shown below.
The co.efficient array is
[[[[ 0 1][ 2 3]] [[ 4 5] [ 6 7]]
[[ 8 9][10 11]] [[12 13] [14 15]]]
[[[16 17] [18 19]] [[20 21][22 23]]
[[24 25] [26 27]] [[28 29] [30 31]]
[[[32 33] [34 35]] [[36 37][38 39]]
[[40 41] [42 43]] [[44 45][46 47]]]
[[[48 49] [50 51]] [[52 53][54 55]]
[[56 57] [58 59]] [[60 61][62 63]]]]
The shape of the array is (4, 4, 2, 2)
The dimension of the array is 4D
The datatype of the array is int32
Resultant series ---> [[[[208224. 137952.][ 21216. 14048.]] [[ 15456. 10208.][ 1504. 992.]]]
[[[212112. 140544.][ 21648. 14336.]] [[ 15888. 10496.] [ 1552. 1024.]]]]