MTH 492 · Numerical Methods
Our notes
2 min readThe idea
Instead of approximating derivatives at points (finite differences), the finite element method (FEM) approximates the solution by simple pieces (elements) joined at nodes, chosen to make the error as small as possible in an average sense. It handles irregular shapes, varied materials and mixed boundary conditions well: the method behind structural, thermal and fluid software.
Step 1: the weak form
For −u″ = f on (0, 1), u(0) = u(1) = 0, multiply by a test function v (with v(0) = v(1) = 0) and integrate by parts:
∫₀¹ u′v′ dx = ∫₀¹ f v dx for all admissible v.
Only first derivatives remain: rougher (piecewise) functions are allowed.
Step 2: linear elements
Divide [0, 1] into elements of length h with nodes xᵢ. Use hat functions φᵢ: 1 at node i, 0 at the other nodes, linear in between. Approximate u ≈ Σ Uᵢφᵢ.
Step 3: Galerkin's choice
Take v = each φⱼ in turn. This gives KU = F:
- Stiffness matrix: Kⱼᵢ = ∫ φⱼ′φᵢ′ dx. For equal linear elements: K = (1/h) × tridiag(−1, 2, −1).
- Load vector: Fⱼ = ∫ f φⱼ dx. For f = 1: Fⱼ = h.
Element by element (assembly)
Each element contributes a 2 × 2 element stiffness matrix (1/h)[1 −1; −1 1]. Adding these into the global matrix at the right rows and columns gives K. This assembly is the same in 2D and 3D, which is why FEM programs are general.
Worked example
−u″ = 1, u(0) = u(1) = 0, four elements (h = 0.25). Exact u = x(1 − x)/2.
- K = 4 × [2 −1 0; −1 2 −1; 0 −1 2], F = (0.25, 0.25, 0.25)
- Equations: 8U₁ − 4U₂ = 0.25; −4U₁ + 8U₂ − 4U₃ = 0.25; −4U₂ + 8U₃ = 0.25
- By symmetry U₁ = U₃: 8U₁ − 4U₂ = 0.25 and −8U₁ + 8U₂ = 0.25. Adding twice the first to the second: 8U₁ = 0.75, U₁ = 0.09375, U₂ = 0.125.
| x | FEM | Exact |
|---|---|---|
| 0.25 | 0.09375 | 0.09375 |
| 0.5 | 0.125 | 0.125 |
In this 1D problem linear elements are exact at the nodes (between nodes the FEM solution is straight while the true one curves).
FEM against finite differences
| Finite differences | Finite elements | |
|---|---|---|
| Approximates | derivatives at points | the solution over elements |
| Geometry | easiest on rectangles | any shape (triangles, tetrahedra) |
| Boundary conditions | derivative ones need care | natural ones built in |
| Theory | Taylor series | energy and variational principles |
Exams usually ask
- Derive the weak form and the stiffness matrix for linear elements.
- Solve a small 1D problem with 2 to 4 elements.
Common mistake
Forgetting the 1/h factor in the stiffness matrix, which scales every answer wrongly.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Finite element method
(opens en.wikipedia.org in a new tab)
Wikipedia, Finite element method, CC BY-SA 4.0 · licence
Watch
-
Best pick Understanding the Finite Element Method
19 min · ≈ 86 MB · about ₦48
(opens youtube.com in a new tab)
-
Introduction to Finite Element Method (FEM) for Beginners
12 min · ≈ 54 MB · about ₦30
(opens youtube.com in a new tab)
-
Solved Example | Finite Element Method | Part#1
8 min · ≈ 36 MB · about ₦20
(opens youtube.com in a new tab)
-
Finite Element Analysis Procedure (Part 1) updated..
10 min · ≈ 45 MB · about ₦25
(opens youtube.com in a new tab)
-
Module 12 Lecture 1 Finite Element Method
50 min · ≈ 225 MB · about ₦126
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.