← All theory chapters
Theory / FEM

Ritz & Galerkin Methods

Derive the same discrete bar equation from potential energy and weak equilibrium, then identify when the equivalence ends.

Theory · Educational notes

Can the tip displacement be correct while the interior is wrong?

Fix a 100 mm axial bar with EA = 1000000 N and uniform q = 10 N/mm. Try the one-term displacement u = a(x/L) and compare with the exact parabola.

The trial function satisfies the displacement boundary but cannot bend into a quadratic field. Ritz selects its best coefficient by stationary potential energy; Galerkin enforces a weighted residual. Agreement at one point does not expand the approximation space.

Connect the physical quantities

A trial space restricts the shapes the approximation can take. Satisfying the boundary condition is essential, but it does not make that space rich enough for every load. Ritz and Galerkin can produce equivalent systems for this symmetric conservative problem while differing for more general operators.

The relationship used in this example

∂Π∂ai=0\frac{\partial\Pi}{\partial a_i}=0

Ritz chooses unknown coefficients by making an energy functional stationary. Galerkin chooses them by requiring the residual to be orthogonal to a chosen test space. For symmetric conservative linear elasticity with the same admissible approximation space and consistent integration, they produce the same discrete equations.

Work through the example

Step 1

For the linear trial, generalized load qL/2 = 500 N.

Step 2

Divide by EA/L = 10000 N/mm to obtain a = 0.05 mm.

Step 3

At midspan the trial gives 0.025 mm, while the exact parabola gives 0.0375 mm.

Full example conditions and reference values

Fix x = 0; use L = 100 mm, EA = 1,000,000 N, q = 10 N/mm and end force P = 0. Choose uʰ = a(x/L). The stiffness is EA/L = 10,000 N/mm and the generalized load is qL/2 = 500 N, so a = 0.05 mm. The exact solution is u = q(Lx−x²/2)/EA. The approximate tip is exact, but at x = 50 mm uʰ = 0.025 mm while uexact = 0.0375 mm. The approximate axial force is 500 N everywhere; the exact force decreases from 1000 N at the support to zero at the free end. Matching one displacement does not verify the stress field.

Compare the numbers before judging the result

Compare the calculated values
x (mm)Linear trial (mm)Exact (mm)
000
250.01250.021875
500.0250.0375
750.03750.046875
1000.050.05

The tip agrees, but the field between the boundaries does not.

What the result means for a model

The exact tip in this example is not evidence that the entire solution is exact. Add a quadratic basis and compare interior displacement and axial force. Choose validation outputs that expose the missing spatial behavior.

Enrich the admissible displacement space or subdivide the domain, keeping loading and integration consistent. Compare interior displacement and energy in addition to the boundary value before claiming improvement.

Another application: An exact tip value can conceal an interior error

The one-term approximation gives the exact 0.05 mm tip but only 0.025 mm at midspan instead of 0.0375 mm: a 33.3% underestimate there. Its constant axial force also misses the exact force gradient. Matching one observable does not identify the whole field.

Further modeling details

1 · Build the admissible space

The displacement approximation must satisfy prescribed displacement constraints. For nonzero imposed displacement, use a lifting field plus basis functions that vanish on the constrained boundary. Virtual displacements vanish there. Choosing basis functions before checking these constraints can solve the wrong problem even if the resulting matrix is invertible.

2 · Differentiate the potential

Substitute the trial displacement into Π. Differentiating with respect to each coefficient produces the stiffness integral and generalized load. For a stable constrained linear elastic problem this stationary point is a minimum. If rigid modes remain, the energy is not strictly convex and the stiffness cannot be uniquely inverted.

3 · Integrate the equilibrium residual

Start with −(EAu′)′ = q, multiply by a test function and integrate by parts. The boundary term supplies the known end force. The weak equation only needs first derivatives, allowing piecewise linear displacement functions. Galerkin uses the trial-space basis as test functions; a general weighted-residual method need not do so.

4 · Recover reactions separately

The one-term example has no free coefficient at the fixed boundary. Recover the support reaction by equilibrium of the full physical loading: −qL = −1000 N. It is not simply the approximate boundary stress multiplied by area. In a standard bar-element formulation, retain the constrained equation and consistent nodal loads to obtain this reaction.

5 · Improve the space and check the residual

Adding (x/L)² gives a two-term space containing the exact quadratic solution for this uniform example. Its coefficients are 0.1 mm and −0.05 mm. This is an exactness check for a special polynomial case, not a universal accuracy claim. Nonuniform properties, contact and nonlinear constitutive updates require their own convergence checks.

6 · Where the equivalence stops

Convection-dominated transport and nonconservative loading do not generally have the same positive-definite potential used here. A Galerkin weak form can still exist. Do not assume every solver minimizes potential energy, or that nonlinear convergence guarantees a stable equilibrium.

Formula and symbol reference

Open the complete formula reference
uh=∑jajϕj,ϕj(0)=0u^h=\sum_j a_j\phi_j,\qquad \phi_j(0)=0
Π(u)=12∫0LEA(u′)2 dx−∫0Lqu dx−Pu(L)\begin{aligned}\Pi(u)&=\frac12\int_0^L EA(u^{\prime})^2\,\mathrm dx\\&\quad-\int_0^L qu\,\mathrm dx-Pu(L)\end{aligned}
∂Π∂ai=0\frac{\partial\Pi}{\partial a_i}=0
∫0LEAv′u′ dx=∫0Lvq dx+v(L)P\begin{aligned}\int_0^L EA v^{\prime}u^{\prime}\,\mathrm dx&=\int_0^L vq\,\mathrm dx\\&\quad+v(L)P\end{aligned}
Kij=∫0LEAϕi′ϕj′ dxK_{ij}=\int_0^L EA\phi_i^{\prime}\phi_j^{\prime}\,\mathrm dx
fi=∫0Lqϕi dx+Pϕi(L)f_i=\int_0^L q\phi_i\,\mathrm dx+P\phi_i(L)
SymbolMeaningUnit / convention
EAConstant axial rigidityN
q, PAxial line load and end forceN/mm; N
φᵢ, aᵢDimensionless trial function and displacement coefficient1; mm
Π, KᵢⱼTotal potential energy and reduced stiffnessN·mm; N/mm

When this example stops applying

Static, small-strain axial elasticity, conservative loads and exact or consistent quadrature. This introductory derivation does not establish stability of a nonlinear equilibrium or solve general nonsymmetric operators.

Check your interpretation

Why is the free-end pointwise traction nonzero in the one-term approximation even though P = 0?

Show the reasoning

The natural condition is enforced through the weak equation, not necessarily pointwise by a finite trial space. The exact end traction emerges as the approximation improves; a correct tip displacement alone is insufficient.

Sources and calculation scope

The questions and comparison tables are independently authored teaching examples. Numbers illustrate the stated models; they are not measured cell/pack data or commercial-solver validation.

Comparison calculations (Python)

English / Korean · revised 1 November 2026