Animate the trajectory of electrons, protons, and arbitrary charged particles in magnetic and electric fields in real time. Automatically calculate Lorentz force, cyclotron radius, and cyclotron frequency.
Parameters
Particle type
Charge q
×1.6×10⁻¹⁹ C
Mass m
x reference mass m0, log scale
Initial velocity vx
Initial velocity vy
magnetic field B
⊙ out of page / ⊗ into page (B > 0 / B < 0)
Electric field Ex
Electric field Ey
Playback Controls
t = 0.00 s
Drag the particle on the canvas to change its initial position
Results
—
Lorentz force F [N]
—
Gyroradius r [m]
—
Cyclotron Frequency fc
—
period T [s]
Visualization
Theory & Key Formulas
Lorentz force:
$$\vec{F}= q(\vec{E}+ \vec{v}\times \vec{B})$$
Gyroradius in a pure magnetic field: $r = \dfrac{mv}{|q|B}$
What exactly is the Lorentz force? I see it's the core of this simulator.
🎓
Basically, it's the total electromagnetic force on a charged particle. It has two parts: the electric force ($q\vec{E}$) and the magnetic force ($q\vec{v}\times \vec{B}$). In practice, the magnetic part is special because it's always perpendicular to the particle's velocity, so it can't speed it up or slow it down, only change its direction. Try setting the electric fields (Ex, Ey) to zero and giving the particle some initial velocity (vx, vy) in a magnetic field (B). You'll see it starts turning immediately.
🙋
Wait, really? So if the magnetic force can't change the speed, does that mean the particle just goes in a perfect circle forever?
🎓
In a perfectly uniform magnetic field with no electric field, yes! That's called cyclotron motion. The simulator calculates the radius of that circle for you. For instance, a fast-moving electron (high vx, vy) in a weak magnetic field (low B) will have a huge orbit. Try it: select "Electron" and crank up the initial speed while lowering the B-field slider. Watch the orbit radius grow on the plot.
🙋
That makes sense. But what happens when you turn the electric field back on? The path looks way more complicated.
🎓
Great observation! Now the electric force can change the particle's speed and energy. The resulting motion is a combination of a circular gyration and a steady drift perpendicular to both fields. This is called E×B drift. A common case is setting Ex=1 and B=1. The particle will slowly drift in the y-direction while gyrating. Change the particle type from an electron to a proton and see how the drift direction reverses because the charge $q$ changed sign!
Physical Model & Key Equations
The fundamental law of motion is Newton's second law with the Lorentz force as the driving mechanism. This gives us the equation of motion for the charged particle.
Here, $m$ is particle mass (kg), $q$ is electric charge (C), $\vec{v}$ is velocity (m/s), $\vec{E}$ is the electric field (V/m), and $\vec{B}$ is the magnetic flux density (T). The cross product $\vec{v}\times \vec{B}$ ensures the magnetic force is perpendicular to the plane containing $\vec{v}$ and $\vec{B}$.
For the special case of a uniform magnetic field ($\vec{B}=B\hat{z}$) and no electric field ($\vec{E}=0$), the motion is purely circular in the plane perpendicular to $\vec{B}$. Two key quantities define this motion:
$r_c$ is the cyclotron (or Larmor) radius – the radius of the circular orbit. $v_\perp$ is the speed component perpendicular to $\vec{B}$. $\omega_c$ is the cyclotron angular frequency (rad/s). The rotation period is $T = 2\pi / \omega_c$. Notice how a heavier particle (like a proton) has a larger radius and slower frequency than a light electron in the same field, which you can test directly with the "Particle Type" dropdown.
Frequently Asked Questions
Yes, it is possible. By selecting the 'Arbitrary Charged Particle' mode, you can freely set the mass, charge, and initial velocity. This allows you to simulate the trajectory of any charged particle, such as an alpha particle or muon.
Yes, you can adjust the magnetic flux density and each component of the electric field vector in real time using sliders or numerical input. Changes are immediately reflected in the trajectory calculation and animation, allowing you to intuitively observe the differences in particle motion due to parameter changes.
These values are theoretical values under the conditions where the electric field is zero, the magnetic field is uniform, and the velocity is perpendicular to the magnetic field. If an electric field is present or if there is a velocity component parallel to the magnetic field, the trajectory becomes more complex, such as a helical motion, so please use these as reference values.
The current version operates with a fixed time step, but computational stability is guaranteed. If high accuracy is required, more precise trajectories can be obtained by not setting the velocity or magnetic field values too high (e.g., magnetic flux density below 1 T, velocity below 1e7 m/s).
Real-World Applications
Cyclotron & Synchrotron Design: These particle accelerators use a constant magnetic field to bend charged particles into circular paths while an oscillating electric field accelerates them at just the right frequency ($\omega_c$). Engineers use these exact equations to design the magnet size and RF frequency. The simulator's frequency calculation shows why heavier particles require lower frequency accelerators.
Magnetic Resonance Imaging (MRI): The core principle involves the precession (a form of gyration) of proton spins in a massive static magnetic field. The resonant frequency at which these spins absorb energy is directly proportional to the field strength ($\omega \propto B$), just like the cyclotron frequency. Adjusting the B-field slider changes the calculated frequency, mimicking how different MRI machines operate.
Plasma Confinement in Fusion Devices: To contain a 100-million-degree plasma, powerful magnetic fields are used. The charged particles in the plasma gyrate around magnetic field lines. The E×B drift phenomenon you can create in the simulator is critical for analyzing and controlling plasma stability in devices like tokamaks, as unwanted drifts can lead to energy loss.
Mass Spectrometry: In a magnetic sector mass spectrometer, ions are sent into a known magnetic field. Heavier ions (larger $m$) bend with a larger radius ($r_c \propto m$), while lighter ions bend more sharply. By measuring the radius of curvature, the mass-to-charge ratio ($m/q$) of an unknown ion can be determined. Try varying the mass and charge sliders independently to see how the orbit radius changes.
Common Misconceptions and Points to Note
First, let's establish the point that "magnetic fields do no work." You can confirm this in the simulator by observing that a particle's speed doesn't change when only a magnetic field is applied. The Lorentz force $q \vec{v} \times \vec{B}$ is always perpendicular to velocity, so it does not increase or decrease the particle's kinetic energy. Only the work done by the electric field can change the energy. In practice, attempting to accelerate a particle using only a magnetic field is a fundamental error.
Next, pay attention to the relationship between the initial velocity direction and the magnetic field direction. The velocity component parallel to the magnetic field $v_{\parallel}$ is not bent at all, causing the particle to undergo helical motion. If you enter a value for "initial velocity vz" in the simulator, you'll see it moving in the Z-direction while performing circular motion. The pitch of this helix is determined by $v_{\parallel}$, so setting the initial conditions correctly is crucial for accurately guiding a particle beam.
Finally, beware of confusion between unit systems. The tesla (T) unit for magnetic field is particularly unintuitive and a common source of mistakes. For example, 0.01 T is about twice the Earth's magnetic field, 0.1–0.5 T is typical at the surface of a common permanent magnet, and MRI machines use 1.5 T or 3 T. In the simulator, setting "proton, velocity 1e6 m/s, magnetic field 1 T" yields a gyroradius of about 10 mm. Misreading this as "1 m" would severely throw off your design. Make it a habit to always check the order of magnitude.