We propose a computational model for friction force microscopy (FFM) that concurrently couples motions of atoms on the surface and cantilever. When the tip of the cantilever slides on the plane of the surface, the sawtooth-like modulation of the cantilever appears as observed in the FFM experiment, in which a so-called “stick-slip” motion of the atoms generates thermal energy on the surface, but it is quickly dissipated through phonons. This leads to the energy dissipation in sliding friction. Our model enables us to obtain the details of atomic behavior on the surface as well as the modulation of the cantilever.