Optimal Design And Control Of Multibody Systems With Friction