An efficient approach to dynamics and control of flexible multibody systems