Dynamics of the pulsed free-electron laser