Structural optimization using the finite element method applied to a beam