Analytical and numerical computation of multipole components of magnetic deflector