Energy storage and dissipation in the magnetotail during substorms 1. Particle simulations