Storage-ring free-electron-laser dynamics and head-tail instability