Spatial discretizations based on Galerkin methods are powerful techniques used to numerically solve partial differential equations (PDEs) and stochastic partial differential equations (SPDEs). The Galerkin approach projects the PDE onto a finite-dimensional subspace of the function space, turning it into a system of algebraic equations that can be solved computationally. Here is an overview of how Galerkin methods are applied to spatial discretization:
1. Basics of Galerkin Methods
- Principle: The Galerkin method approximates the solution $u(x)$ of a PDE by expressing it as a linear combination of basis functions:
$u(x) \approx u_N(x) = \sum_{j=1}^{N} c_j \phi_j(x),$
where $\{ \phi_j(x) \}_{j=1}^{N}$ are chosen basis functions and $c_j$ are the coefficients to be determined.
- Projection: The Galerkin method involves finding $u_N(x)$ such that the residual $R(u_N)$ (the error in satisfying the PDE) is orthogonal to the subspace spanned by the basis functions. This yields:
$\int_{\Omega} R(u_N) \phi_i(x) \, dx = 0 \quad \text{for all } i = 1, 2, \ldots, N.$
2. Weak Formulation of PDEs
- Conversion to Weak Form: The Galerkin method typically starts by converting the strong form of the PDE into its weak form. For a generic PDE:
$\mathcal{L}u(x) = f(x),$
multiplying by a test function $v(x)$ and integrating over the domain $\Omega$ yields:
$\int_{\Omega} v(x) \mathcal{L}u(x) \, dx = \int_{\Omega} v(x) f(x) \, dx.$
This weak formulation ensures that only the lower regularity (differentiability) of the solution is needed.
3. Galerkin Discretization Procedure
- Choose a Finite-Dimensional Subspace: Select a set of basis functions $\{\phi_j(x)\}_{j=1}^N$ (e.g., polynomials, trigonometric functions, or finite element shape functions).
- Formulate the Approximate Solution: Express $u_N(x) = \sum_{j=1}^{N} c_j \phi_j(x)$ .
- Derive the System of Equations: Substitute $u_N(x)$ into the weak form and enforce the orthogonality condition:
$\int_{\Omega} \phi_i(x) \mathcal{L}u_N(x) \, dx = \int_{\Omega} \phi_i(x) f(x) \, dx \quad \text{for } i = 1, 2, \ldots, N.$
- Solve for Coefficients: This results in a linear or nonlinear system of equations for the coefficients $\{c_j\}$ .
4. Types of Galerkin Methods
1. Finite Element Method (FEM)
- Basis Functions: Piecewise polynomial functions defined over elements (subregions) of the domain.
- Advantages: Well-suited for complex geometries and provides flexibility in handling boundary conditions.
- Implementation: The domain is divided into elements (e.g., triangles in 2D), and basis functions are constructed to be non-zero over a small number of elements, leading to a sparse system matrix.
2. Spectral Galerkin Method
- Basis Functions: Global functions such as trigonometric or orthogonal polynomials (e.g., Legendre or Chebyshev polynomials).
- Advantages: Offers high accuracy for problems with smooth solutions due to exponential convergence.
- Limitation: May be less effective for problems with sharp gradients or complex boundaries.