Trajectory of a Charged Particle in a Magnetic Field: ODE Formulation and Python-Based Numerical Simulation

Abstract-- Moving particles that have charge in a field is a basic idea in the study of electricity and magnetism. It also helps test how well computer programs can simulate situations. This paper looks at how a proton moves in a field that is the same everywhere. The way the proton moves is found using the Lorentz force law. The equations of motion are derived using the Lorentz force law and solved analytically. The proton moves in a circle when it is not moving in the direction of the magnetic field. At the same time, it moves straight in the direction of the field. The path it takes is like a spiral in three dimensions. A computer program made in Python is used to do the simulation. The program uses NumPy, Matplotlib and SciPy’s solve_ivp function with a method called DOP853. The proton starts with a velocity of 2.0×10⁵ m/s perpendicular to the field and 1.0×10⁵ m/s parallel to it. The magnetic field is 0.5 Tesla. The simulation runs five times the time it takes for the proton to go around in a circle. The program checks for errors by comparing the results with the math solution. The error is measured by how far the proton's position is from where it should be. Also, the difference in the energy the proton has is measured. The time it takes for the proton to go around in a circle is 1.31189-7 seconds. The radius of the circle the proton makes is 4.17587 -3 meters. The maximum position error is 1.89331 -12 meters, and the relative kinetic-energy deviation is 5.59434 -10. These numbers show that the computer simulation and the math solution match closely the choices made in the simulation

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-10-24
DOI
https://doi.org/10.5281/zenodo.23620496
Primary Topic
Numerical methods for differential equations
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Trajectory of a Charged Particle in a Magnetic Field: ODE Formulation and Python-Based Numerical Simulation

Shaurya Singh
Zenodo (CERN European Organization for Nuclear Research)
Numerical methods for differential equations
preprint

Trajectory of a Charged Particle in a Magnetic Field: ODE Formulation and Python-Based Numerical Simulation

Shaurya Singh
preprint en

Abstract

Abstract-- Moving particles that have charge in a field is a basic idea in the study of electricity and magnetism. It also helps test how well computer programs can simulate situations. This paper looks at how a proton moves in a field that is the same everywhere. The way the proton moves is found using the Lorentz force law. The equations of motion are derived using the Lorentz force law and solved analytically. The proton moves in a circle when it is not moving in the direction of the magnetic field. At the same time, it moves straight in the direction of the field. The path it takes is like a spiral in three dimensions. A computer program made in Python is used to do the simulation. The program uses NumPy, Matplotlib and SciPy’s solve_ivp function with a method called DOP853. The proton starts with a velocity of 2.0×10⁵ m/s perpendicular to the field and 1.0×10⁵ m/s parallel to it. The magnetic field is 0.5 Tesla. The simulation runs five times the time it takes for the proton to go around in a circle. The program checks for errors by comparing the results with the math solution. The error is measured by how far the proton's position is from where it should be. Also, the difference in the energy the proton has is measured. The time it takes for the proton to go around in a circle is 1.31189-7 seconds. The radius of the circle the proton makes is 4.17587 -3 meters. The maximum position error is 1.89331 -12 meters, and the relative kinetic-energy deviation is 5.59434 -10. These numbers show that the computer simulation and the math solution match closely the choices made in the simulation

Zenodo (CERN European Organization for Nuclear Research)
Numerical methods for differential equations
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
Trajectory of a Charged Particle in a Magnetic Field: ODE Formulation and Python-Based Numerical Simulation — Shaurya Singh · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS