2. Method of weighted residuals¶
2.1. Basic principle¶
Consider the initial-boundary-value problem of a partial differential equation
on a domain \(\mathcal{D}\) for a function \(u(x,t)\) with boundary condition \(B(u)=0\) on the boundary \(\partial B\) and initial condition \(u(x,0)= u^0(x)\) at time \(t=0\). An ansatz for the approximate solution \(u_N(x,t)\) is made as a finite sum of known functions
Here, the \(\phi_k(x)\) are called trial functions (ansatz functions) which are not changing with time, and \(a_k(t)\) are the corresponding time-dependent coefficients. Note that usually the \(\phi_k(x)\) fulfil homogeneous boundary conditions on \(\partial B\), and the particular solution \(u_B(x,t)\) is used to satisfy the (possibly time-dependent) inhomogeneous boundary conditions.
The advantage of the ansatz (2.2) is that the temporal and spatial dependence and thus the partial derivatives are decoupled. Therefore, spatial derivatives can be written as (assuming \(u_B=0\))
and re-expressed as an expansion of \(\phi_k(x)\). Note that depending on the \(\phi_k\) (e.g. for polynomials), \(N\) and \(N'\) might be different.
On inserting the series expression (2.2) into the original PDE (2.1), the residual is defined as
To determine the \(N+1\) unknown coefficients \(a_k(t)\), the method of weighted residuals requires that the residual \(R(x,t)\) multiplied with \(N+1\) test function \(w_j(x)\) and integrated over the domain should vanish,
or written using the scalar product \((f,g) \equiv \int_\mathcal{D} f\cdot g\,\mathrm{d}x\)
This means that the residual \(R\) is required to be orthogonal to all test functions (weights) \(w_j\). This is the reason why the method is called method of weighted residuals.
2.2. Choice of test functions¶
There exist various methods to choose the test functions. Here, we only mention the two most common approaches, namely the Galerkin and the collocation method. Other important classes would be the Petrov–Galerkin method and the tau method. In particular the tau method is commonly used in Fourier–Chebyshev simulation codes, such as Simson used at KTH Mechanics.
Galerkin method
For the Galerkin method (Boris Galerkin 1845–1871) the ansatz functions \(\phi_k(x)\) in equation (2.2) are chosen to be the same as the test functions \(w_j(x)\),
Collocation method A set of \(N+1\) collocation points is chosen in the domain \(\mathcal{D}\) on which the residual \(R\) is required to vanish,
The consequence of this expression is that the original PDE (2.1) is fulfilled exactly in the collocation points, \(P(u_N)|_{x=x_j}=0\). Thus, the test functions become delta functions,
with \(\delta\) being the Dirac delta function
2.3. Choice of trial functions¶
The trial functions are usually smooth functions which are supported in the complete domain \(\mathcal{D}\). There are many choices possible, in particular trigonometric (Fourier) functions, orthogonal polynomials such as Chebyshev and Legendre polynomials, but also lower-order Lagrange polynomials with local support (finite element method) or b-splines. However, here we focus on two important groups, the Fourier modes and Chebyshev polynomials. Incidentally, the spectral-element method was also first formulated based on Chebyshev polynomials, and later re-formulated in terms of Legendre polynomials due to their simpler integration weights.
2.4. References¶
M. Chevalier, P. Schlatter, A. Lundbladh, D. S. Henningson. SIMSON–A Pseudo-Spectral Solver for Incompressible Boundary Layer Flow, TRITA-MEK 2007:07, KTH Royal Institute of Technology, Sweden, 2007.