|
44 | 44 | chebval |
45 | 45 | chebval2d |
46 | 46 | chebval3d |
| 47 | + chebvalnd |
47 | 48 | chebgrid2d |
48 | 49 | chebgrid3d |
49 | 50 |
|
|
117 | 118 | 'chebsub', 'chebmulx', 'chebmul', 'chebdiv', 'chebpow', 'chebval', |
118 | 119 | 'chebder', 'chebint', 'cheb2poly', 'poly2cheb', 'chebfromroots', |
119 | 120 | 'chebvander', 'chebfit', 'chebtrim', 'chebroots', 'chebpts1', |
120 | | - 'chebpts2', 'Chebyshev', 'chebval2d', 'chebval3d', 'chebgrid2d', |
| 121 | + 'chebpts2', 'Chebyshev', 'chebval2d', 'chebval3d', 'chebvalnd', 'chebgrid2d', |
121 | 122 | 'chebgrid3d', 'chebvander2d', 'chebvander3d', 'chebcompanion', |
122 | 123 | 'chebgauss', 'chebweight', 'chebinterpolate'] |
123 | 124 |
|
@@ -1301,6 +1302,57 @@ def chebval3d(x, y, z, c): |
1301 | 1302 | return pu._valnd(chebval, c, x, y, z) |
1302 | 1303 |
|
1303 | 1304 |
|
| 1305 | +def chebvalnd(pts, c): |
| 1306 | + r""" |
| 1307 | + Evaluate an N-D Chebyshev series at points. |
| 1308 | +
|
| 1309 | + This function returns the values: |
| 1310 | +
|
| 1311 | + .. math:: |
| 1312 | + p(pts, c) = \sum_{i_1, i_2, \dots, i_n} |
| 1313 | + c_{i_1, i_2, \dots, i_n} * T_{i_1}(x_1) * T_{i_2}(x_2) \dots T_{i_n}(x_n) |
| 1314 | +
|
| 1315 | + where :math:`x_1, x_2, \dots, x_n = pts`. |
| 1316 | + Note that `pts` may also be an `(n, m)` array. |
| 1317 | +
|
| 1318 | + The parameters in `pts` are converted to arrays only if they are |
| 1319 | + tuples or lists, otherwise they are treated as scalars and |
| 1320 | + they must have the same shape after conversion. In either case, either |
| 1321 | + the elements of `pts` or their elements must support multiplication and |
| 1322 | + addition both with themselves and with the elements of `c`. |
| 1323 | +
|
| 1324 | + If `c` has fewer than N dimensions, ones are implicitly appended to its |
| 1325 | + shape to make it N-D. The shape of the result will be c.shape[N:] + |
| 1326 | + pts[0].shape. |
| 1327 | +
|
| 1328 | + Parameters |
| 1329 | + ---------- |
| 1330 | + pts : tuple or list of array_like, compatible objects |
| 1331 | + The N-dimensional series is evaluated at the points |
| 1332 | + ``(x_1, x_2, ..., x_n)`` provided in the `pts` iterable, where |
| 1333 | + all elements must have the same shape. If any element is a list |
| 1334 | + or tuple, it is first converted to an ndarray, otherwise it is |
| 1335 | + left unchanged and if it isn't an ndarray it is treated as a scalar. |
| 1336 | + c : array_like |
| 1337 | + Array of coefficients ordered so that the coefficient of the term of |
| 1338 | + multi-degree i,j,k,... is contained in ``c[i,j,k,...]``. If `c` has |
| 1339 | + dimension greater than N, the remaining indices enumerate multiple |
| 1340 | + sets of coefficients. |
| 1341 | +
|
| 1342 | + Returns |
| 1343 | + ------- |
| 1344 | + values : ndarray, compatible object |
| 1345 | + The values of the multidimensional Chebyshev series on points formed |
| 1346 | + with N-tuples of corresponding values from `pts`. |
| 1347 | +
|
| 1348 | + See Also |
| 1349 | + -------- |
| 1350 | + chebval, chebval2d, chebval3d |
| 1351 | +
|
| 1352 | + """ |
| 1353 | + return pu._valnd(chebval, c, *pts) |
| 1354 | + |
| 1355 | + |
1304 | 1356 | def chebgrid3d(x, y, z, c): |
1305 | 1357 | """ |
1306 | 1358 | Evaluate a 3-D Chebyshev series on the Cartesian product of x, y, and z. |
|
0 commit comments