A pragmatic introduction to the finite element method for thermal and stress analysis. With the MATLAB toolkit SOFEA. This textbook provides an accessible and self-contained description of the Galerkin finite element method for the two important models of continuum mechanics, transient heat conduction and elastodynamics, from formulation of the governing equations to implementation in Matlab. The coverage follows an intuitive approach: the salient features of each initial boundary value problem are reviewed, including a thorough description of the boundary conditions; the method of weighted residuals is applied to derive the discrete equations; and clear examples are introduced to illustrate the method.