Mathematical modelling of a beam using finite element method