← All theory chapters
Theory / FEM

FEM: Weak Form & Shape Functions

Follow the path from equilibrium to a finite-dimensional displacement approximation.

Theory · Educational notes

How do two nodal displacements describe an entire bar?

Fix the left end of a uniform 100 mm bar. Use E = 200000 MPa, A = 10 mm² and right-end force 1000 N. Approximate displacement between the two nodes by a straight line.

Shape functions blend the two nodal values into displacement at any location. Differentiating that line gives constant strain. Virtual work then turns distributed internal stress into nodal force equations. This example is exact because its true strain is constant, not because one element is always sufficient.

Connect the physical quantities

The strong form balances force at every point. Multiplying it by a virtual displacement and integrating moves a derivative from the unknown displacement to the test function. The boundary term then identifies the work of end traction. Shape functions turn this statement into equations for nodal values.

The relationship used in this example

uh=N1u1+N2u2u^h=N_1u_1+N_2u_2

FEM represents a displacement field using nodal unknowns and shape functions. The weak form enforces equilibrium through virtual work. For a 1D axial bar, integration by parts reduces the derivative order and introduces the end traction naturally. The virtual displacement is zero where displacement is prescribed.

Work through the example

Step 1

Use N1 = 1−x/L and N2 = x/L, so strain is (u2−u1)/L.

Step 2

With u1 = 0, solve (EA/L)u2 = 1000 N to get 0.05 mm.

Step 3

Recover ε = 0.05/100 = 0.0005 and σ = Eε = 100 MPa; Aσ = 1000 N.

Full example conditions and reference values

A 100 mm bar with E = 200,000 N/mm² and A = 10 mm² has EA/L = 20,000 N/mm. With its left end fixed and 1,000 N applied at the right end, u₂ = 0.05 mm and axial strain is 0.0005. A linear element reproduces this constant-strain solution exactly.

Compare the numbers before judging the result

Compare the calculated values
x (mm)N1N2u(x) (mm)
0100
250.750.250.0125
500.50.50.025
100010.05

The interpolation recovers both nodal values and a constant gradient 0.0005.

What the result means for a model

The exact recovery here relies on constant strain. Distributed axial loading produces a varying axial force, which one linear element cannot resolve internally. An accurate end displacement alone is therefore an incomplete verification target.

The weak form is not an empirical smoothing rule. It balances internal and external virtual work over the allowed test functions. Check an interior displacement and an element stress, not only the loaded-end displacement, when assessing the interpolation.

Another application: Why one linear element can be exact

With only an end force and constant EA, axial force and strain are constant; a linear displacement field can represent the exact solution. Add a uniform distributed axial load and force varies with position, so displacement becomes quadratic. The same element can no longer represent the whole exact field.

Further modeling details

Weak does not mean inaccurate

The continuous weak statement is not itself a coarse numerical approximation. Under the relevant regularity and boundary assumptions, a classical solution satisfies it; sufficiently regular weak solutions recover the corresponding differential equation. Approximation enters when we restrict trial and test functions to finite-dimensional spaces, approximate geometry or coefficients, or use inexact quadrature. Galerkin enforces residual orthogonality to the test space; it is not generally least-squares minimization of the pointwise residual.

Trial functions and virtual displacements have different boundary data

For a prescribed displacement u(0) = u0, trial fields must match u0 while virtual fields satisfy v(0) = 0. This remains true when u0 is nonzero. A convenient representation is u = g + w, where g matches the prescribed boundary values and w vanishes there. Natural boundary forces enter the work statement; reactions at displacement boundaries are recovered after the solve.

Keep area inside the axial-force balance

For an axial bar with variable area, use N = Aσ and −dN/dx = q, where q is force per length. If a body force density b is given per volume, q = Ab. Integration by parts must act on N = EA du/dx. Starting from σ′ + b = 0 and then inserting a variable A after differentiation omits an area-derivative term. The constant-area derivation is useful, but a taper needs the conservative axial-force form.

Why a continuous linear displacement can still have discontinuous strain

For this second-order bar problem, conforming piecewise-linear displacement is continuous between elements while its derivative can jump. The weak formulation admits that behavior with square-integrable first derivatives. Element strain is then piecewise constant. An exact nodal displacement at a few points does not guarantee an exact displacement or stress field between them.

Formula and symbol reference

Open the complete formula reference
−ddx(EAdudx)=q-\frac{\mathrm d}{\mathrm dx}\left(EA\frac{\mathrm du}{\mathrm dx}\right)=q
∫0LEAdvdxdudx dx=∫0Lvq dx+∑ivitˉi\begin{aligned}&\int_0^L EA\frac{\mathrm dv}{\mathrm dx}\frac{\mathrm du}{\mathrm dx}\,\mathrm dx\\&\quad=\int_0^L vq\,\mathrm dx+\sum_i v_i\bar t_i\end{aligned}
uh=N1u1+N2u2u^h=N_1u_1+N_2u_2
N1=1−xL,N2=xLN_1=1-\frac xL,\qquad N_2=\frac xL
B=[−1L1L]\mathbf B=\begin{bmatrix}-\frac1L&\frac1L\end{bmatrix}
ke=∫0LBTEAB dx\mathbf k_e=\int_0^L\mathbf B^\mathsf{T}EA\mathbf B\,\mathrm dx
ke=EAL[1−1−11]\mathbf k_e=\frac{EA}{L}\begin{bmatrix}1&-1\\-1&1\end{bmatrix}
SymbolMeaningUnit / convention
u, vAxial and virtual displacementmm
E, A, LModulus, area and element lengthN/mm²; mm²; mm
q, t̄ᵢDistributed axial load; signed outward end forceN/mm; N
Nᵢ, BShape functions; strain–displacement matrixdimensionless; 1/mm
kₑElement stiffness matrixN/mm

When this example stops applying

The example is linear, uniform and axial. Exactness for this field does not imply accuracy for bending or curved geometry. Shape functions, interpolation order and numerical integration must be consistent.

Check your interpretation

Why must the virtual displacement vanish at a prescribed-displacement boundary?

Show the reasoning

Admissible variations cannot change a displacement that is already fixed. The unknown support reaction is recovered after solving.

Lecture companions

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