poly (Polynomials)
This module is used for evaluating the monomial basis functions which are commonly added to RBF interpolants
- rbf.poly.mvmonos(x, degree, diff=None)
Multivariate monomial basis functions.
- Parameters:
x ((..., D) float array) – Positions where the monomials will be evaluated.
degree (int or (M, D) int array) – If this is an int, it is the degree of polynomials spanned by the monomials. If this is an array, it is the power for each variable in each monomial.
diff ((D,) int array, optional) – Derivative order for each variable.
- Returns:
(…, M) array – Alternant matrix where each monomial is evaluated at x.
Example
>>> pos = np.array([[1.0], [2.0], [3.0]]) >>> pows = np.array([[0], [1], [2]]) >>> mvmonos(pos, pows) array([[ 1., 1., 1.], [ 1., 2., 4.], [ 1., 3., 9.]])
>>> pos = np.array([[1.0, 2.0], [2.0, 3.0], [3.0, 4.0]]) >>> pows = np.array([[0, 0], [1, 0], [0, 1]]) >>> mvmonos(pos, pows) array([[ 1., 1., 2.], [ 1., 2., 3.], [ 1., 3., 4.]])