viewof relativity_velocity = Inputs.range([1000, 8000], {
value: 3874,
step: 10,
label: "Satellite Velocity (m/s)"
})
viewof relativity_altitude = Inputs.range([10000, 30000], {
value: 20200,
step: 100,
label: "Orbit Altitude (km)"
})
// Constants
c_light = 299792458 // m/s
GM_earth = 3.986e14 // m³/s²
r_surface = 6.37e6 // meters
seconds_per_day = 86400
// Special relativity (time dilation from velocity)
v_squared_over_2c_squared = (relativity_velocity * relativity_velocity) / (2 * c_light * c_light)
special_relativity_us_per_day = v_squared_over_2c_squared * seconds_per_day * 1e6
// General relativity (gravitational time dilation)
r_orbit = (relativity_altitude * 1000) + r_surface
delta_t_over_t = (GM_earth / (c_light * c_light)) * ((1 / r_surface) - (1 / r_orbit))
general_relativity_us_per_day = delta_t_over_t * seconds_per_day * 1e6
// Net effect
net_effect_us_per_day = general_relativity_us_per_day - special_relativity_us_per_day
// Position error per day if uncorrected
position_error_per_day = (net_effect_us_per_day * 1e-6) * c_light
html`<div style="padding: 16px; background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 4px; margin: 12px 0;">
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;">
<div style="padding: 8px; background: #e3f2fd; border-radius: 4px;">
<div style="color: #2C3E50; font-size: 0.9em;">Special Relativity (slower)</div>
<div style="color: #3498DB; font-size: 1.1em; font-weight: bold;">-${special_relativity_us_per_day.toFixed(1)} μs/day</div>
</div>
<div style="padding: 8px; background: #f3e5f5; border-radius: 4px;">
<div style="color: #2C3E50; font-size: 0.9em;">General Relativity (faster)</div>
<div style="color: #9B59B6; font-size: 1.1em; font-weight: bold;">+${general_relativity_us_per_day.toFixed(1)} μs/day</div>
</div>
</div>
<div style="padding: 12px; background: ${net_effect_us_per_day > 0 ? '#fff3cd' : '#d1ecf1'}; border-left: 4px solid ${net_effect_us_per_day > 0 ? '#E67E22' : '#16A085'}; border-radius: 4px;">
<strong style="color: #2C3E50;">Net Effect:</strong>
<span style="color: #E67E22; font-size: 1.2em; font-weight: bold;">${net_effect_us_per_day > 0 ? '+' : ''}${net_effect_us_per_day.toFixed(1)} μs/day</span>
<div style="margin-top: 8px; color: #2C3E50;">
<strong>Uncorrected Position Error:</strong>
<span style="color: #E74C3C; font-weight: bold;">${(position_error_per_day / 1000).toFixed(1)} km/day</span>
<span style="color: #7F8C8D; margin-left: 4px;">(${position_error_per_day.toFixed(0)} meters)</span>
</div>
</div>
</div>`Relativistic Time Dilation
Relativistic Time Dilation
animation
gps
location
Try Change Satellite Velocity (m/s) to 3874.
Observe Watch Net Effect and Uncorrected Position Error after you press Calculate.
Explain Describe how Calculate combines general relativity and special relativity in the net effect.
Technical boundaries. The formulas use satellite velocity and orbit altitude with constant GM_earth and r_surface. Position error per day is the net effect multiplied by c_light.
NoteRelativistic Time Dilation
Explore: Change the satellite velocity or altitude to see how relativistic effects change. GPS satellites at 20,200 km altitude traveling at 3,874 m/s experience a net +38.7 μs/day clock advancement, which must be corrected.