Dynamics of Mechanical Systems with Variable Mass