Automatic averaging in the vibrational control of nonlinear systems