Mechanics and dynamics of drilling