8. Lorentz Force Simulator — Theory
A charged particle of charge \(q\) moving with velocity \(\mathbf{v}\) in uniform electric and magnetic fields
\(\mathbf{E}\) and \(\mathbf{B}\) experiences the Lorentz force:
\[
\mathbf{F}=q\left(\mathbf{E}+\mathbf{v}\times\mathbf{B}\right),
\qquad
m\frac{d\mathbf{v}}{dt}=q\left(\mathbf{E}+\mathbf{v}\times\mathbf{B}\right).
\]
Uniform magnetic field: circles and helices
If \(\mathbf{E}=0\) and \(\mathbf{B}\neq 0\), the magnetic force is always perpendicular to \(\mathbf{v}\),
so it changes the direction of the velocity but not its magnitude (speed is constant).
Decompose the initial velocity into components parallel and perpendicular to \(\mathbf{B}\):
\[
\mathbf{v}_0=\mathbf{v}_{\perp}+\mathbf{v}_{\parallel},
\qquad
\mathbf{v}_{\parallel}=(\mathbf{v}_0\cdot \hat{\mathbf{b}})\hat{\mathbf{b}},
\qquad
\hat{\mathbf{b}}=\frac{\mathbf{B}}{|\mathbf{B}|}.
\]
-
If \(v_{\perp}\neq 0\), the particle executes circular motion in the plane perpendicular to \(\mathbf{B}\).
-
If \(v_{\parallel}\neq 0\) as well, the motion becomes a helix (spiral) along \(\mathbf{B}\).
The characteristic angular frequency is the cyclotron frequency:
\[
\omega_c=\frac{|q|\,|\mathbf{B}|}{m},
\qquad
f=\frac{\omega_c}{2\pi},
\qquad
T=\frac{2\pi}{\omega_c}.
\]
The radius of the circular part (the gyroradius) depends on the perpendicular speed \(v_{\perp}\):
\[
r_g=\frac{m v_{\perp}}{|q|\,|\mathbf{B}|}.
\]
Crossed fields: \(\mathbf{E}\times\mathbf{B}\) drift
When \(\mathbf{E}\perp \mathbf{B}\) and both are uniform, the guiding center of the particle drifts at
a velocity that is independent of charge sign and mass:
\[
\mathbf{v}_d=\frac{\mathbf{E}\times\mathbf{B}}{|\mathbf{B}|^2}.
\]
Superimposed on this drift, the particle still gyrates around the magnetic field lines.
Numerical method used: Boris pusher
This simulator uses the Boris algorithm, a standard time-stepping method for charged particle
motion in electromagnetic fields. It is widely used in plasma/beam simulations because it is stable for
magnetic gyration (it handles \(\mathbf{v}\times\mathbf{B}\) rotations well).
\[
\mathbf{v}^{-}=\mathbf{v}+\frac{q\mathbf{E}}{m}\frac{\Delta t}{2},\quad
\mathbf{t}=\frac{q\mathbf{B}}{m}\frac{\Delta t}{2},\quad
\mathbf{s}=\frac{2\mathbf{t}}{1+t^2},\quad
\mathbf{v}^{+}=\mathbf{v}^{-}+(\mathbf{v}^{-}+\mathbf{v}^{-}\times\mathbf{t})\times\mathbf{s},
\]
\[
\mathbf{v}_{n+1}=\mathbf{v}^{+}+\frac{q\mathbf{E}}{m}\frac{\Delta t}{2},\qquad
\mathbf{r}_{n+1}=\mathbf{r}_n+\mathbf{v}_{n+1}\Delta t.
\]
How to use the simulator
-
Set \(\mathbf{B}\) along \(+z\) and choose \(v_x\neq 0\), \(v_y=v_z=0\) to see a circle in the \(x\)-\(y\) plane.
-
Add \(v_z\neq 0\) to see a helix.
-
Add a perpendicular \(\mathbf{E}\) (for example \(E_x\neq 0\), \(B_z\neq 0\)) to see \(\mathbf{E}\times\mathbf{B}\) drift.
-
Use smaller \(\Delta t\) if the trajectory looks “polygonal” or if you want higher accuracy.
Website tip: Try a “bubble chamber” style example (uniform \(\mathbf{B}\), small \(\mathbf{E}\)) and rotate the view to emphasize the helix.