Equilibrium of bodies on rough surfaces