All courses › Finite Element Method
Finite Element Method (FEM): free practice, theory and problems
The finite element method (FEM) solves complicated structural problems by dividing a structure into many small, simple elements for which the relationship between forces and displacements is known exactly. The bar element (1D, axial) is the simplest element and shows the core idea: each element has a stiffness matrix that relates nodal displacements to nodal forces, and these are assembled into a global system of equations for the whole structure.
Contents
1. Bar elements and stiffness matrices
What is it about?
The finite element method (FEM) solves complicated structural problems by dividing a structure into many small, simple elements for which the relationship between forces and displacements is known exactly. The bar element (1D, axial) is the simplest element and shows the core idea: each element has a stiffness matrix that relates nodal displacements to nodal forces, and these are assembled into a global system of equations for the whole structure.
Concepts and formulas
- The stiffness matrix of a bar element: k^{(e)} = \frac{EA}{L}\begin{pmatrix}1&-1\\-1&1\end{pmatrix} where is the elastic modulus, the cross-sectional area and the element length.
- The element equation: , where are the nodal displacements and the nodal forces.
- Global assembly: the element matrices are inserted into a global matrix according to the global degrees of freedom (DOFs) of their nodes. Nodes shared by several elements receive contributions from all of them.
- The global system is singular (not invertible) before boundary conditions are applied, because otherwise the structure could move freely as a rigid body.
- Boundary conditions (e.g. a fixed node, ) are removed from the system before solving for the unknown displacements; the reaction forces at the fixed nodes can then be computed afterward.
- The stiffness matrix is symmetric (Maxwell–Betti reciprocity theorem) and usually sparse, because each node is only connected to its nearest neighbours.
- The stress in an element is computed afterward from the displacements: .
How to solve the problems
- Set up the stiffness (or the given spring stiffness ) for each element.
- Assemble: insert the element contributions into the correct rows/columns of the global matrix according to the node numbers.
- Apply the boundary conditions (remove rows/columns for fixed degrees of freedom, or set them to a known value).
- Solve for the unknown displacements.
- Compute stress/strain and, if needed, reaction forces from the displacements.
Example
Two bar elements in series: element 1 has N/mm, element 2 has N/mm. Node 1 is fixed, and a force of 600 N acts at node 3 (the free end). Find .
- The degree of freedom at node 1 is removed ().
- The force at node 3 is transmitted through both elements in series, so the displacements add: .
- mm.
Common mistakes
- Forgetting to remove the boundary conditions before solving the system (the matrix is then singular and cannot be inverted).
- Adding element contributions to the wrong place during assembly – always check the node numbers.
- Mixing units, e.g. GPa and mm² without converting to N/mm² (MPa).
- Assuming a stiffer element (higher ) means more displacement – it is the opposite.
Concepts in this part
2. Weak form and shape functions
What is it about?
To apply the finite element method to problems governed by differential equations (e.g. axial elasticity or heat conduction), we recast the "strong form" (the differential equation itself, which requires the solution to be smooth enough to differentiate twice) into a "weak form" by multiplying by a test function and integrating by parts. This lowers the smoothness requirement and is exactly what makes it possible to use simple, piecewise-linear shape functions within each element.
Concepts and formulas
- Shape functions interpolate the solution inside the element from the nodal values: . For a linear element on : , .
- The shape functions satisfy the Kronecker delta property (1 at their own node, 0 at the others) and form a partition of unity ( everywhere), so the element can reproduce a constant (rigid-body) displacement exactly.
- Galerkin's method chooses the test functions from the same space as the shape functions – standard FEM is therefore Bubnov–Galerkin.
- Essential (Dirichlet) boundary conditions are imposed directly on the unknowns (e.g. ); natural (Neumann) boundary conditions (force, flux) enter automatically through the boundary term produced by integration by parts.
- Isoparametric elements use the same shape functions to describe both geometry and displacement. The mapping from a reference element (e.g. ) to the physical element is governed by the Jacobian , which scales integrals between the two.
- Gauss quadrature evaluates integrals numerically with only a few points: points integrate polynomials exactly up to degree . 2-point Gauss (at , weight 1 each) is therefore exact up to and including degree 3.
How to solve the problems
- Identify whether you need to interpolate a value (), evaluate a shape function at a point, or integrate numerically.
- For interpolation: find the correct (normalized position) and substitute into .
- For Gauss quadrature: substitute the quadrature points into the integrand, multiply by the weights and sum.
- Remember the Jacobian when switching from physical coordinates to reference coordinates in an integral.
Example
Use 2-point Gauss quadrature (, weight 1 each) to evaluate .
- , and is the same since is unchanged.
- The sum: .
- Check: the exact value is – since the integrand has degree 2 (), 2-point Gauss is exact.
Common mistakes
- Mixing up the conventions (shape functions) and (Gauss quadrature) – always check which interval the problem uses.
- Assuming more Gauss points always give a "more correct" answer than needed – for a low-degree polynomial, few points are exact.
- Forgetting the Jacobian when integrating over the reference element.
- Assuming natural and essential boundary conditions are treated the same way in the weak form.
Concepts in this part
3. Element types, meshing and error
What is it about?
Choosing the right element type and building a good mesh (network of elements) is crucial for whether an FEM analysis gives an accurate and trustworthy answer. This unit covers what element types exist, how a mesh is refined, what sources of error exist, and how to check that a model is correct.
Concepts and formulas
- Element types: CST (constant strain triangle, linear triangle) gives constant strain/stress throughout the element and needs a fine mesh where the stress varies a lot. Quadratic elements (e.g. LST) give better accuracy per element. Elements have different numbers of degrees of freedom per node depending on type (e.g. 2 for a 2D bar, 3 for a 2D beam, 6 for a 3D beam).
- h-refinement: makes the elements smaller (more elements). p-refinement: increases the polynomial degree of the shape functions in the existing elements. Both give convergence toward the exact solution.
- Displacements are continuous between elements in standard displacement-based FEM, but stresses are not – they often jump slightly between elements and are smoothed in post-processing.
- The displacement error typically decreases as as the element size shrinks, for elements of polynomial degree . Halving makes the error times smaller.
- Shear locking: linear elements can become artificially stiff in bending. This is solved with quadratic elements or reduced integration.
- At sharp interior corners, the stress is theoretically infinite (a singularity); the stress in the model then just keeps growing as the mesh is refined, instead of converging. The fix is to model a real fillet radius.
- A mesh convergence study refines the mesh step by step and checks whether a quantity of interest (e.g. maximum stress) stops changing significantly – that is how you know the mesh is fine enough.
How to solve the problems
- Identify which error source or element property the question concerns: element type, refinement, continuity, or singularity.
- For DOF counting: multiply the number of nodes by the degrees of freedom per node for the element type.
- For convergence: use to compute how much smaller the error becomes when changes.
- Remember that the mesh should be finest where the stress gradients are largest, not spread evenly everywhere.
Example
A model with 3D beam elements (6 degrees of freedom per node) has 25 nodes. The displacement error scales as (linear elements, ). How many degrees of freedom does the model have, and by what factor does the error shrink if is divided by 2?
- Degrees of freedom: .
- Error factor: times smaller error.
Common mistakes
- Assuming stresses are continuous between elements the way displacements are.
- Assuming a finer mesh always helps at a sharp corner – there the stress is singular and never "converges" in the model.
- Forgetting to multiply by the degrees of freedom per node when counting DOFs.
- Confusing h- and p-refinement.
Concepts in this part
Example problems with solutions
Here are some of the problems in finite Element Method. In the app, calculation problems get new numbers every time, so you can practise until it sticks – and take a graded practice exam before the real one.
Bar elements and stiffness matrices: What is the stiffness matrix of a linear bar element (1D)?
Answer:
It is symmetric, and singular for a single element on its own.
Weak form and shape functions: What do you gain by rewriting to the weak form?
Answer: Lower differentiability requirements: one derivative is moved onto the test function
You integrate by parts.
Element types, meshing and error: What characterizes a CST element (linear triangle)?
Answer: Constant strain and stress in the whole element
It needs a fine mesh where stress gradients are large.
Bar elements and stiffness matrices: Why is the global stiffness matrix singular before the boundary conditions are applied?
Answer: The structure can move as a rigid body
Enough degrees of freedom must be locked to prevent rigid-body motion.
Matches these university courses
The content covers the syllabus found in engineering degrees, for example:
- TMM4135 (NTNU)
- TBM350 (NMBU)