A theoretical basis for the Harmonic Balance method