Motion of a Charged Particle in a Magnetic Field

Developed by J. D. McDonnell

In this set of exercises, the student will write code to calculate and visualize the trajectories of charged particles under the influence of both uniform and interesting non-uniform magnetic fields, including the earth’s magnetic field.

Subject Area Electricity & Magnetism
Level Beyond the First Year
Available Implementation IPython/Jupyter Notebook
Learning Objectives

Students who complete this set of exercises will

  • develop their understanding of how charged particles respond to magnetic fields (Exercises 1, 2, and 3);
  • be able to describe in pseudo-code how to calculate the trajectory of a charged particle in a magnetic field (Exercise 1);
  • be able to use numerical methods for ordinary differential equations to calculate the particle’s trajectory (Exercises 1, 2, and 3);
  • be able to interpret and describe the computed trajectories (Exercises 1, 2, and 3);
  • and be able to validate numerical solutions against analytical solutions for appropriate test cases (Exercise 1).
Time to Complete 120 min