Numerical multibody system dynamics: Rigid and flexible systems