Lorentz Force Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

Enter values and press Play.
Simulation summary will appear here.

Field Line Flyer Mini-Game

Time electric pulses so the particle hugs the glowing ring. Feel how F = q(E + v × B) sets orbit radius while gusty magnetic drift and flux pickups keep every run fresh.

Pulse E-field to lock the orbit

Click to Play. Tap right to accelerate, left to brake, and ride the band for maximum dwell.

F = q(E + v × B)

Best run: 0.0

1. Real‑world phenomenon

Charged particles rarely travel in straight lines. Inside cathode‑ray tubes, electrons arc toward phosphor screens; in space, solar wind ions spiral along Earth’s magnetic field; in mass spectrometers, molecular fragments curve under carefully tuned fields. These trajectories are all governed by the Lorentz force, the vector sum of electric and magnetic influences acting on moving charge. Traditional calculators output a single force magnitude, yet they fail to convey the resulting motion. The simulator above retains the original goal of computing Lorentz force but augments it with an animated particle whose path is updated in real time. As you tweak charge, mass, field strengths, or time step, the dot on the canvas swirls according to the same physics that steer beams in particle accelerators. Energy bars reveal how electric fields do work while magnetic fields redirect without changing speed. A downloadable CSV captures every time step for further analysis, transforming a static equation into a tangible experiment.

2. Variables and assumptions

The model considers a point particle of charge q and mass m moving in the (x,y) plane. Uniform electric fields Ex,Ey lie in the same plane, while a constant magnetic field Bz points perpendicular to it. Initial velocity components vx0,vy0 set the starting direction. We assume the fields are uniform over the particle’s path, ignore radiation losses, and restrict speeds well below the speed of light so relativistic effects remain negligible. Potential energy is referenced to x=y=0; with uniform fields this origin choice merely sets a constant offset. All quantities use SI units: coulombs, kilograms, volts per meter, teslas, meters, and seconds. Input validation rejects non‑finite or nonsensical values such as negative mass. The time step Δt is clamped to the range 0.0001–0.05 s to maintain numerical stability and reasonable performance.

3. Governing equations

The Lorentz force in vector form is

F=qE+v×B

For our two‑dimensional motion with Bz only, the force components reduce to

d v_xdt=qm(E_x+v_yB_z), d v_ydt=qm(E_y-v_xB_z)

Position evolves via d xdt=v_x and d ydt=v_y. Kinetic energy is KE=12m(v_x2+v_y2). Electric potential energy in uniform fields is PE=-q(E_xx+E_yy). Magnetic forces do no work, so total energy TE=KE+PE should remain constant; deviations ΔE=TE-TE0 signal numerical error.

4. Numerical scheme

The coupled first‑order system is integrated using the classical fourth‑order Runge–Kutta (RK4) method. For each step of size Δt, four derivative estimates k_1k_4 sample the acceleration at the current state, two half steps, and a trial endpoint. The weighted average s(t+Δt)=s(t)+Δt6(k_1+2k_2+2k_3+k_4) advances both position and velocity. RK4’s global error scales with Δt4, so halving the step shrinks drift by roughly a factor of sixteen. The algorithm is explicit and thus stable provided Δt is short compared with the fastest gyration period 2πm/(|q|B_z). The simulation reports the energy deviation each frame, giving a direct measure of integration accuracy and serving as an educational tool for numerical analysis.

5. Worked example

Consider a singly charged dust grain with q=1×10−⁶ C and m=1×10−³ kg injected into a region where E_x=0, E_y=0, and B_z=0.1 T. The particle enters with v_x=10 m/s and v_y=0. With no electric field, the motion should be a circle of radius r=m v/(|q|B)=0.1 m and period 2πm/(|q|B)=0.0628 s. Enter these values and press Play: the dot loops smoothly, energy bars remain constant, and the CSV shows periodic position data. If we introduce an electric field E_y=50 V/m, the path becomes a cycloid drifting in +y, illustrating the E×B drift exploited in plasma devices. Energy stays constant because the electric field does work while the magnetic field merely redirects.

6. Comparison table

The table summarizes how changing field strengths alters motion, based on simulation output after one gyration.

Scenario E_y (V/m) B_z (T) Radius (m) Drift Speed (m/s)
Baseline 0 0.10 0.10 0.00
Electric field 50 0.10 0.10 500
Stronger B 50 0.20 0.05 250

A doubled magnetic field halves the gyroradius and, combined with the same electric field, halves the drift speed, reinforcing the inverse relationship between B and both quantities.

7. How to read the animation

The canvas displays a top‑down view with the origin centered. A blue trail traces the particle’s past path, while an orange disk marks its current position. Because the canvas is square and auto‑scales to the largest excursion, circular or helical orbits remain centered regardless of parameters. The striped orange bar indicates kinetic energy; the striped blue bar shows the magnitude of electric potential energy. Their combined length corresponds to the initial total energy, so any shrinkage or growth signals numerical drift. The caption beneath the canvas narrates time, position, speed, and energy deviation for screen‑reader users, and an identical text summary is mirrored in the hidden fallback div. Keyboard users can tab to the canvas and press the space bar to toggle play and pause. Tooltips on inputs remind you of SI units, ensuring the simulation remains grounded in real measurements.

8. Limitations

The simulator assumes uniform, time‑independent fields and neglects radiation reaction, space charge effects, collisions, and relativistic corrections. At speeds approaching light, mass increases with the Lorentz factor and the equations of motion change. Extremely strong electric fields may accelerate the particle beyond non‑relativistic limits within a few steps, invalidating the model. The visualization is confined to two dimensions; a true three‑dimensional treatment would show helices when the velocity has a component parallel to the magnetic field. Numerical integration, while robust, still accumulates error for large Δt or extreme field values, so the energy drift readout should always be monitored. Finally, the potential energy definition assumes the electric field remains constant over the simulation range, which may not hold in laboratory devices with electrodes.

9. Suggested extensions

Future versions could include three‑dimensional motion, relativistic momentum, or spatially varying fields computed from analytic expressions. Incorporating collisions with background gas would model plasma diffusion, while an adaptive time step could maintain accuracy during periods of strong acceleration. Phase‑space plots of velocity versus position would reveal conserved quantities and resonance structures. Another extension would let users superimpose multiple particles to visualize beams and collective effects.

10. References and related tools

For background reading on electromagnetic motion, consult J. D. Jackson’s Classical Electrodynamics or D. J. Griffiths’ Introduction to Electrodynamics. The equations for charged particle drifts are summarized in many plasma physics texts, including F. F. Chen’s Introduction to Plasma Physics and Controlled Fusion. Explore related calculators on this site: estimate relativistic effects with the Lorentz Factor Calculator, compute cyclotron periods using the Cyclotron Frequency Calculator, or visualize static fields with the Point Charge Electric Field Simulator.

Embed this calculator

Copy and paste the HTML below to add the Lorentz Force Particle Simulator to your website.