archimedes.approximation.BasisMatrix¶

class archimedes.approximation.BasisMatrix(matrix: ndarray, weights: ndarray, nodes: ndarray)¶

A Basis evaluated at a set of quadrature nodes.

Also called a “design matrix” or “generalized Vandermonde matrix”.

The basis matrix is bundled with the matching quadrature weights to provide proper weighted inner product semantics for matrix multiplication. In particular, Phi.T gives the adjoint of \(\Phi\) under the weighted inner product: \(\langle \Phi c, r\rangle_w = \langle c, \Phi^\top r\rangle\). That is, Phi.T @ r is not plain matrix multiplication but includes the weights: Phi.T @ r == Phi.matrix.T @ np.diag(Phi.weights) @ r.

This definition of the transpose operation .T as an adjoint means that the Gram (mass) matrix is implemented as Phi.T @ Phi, and a Galerkin projection of a function f is implemented as Phi.T @ f(x), where x = Phi.nodes.

Parameters:
  • matrix (ndarray) – The design matrix \(\Phi\), shape (npts, n_basis) – a generalized Vandermonde matrix, \(\Phi_{ni} = \phi_i(x_n)\) for an arbitrary basis \(\{\phi_i\}\).

  • weights (ndarray) – Quadrature weights for the associated inner product, shape (npts,).

  • nodes (ndarray) – Quadrature nodes at which the basis was evaluated, shape (npts,).

See also

FunctionSpace.basis_matrix

Builds a BasisMatrix for a given basis and quadrature rule.

Methods

replace(**updates)

Returns a new object replacing the specified fields with new values.

Attributes

T

The adjoint \(\Phi^\top\); see the class docstring.

shape

matrix

weights

nodes

__init__(
matrix: ndarray,
weights: ndarray,
nodes: ndarray,
) → None¶
replace(**updates) → T¶

Returns a new object replacing the specified fields with new values.

property T: _BasisMatrixAdjoint¶

The adjoint \(\Phi^\top\); see the class docstring.