Statistics for Charged Particle Optics Simulations and Optimizations for Miniature Mass and Energy Spectrometers