Improvement in the calculation of electromagnetic force by the FEM