  By modifying and extending recent ideas [C. Seoanez et al., Europhys. Lett.
78, 60002 (2007)], a theoretical framework to describe dissipation processes in
the surfaces of vibrating micro- and nanoelectromechanical devices, thought to
be the main source of friction at low temperatures, is presented. Quality
factors as well as frequency shifts of flexural and torsional modes in doubly
clamped beams and cantilevers are given, showing the scaling with dimensions,
temperature, and other relevant parameters of these systems. Full agreement
with experimental observations is not obtained, leading to a discussion of
limitations and possible modifications of the scheme to reach a quantitative
fitting to experiments. For nanoelectromechanical systems covered with metallic
electrodes, the friction due to electrostatic interaction between the flowing
electrons and static charges in the device and substrate is also studied.
