Longitudinal space-charge effects in a retarding field energy analyzer