A systematic method for the hybrid dynamic modeling of open kinematic chains confined in a closed environment