spectral.FourierEquispacedBasis#

class spectral.FourierEquispacedBasis(domain: tuple[float, float] = (0.0, 6.283185307179586), representation: str = 'real')[source]#

Bases: SpectralBasis

Equispaced Fourier basis on a periodic interval.

Methods

__init__

diff_matrix

Return Fourier differentiation matrix.

mass_matrix

Return diagonal mass matrix for trapezoidal quadrature.

nodes

Return equispaced nodes on the periodic domain.

diff_matrix(nodes: ndarray) ndarray[source]#

Return Fourier differentiation matrix.

Parameters:
nodesnp.ndarray

Fourier collocation nodes

Returns:
np.ndarray

Fourier differentiation matrix of shape (N, N)

mass_matrix(nodes: ndarray) ndarray[source]#

Return diagonal mass matrix for trapezoidal quadrature.

Parameters:
nodesnp.ndarray

Fourier collocation nodes

Returns:
np.ndarray

Diagonal mass matrix of shape (N, N)

nodes(num_points: int) ndarray[source]#

Return equispaced nodes on the periodic domain.

Parameters:
num_pointsint

Number of equispaced nodes

Returns:
np.ndarray

Equispaced nodes on the periodic interval