Approximate Methods: Rayleigh-Ritz & Galerkin
1. Introduction to Approximate Methods in Engineering Mechanics
In the analysis of real-world physical systems—ranging from the structural design of high-rise building frameworks and aerospace structures to the thermal management of electronic packages—engineers are governed by differential equations. These governing differential equations (GDEs) are mathematical formulations of physical conservation laws, such as the conservation of linear momentum (equilibrium of forces), the conservation of energy (first law of thermodynamics), and the conservation of mass.
For simple geometries, homogeneous materials, and idealized loading conditions, it is possible to solve these differential equations analytically to obtain an exact solution $u(x)$ that satisfies the differential equation at every point in the domain. However, practical engineering problems rarely admit analytical solutions due to three main factors:
To analyze these systems, we must resort to numerical approximation methods. These methods do not attempt to find the exact continuous function $u(x)$ that satisfies the GDE at every single point. Instead, they transform the continuous, infinite-dimensional differential problem into a discrete, finite-dimensional algebraic problem that can be solved using computers. The two most prominent classical approximation methods that form the mathematical foundation of the Finite Element Method (FEM) are the Rayleigh-Ritz Method and the Galerkin Method of Weighted Residuals.
2. The Concept of Trial Functions
The cornerstone of any approximation method is the concept of a trial solution (or approximating function). We assume that the unknown physical field $u(x)$ (which could represent displacement, temperature, velocity, or pressure) can be approximated by a linear combination of known, pre-selected functions, referred to as trial functions or basis functions $\phi_j(x)$.
Mathematically, we write the trial solution $u_h(x)$ as:
Where:
Mathematical Requirements for Trial Functions
To guarantee that our approximate solution converges to the true physical solution as we add more terms ($n \to \infty$), the trial functions must satisfy the following mathematical criteria:
Boundary Conditions: Essential vs. Natural
A crucial distinction in FEM and approximate methods is how boundary conditions are handled:
3. The Residual and its Minimization
Consider a general differential equation representing a physical law within a domain $\Omega$:
Where $L$ is a differential operator (e.g., $L = -\frac{d^2}{dx^2}$ for 1D heat conduction or bar deformation) and $f(x)$ is a known source term (e.g., heat generation or axial load).
If we substitute the exact solution $u(x)$ into this equation, the left-hand side is exactly zero at every point $x \in \Omega$. However, if we substitute our trial approximation $u_h(x)$ into the differential operator, it will generally not equal $f(x)$ because $u_h(x)$ is only an approximation. The difference is defined as the residual (or error function) $R(x; \mathbf{c})$:
The residual represents the local "out-of-equilibrium" force or heat flux. Our goal is to find the set of coefficients $\mathbf{c} = \{c_1, c_2, \dots, c_n\}^T$ that makes the residual $R(x; \mathbf{c})$ as "small" as possible over the entire domain.
Since we only have a finite number of coefficients ($n$), we cannot force the residual to be zero at every single point $x \in \Omega$. Instead, the Method of Weighted Residuals (MWR) forces the weighted average of the residual to be zero over the domain. We multiply the residual by a set of $n$ independent weight functions $w_i(x)$ and set the integral to zero:
By setting up $n$ such integral equations, we obtain a system of $n$ algebraic equations that we can solve for the $n$ unknown coefficients $c_j$.
Classification of Weighted Residual Methods
Depending on the choice of the weight functions $w_i(x)$, we obtain different numerical methods:
4. Rayleigh-Ritz Energy Minimization
The Rayleigh-Ritz Method is a variational approach that is applicable to physical systems that possess a governing variational principle—most notably, the Principle of Minimum Potential Energy in solid mechanics.
Instead of starting with the differential equation, we start with a functional $\Pi(u)$, which is a function of functions. For a linear elastic structural system, $\Pi(u)$ represents the Total Potential Energy:
Where:
The Principle of Minimum Potential Energy states that among all admissible displacement fields $u(x)$ that satisfy the essential boundary conditions, the true displacement field that satisfies the equilibrium equations is the one that minimizes the total potential energy $\Pi(u)$.
In the Rayleigh-Ritz method, we substitute our trial solution $u_h(x) = \phi_0(x) + \sum_{j=1}^n c_j \phi_j(x)$ directly into the functional $\Pi(u)$:
This substitution transforms the functional $\Pi(u)$ into a standard multivariable function of the $n$ real variables $c_1, c_2, \dots, c_n$. According to multivariable calculus, the stationary point (minimum) of this function is found by setting the partial derivatives with respect to each coefficient to zero:
Since $\Pi(u)$ is quadratic in $u$, this minimization process yields a system of $n$ linear algebraic equations in terms of the coefficients $c_j$:
Comparison and Limitations
While the Rayleigh-Ritz method is highly elegant and physically intuitive, it has one major limitation: it requires a known functional. For many engineering problems—such as fluid flow (Navier-Stokes equations), convection-dominated heat transfer, or non-conservative mechanics—there is no classical variational functional.
In contrast, the Galerkin Method does not require a functional. It works directly on the governing differential equation. Interestingly, for self-adjoint, positive-definite linear operators (such as linear elasticity and pure heat conduction), the Galerkin method (applied to the weak form) and the Rayleigh-Ritz method yield the exact same system of algebraic equations. Thus, the Galerkin method can be viewed as a more general formulation that encompasses the Rayleigh-Ritz method as a special case.
5. Galerkin Orthogonality
To understand the mathematical elegance of the Galerkin method, we must look at it through the lens of functional analysis.
Let $V$ be the infinite-dimensional space of all possible functions that could represent the physical field $u(x)$. We can define an inner product on this function space, which generalizes the vector dot product. For two functions $f(x)$ and $g(x)$ in the domain $\Omega = [0, L]$, the standard $L_2$ inner product is:
Using this notation, the Galerkin weighted residual equation can be written as:
This equation states that the residual error function $R(x; \mathbf{c})$ is orthogonal to each of the trial functions $\phi_i(x)$.
The trial functions $\{\phi_1, \phi_2, \dots, \phi_n\}$ span a finite-dimensional subspace $V_h \subset V$. Because the residual $R(x; \mathbf{c})$ is orthogonal to every basis function spanning $V_h$, the residual is orthogonal to the entire approximation subspace $V_h$. This is the principle of Galerkin Orthogonality.
Physical and Geometric Interpretation
This orthogonality has a powerful geometric analogy. Imagine a vector $\vec{v}$ in 3D space, and we want to find the best approximation of this vector on a 2D plane (a subspace). The best approximation is the orthogonal projection of $\vec{v}$ onto the plane, which we call $\vec{v}_h$. The error vector is $\vec{e} = \vec{v} - \vec{v}_h$. Geometrically, the error $\vec{e}$ is perpendicular (orthogonal) to the plane.
In the Galerkin method, the exact solution $u(x)$ corresponds to the 3D vector $ec{v}$, the approximate solution $u_h(x)$ corresponds to the projection $ec{v}_h$, and the residual $R(x)$ is the error. Galerkin orthogonality ensures that the approximation error is orthogonal to the approximation space. In terms of functional energy, this means that the Galerkin approximation minimizes the error in the energy norm, providing the most accurate possible solution within the limits of the chosen trial functions.
Extended chapter reference
Galerkin, collocation, subdomain, and least-squares approximations
Weighted-residual methods make an approximate field useful by forcing its governing-equation error to vanish in selected integral senses. Galerkin weighting is the foundation of most standard finite element formulations.
Visual map
From formulation to verified result
Equation sheet
Governing relationships
Pointwise imbalance caused by the approximation.
Makes the residual orthogonal to every selected weight.
Minimizes total squared residual.
Engineering comparison
Selection and interpretation table
| Method | Weight choice | Main advantage | Limitation |
|---|---|---|---|
| Galerkin | Weight equals trial function | Symmetric forms for self-adjoint PDEs | Can oscillate in advection-dominated problems |
| Collocation | Point impulses | Very direct implementation | Sensitive to point selection |
| Subdomain | Unity over subregions | Clear conservation meaning | Lower local accuracy |
| Least squares | Residual derivative | Positive-definite algebraic systems | May change physical weighting |
Verification and application
Checks before accepting the result
- Residual has correct physical units
- Boundary terms are retained
- Weight count matches unknown count
- Patch-test field is reproduced
Industry application
In steady 1D heat conduction with internal generation, a quadratic trial field can satisfy both end temperatures exactly. Galerkin weighting then distributes the remaining differential-equation error over the domain instead of forcing an exact pointwise fit.