Adhesion and plasticity in the dynamic response of rough surfaces in contact