Finite element analysis of beams