Relativistic Doppler Shift Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

Simulation summary will appear here.

From Sirens to Starlight

The Doppler effect alters the frequency of waves when the source moves relative to the observer. In acoustics the phenomenon is familiar: a passing siren drops in pitch as it speeds away. Light behaves similarly, yet at velocities approaching the speed of light classical formulas fail. This simulator couples the relativistic Doppler equations to an animated canvas. Each frame shows wavefronts emitted by a moving source and the arrival times at a stationary observer. By adjusting speed, direction, and time step, you can see wavelengths stretch or compress and measure numerical stability.

Variables and Assumptions

The source emits waves with rest wavelength λ₀. It moves with constant velocity v along a straight line toward or away from the observer located at the origin. The wavefronts travel at light speed c. We assume motion purely along the line of sight, neglecting transverse components. The simulation uses explicit Euler integration for the source motion and records each emitted wavefront with its launch time.

Core Equations

The relativistic Doppler shift for light is given by λ'=λ₀1±β1β where β=vc and the upper sign corresponds to receding motion. The canvas also computes the observed wavelength by measuring the time between successive wavefront arrivals at the observer. Comparing the measured value with the analytic formula exposes numerical error.

Numerical Scheme

Source position is updated with explicit Euler: x=x0+vΔt. Every T₀=λ₀c seconds a new wavefront is spawned. Its radius grows as r=c(t−temit). The simulation tracks arrival times at the observer, computes observed period T, then reports the observed wavelength λ=cT. Stability requires Δt to be much smaller than T₀; otherwise the wavefront emission timing suffers jitter.

Worked Example

Consider a spacecraft emitting green light with λ₀=500 nm and traveling toward Earth at v=0.3c. The analytic formula predicts λ'=λ₀\sqrt{\frac{1-β}{1+β}}, giving 366 nm. Running the simulation with Δt=0.016 s shows wavefronts bunching up ahead of the craft; measuring arrival times yields an observed wavelength around 365 nm, within 0.3% of theory. Downloading the CSV reveals the evolving position and wavelength for further analysis.

Comparison Table

Case v (m/s) λ′ receding (nm)
Baseline 100000 500.17
Half light speed 149896229 866.03
Approach 0.5c -149896229 288.68

How to Read the Animation

Circles represent expanding wavefronts. The source appears as a moving dot whose color shifts from blue (approaching) to red (receding). The observer sits at the canvas center. When a wavefront crosses the origin, a tick mark is recorded and the observed wavelength is updated. An energy bar visualizes the ratio between rest and observed photon energies via E1λ; green denotes initial energy and orange the shift.

Limitations

This simplified model ignores cosmological expansion, gravitational redshift, and transverse Doppler effects. The explicit Euler update is adequate for constant velocity but would require refinement for accelerating sources. For extremely large Δt the emission schedule becomes inaccurate and energy bars may drift.

Extensions

Future improvements could add accelerating motion, three-dimensional visualization, or phase-space plots of frequency versus time. Incorporating bandwidth and noise would bridge the gap between ideal wavefronts and real detectors.

References

Related calculators: relativistic kinetic energy, time dilation, wavelength-frequency converter.

Embed this calculator

Copy and paste the HTML below to add the Relativistic Doppler Shift Simulator to your website.