Finite element analysis, chapter 1
The finite element method in one dimension
How a differential equation becomes a matrix equation, worked through on a bar you can check by hand. Every idea in this chapter carries over unchanged to 3D models.
1.1
What the method does
Most problems in structural mechanics, heat transfer and fluid flow are boundary value problems: a partial differential equation must hold everywhere inside a domain, and some conditions must hold on its boundary. For a prismatic beam or a thin-walled cylinder you can solve these on paper. For a bracket with a fillet, a boss and three bolt holes, you can’t.
The finite element method (FEM) gets around this in three moves:
- Approximate. Cut the domain into small, simple pieces (elements) and describe the unknown field on each piece with a low-order polynomial, defined by its values at a few points (nodes).
- Discretise. Instead of asking the differential equation to hold at every point, which a piecewise polynomial cannot do, ask it to hold on average (the weak form), weighted by a set of test functions. That turns the PDE into a linear system .
- Solve the linear system, then recover derived quantities such as strain and stress from .
The figure shows all three on a real part. Switch between geometry, mesh and stress. Using the method on real parts like this one is finite element analysis (FEA), and that is what this track teaches.
This chapter does all three for the simplest possible case: a straight bar under axial load. That is not a toy. Every idea you need for a 3D solid model (weak form, shape functions, element stiffness, assembly, supports, convergence) appears here unchanged. Going to 3D only adds bookkeeping.
1.2
A bar you can solve by hand
Take a straight bar of length , Young’s modulus and cross-section , fixed at . It carries a distributed axial load (force per unit length, say its own weight hanging vertically) and a point load at the free end.
Cut out a slice of length . Equilibrium of the normal force across it gives . Hooke’s law with the small-strain definition gives . Combine them:
with two boundary conditions of different character:
- prescribes the unknown itself. This is an essential (Dirichlet) condition: a support.
- prescribes its derivative, which here is a force. This is a natural (Neumann) condition: a load.
For constant and , integrate twice:
This is the strong form: it asks to be twice differentiable and the equation to hold at every point. Keep this solution in mind; we’ll measure the finite element answer against it.
1.3
Why the strong form is the wrong target
We want to approximate with something a computer can store: a finite list of numbers. The simplest continuous choice is a piecewise-linear function: split into elements of length and connect the values at the nodes with straight lines.
Now try to plug this into the strong form. Inside each element . At each node the slope jumps, so is not a function at all: it is a Dirac delta whose strength equals the jump. The differential equation can’t be satisfied, not even approximately, in any pointwise sense.
There are two ways out. Use smoother functions (cubic splines, for example), which is costly and awkward in 2D and 3D. Or rewrite the problem so that it needs only first derivatives. FEM takes the second route.
1.4
The weak form
Multiply the differential equation by an arbitrary test function and integrate over the bar. Then integrate the left-hand side by parts to move one derivative from onto :
Three things happened:
- Only first derivatives remain. Piecewise-linear functions now qualify: their first derivative is piecewise constant, and the integral of a product of piecewise constants is perfectly well defined.
- The natural condition appeared by itself. The boundary term from integration by parts is . At , , which is where the on the right comes from. Loads enter the weak form automatically. That is why they are called natural.
- The essential condition did not. We must build into the space of candidate functions and choose so the unknown reaction at the support drops out.
Mechanically, this is the principle of virtual work. Read as a virtual displacement compatible with the supports. The left side is the internal virtual work of the normal force; the right side is the virtual work of the applied loads. Equilibrium means the two match for every admissible . Equivalently, minimises the total potential energy
For a smooth the strong and weak forms are equivalent. The weak form simply admits a larger family of candidate solutions, and that larger family includes our piecewise polynomials.
1.5
Shape functions
The Galerkin method restricts both the solution and the test functions to the same finite-dimensional space. For linear elements the natural basis of that space is the set of hat functions, the shape functions :
Each equals 1 at node , 0 at all other nodes, and is linear in between. The coefficients are therefore not abstract weights: they are the nodal displacements, which is why FE output is “displacement at each node”.
Inside one element of length , with local coordinate , only two hats are non-zero:
Three properties carry over to every element type you’ll meet later:
- Interpolation: .
- Partition of unity: , so a rigid translation (all equal) is represented exactly and produces zero strain.
- Compact support: is non-zero only on the elements touching node . Two nodes interact only if they share an element. This is what makes the final matrix sparse.
1.6
Element stiffness
Substitute the expansion (1.5) into the weak form (1.3) and choose the test function to be each basis function in turn, . Every choice of gives one equation:
That is the linear system : one row per test function, one column per nodal unknown. Because each lives on only two elements, the integral splits into a sum of per-element integrals. On one element and , so
Two observations worth keeping:
- is the stiffness matrix of a spring with . Shorter elements are stiffer springs.
- is singular: . A free element can translate without resistance. Every element matrix in every FE code has a null space made of its rigid-body motions (one here, three in 2D, six in 3D).
The distributed load is split equally between the two nodes. This is the consistent load vector, and it is what you get from the integral, not a convenient guess.
1.7
Assembly and supports
The global matrix is the sum of the element matrices, each scattered into the rows and columns of its own nodes. This is the direct stiffness method, or assembly, and it fits in a few lines:
K = zeros((n_nodes, n_nodes))
f = zeros(n_nodes)
for (i, j) in elements: # node pair of each element
dofs = [i, j]
K[ix_(dofs, dofs)] += k_e # 2×2 element matrix
f[dofs] += f_e
The assembled is symmetric, banded (node only couples to ), and singular. The whole bar can still slide, so the supports have to go in before solving. The simplest way to impose is to delete row and column 1. What remains is symmetric positive definite and has a unique solution.
In a 3D solid model nothing changes except scale: three unknowns per node, a few hundred thousand to a few million rows, and a sparsity pattern set by the mesh connectivity. Sparse storage and sparse solvers are the only reason this is affordable.
1.8
Solve, then look at the error
Solve the 1D system and compare with the exact solution (1.2). Two results stand out.
The nodal displacements are exact, whatever the mesh. That is a special property of 1D problems with linear elements, and you should not expect it anywhere else. Between the nodes the straight lines miss the parabola by at most .
The normal force is worse. is constant inside each element, so it approximates a linear function with a staircase. Its error is : halve the elements and you only halve the error. The staircase is exact at element midpoints. These superconvergent points are why FE codes evaluate stresses at interior integration points and then extrapolate or average to the nodes.
The general version of this observation holds in every dimension. For smooth solutions and elements of polynomial degree :
Derived quantities converge one order slower than the primary unknown. In practice: a mesh that gives good displacements may still give poor stresses. Quadratic elements () buy one extra order for both.
1.9
The same recipe in two dimensions
In plane stress the unknown becomes a vector field and the bar’s single strain becomes three: . The recipe does not change:
- Interpolate each displacement component with shape functions on each element.
- Strains are derivatives of displacements, so with built from and .
- Stresses follow from the material law: .
- The element stiffness is the same weak-form integral in matrix dress:
- Assemble, apply supports, solve.
With the 3-node linear triangle, is constant, so each element carries a single, constant strain. In bending, strain varies linearly through the depth. A constant-strain element can only follow that variation if there are many of them through the thickness. With few, the elements resist bending in ways the real material doesn’t, and the model comes out too stiff. Try it in the figure: one triangle through the depth recovers less than a third of the true deflection.
This is the first lesson that has no 1D counterpart: element choice matters as much as element size. It is why commercial codes default to quadratic elements, and it gets its own rule in the field notes.
1.10
Summary and further reading
- A boundary value problem in strong form needs more smoothness than a piecewise polynomial has.
- The weak form (virtual work) needs only first derivatives. Loads enter it naturally; supports must be built into the trial space.
- Shape functions turn an unknown function into a finite vector of nodal values. Their compact support makes sparse.
- Each element contributes a small, singular stiffness matrix. Assembly sums them; supports remove the rigid-body null space.
- Displacements converge as , stresses as . Element type matters as much as element size.
Next chapter: how real elements are built on curved geometry with isoparametric mapping and numerical quadrature.
Books. T. J. R. Hughes, The Finite Element Method: Linear Static and Dynamic Finite Element Analysis (Dover), rigorous and cheap. J. Fish and T. Belytschko, A First Course in Finite Elements (Wiley), the gentlest complete introduction. O. C. Zienkiewicz, R. L. Taylor and J. Z. Zhu, The Finite Element Method: Its Basis and Fundamentals (Elsevier), the reference.
Lectures. K.-J. Bathe, MIT 2.092 Finite Element Analysis of Solids and Fluids, video lectures from one of the field’s founders.