$$ \newcommand{\bs}[1]{\boldsymbol{#1}} \newcommand{\ts}[1]{\bs{\textsf{#1}}} $$

 

 

 

Spectral Galerkin Method

The spectral Galerkin method can most easily be described by considering a simple PDE, like the Poisson equation, in a 1D domain \( \Omega \) $$ \begin{equation} -u''(x) = f(x), \quad x \in \Omega, \tag{1} \end{equation} $$ with appropriate boundary conditions (Dirichlet, Neumann or periodic). To solve this equation, we can define a test function \( v(x) \) that satisfies the boundary conditions, and that comes with an accompanying weight function \( w(x) \). Assuming also that we work with complex valued functions, a weighted continuous inner product of the two functions \( u \) and \( v \) can be defined as $$ \begin{equation} (u, v)_w = \int_{\Omega} u(x) \overline{v}(x) w(x) dx, \tag{2} \end{equation} $$ where \( \overline{v} \) is the complex conjugate of \( v \). The weighted inner product can now be used to create variational forms. If we multiply Eq. (1) with \( \overline{v}w \) and integrate over the domain we obtain the variational form of the PDE $$ \begin{equation} (-u'', v)_w = (f, v)_w. \tag{3} \end{equation} $$ The variational form can be solved numerically if \( u \) and \( v \) are approximated using a finite number \( (N) \) of test functions \( \{v_l(x)\}_{l=0}^{N-1} \), and a solution $$ \begin{equation} u(x) = \sum_{l=0}^{N-1} \hat{u}_l v_l(x), \tag{4} \end{equation} $$ where \( \bs{\hat{u}} = \{\hat{u}_l\}_{l=0}^{N-1} \) are the expansion coefficients, that are also recognised as the unknowns in the modal spectral Galerkin method.

If \( v \) is chosen from a Fourier or Legendre basis, then the weight function used in the inner product is simply constant, and we may integrate (3) further using integration by parts. However, for a Chebyshev basis the weight function will be \( 1/\sqrt{1-x^2} \) and integration by parts is thus usually avoided. The weighted continuous inner product may, depending on the function that is to be integrated, be difficult or costly to evaluate. As such, we will in this work use the weighted discrete inner product instead, where the integral is approximated using quadrature $$ \begin{equation} (u, v)_w^N = \sum_{j=0}^{N-1} u(x_j) \overline{v}(x_j) w_j \approx \int_{\Omega} u(x) \overline{v}(x) w(x) dx. \tag{5} \end{equation} $$ Here \( \{w_j\}_{j=0}^{N-1} \) represents the quadrature weights and \( \{x_j\}_{j=0}^{N-1} \) are the quadrature points for the integration.

The test functions \( v \) will be chosen based in part on boundary conditions. However, regardless of which space the test functions are chosen from, the procedure for solving a PDE with the spectral Galerkin method is always the same:

In other words it is very much like a finite element method. The major difference is that the basis functions are global, i.e., they all span the entire domain, whereas in FEM the test functions only have local support.