Theoretical description of the transfer of vibrations from a sample to the cantilever of an atomic force microscope