Title: An optimization approach to closed loop problems in biomechanics