Free electron laser dynamics, evolution of the bunching coefficients, and coherent harmonic generation