Analysis of Smith-Purcell free-electron lasers.