A numerical procedure has been developed for solving the two-dimensional problem of propagation of surface acoustic waves in piezoelectric materials in the presence of metal electrodes that excite mechanical vibrations (interdigital transducers). Three components of the mechanical displacement vector and an electric potential are taken as the independent variables. The problem is reduced to the system of differential equations, which can be solved using the Comsol Multiphysics software package (PDE modes). For the case of no metal electrodes, a comparison is made between the obtained data and the available analytical solutions. For lithium niobate, an excellent agreement has been observed between our results and the measurement data from the literature. It is shown that all three components of the mechanical displacement vector have to be taken into account, which excludes application of most FEM-based software packages designed to evaluate only the displacements in the wave propagation plane. The results can be useful for calculating a wide range of surface acoustic wave devices for mobile communications, and for navigation and medical equipment.