Charged Particle Dynamics in Magnetic Fields and Applications