AbstractReal-world multibody systems do not have ideal joints; most joints have some clearance. The clearance allows the connected bodies to undergo a misalignment, and the resulting dynamics is governed by the contacts thus formed. Two approaches are typically taken to deal with contacts: the commonly used continuous dynamics approaches assume the Hertzian nature of the contact modeled by nonlinear unilateral spring-damper elements; while the nonsmooth dynamics approach results in a complementarity problem. This paper employs a nonsmooth dynamics approach to develop a coherent framework for the simulation of multibody systems having frictionless joints with clearances. Because clearances are of small magnitude relative to the dimensions of the mechanical components, the nature of the contact in the joints is assumed to be inelastic. Using this assumption and the general nonsmooth dynamics framework, the parametric formulations for cylindrical, prismatic, and revolute joints with clearances are derived. The equations of motion are formulated, and their time-discretized counterparts are cast as a nonlinear programming problem. The proposed scheme also enforces normalization constraint on Euler parameters in contrast to state-of-the-art methods that is conducive to stability of the solution for a suitable range of step sizes. In addition, a variable time-stepping scheme that includes the step size as an extra variable in the optimization is introduced and its stability properties are discussed. The versatility of the proposed framework is demonstrated through numerical experiments.