# Time 12, Exercise 1: how much do GPS satellite clocks gain each day? import math c = 299_792_458 # speed of light, metres per second G_M = 3.986004418e14 # Earth's gravitational constant GM, m^3/s^2 R_EARTH = 6.371e6 # mean Earth radius, metres (clock on the ground) R_ORBIT = 2.6560e7 # GPS orbit radius from Earth's centre, metres (about 20,200 km up) DAY = 86_400 # Orbital speed for a circular orbit: v = sqrt(GM / r) v = math.sqrt(G_M / R_ORBIT) print("orbital speed:", round(v), "m/s") # Speed effect: a moving clock runs slow by about v^2 / (2 c^2) slow = v ** 2 / (2 * c ** 2) print("speed effect:", round(-slow * DAY * 1e6, 1), "microseconds per day") # Height effect: a clock higher in gravity runs fast by about GM/c^2 * (1/R_ground - 1/R_orbit) fast = G_M / c ** 2 * (1 / R_EARTH - 1 / R_ORBIT) print("height effect:", round(fast * DAY * 1e6, 1), "microseconds per day") net = (fast - slow) * DAY print("net gain:", round(net * 1e6, 1), "microseconds per day") # Without correction, how far would positions drift? Distance = time error x speed of light print("ranging error after one day:", round(net * c / 1000, 1), "km") # Part 2: a clock one metre higher gains about g/c^2 of a second per second g = 9.81 per_metre = g / c ** 2 print("one metre higher:", f"{per_metre:.2e}", "fractional rate,", round(per_metre * 365.2425 * DAY * 1e9, 1), "nanoseconds per year") # Output when run: # orbital speed: 3874 m/s # speed effect: -7.2 microseconds per day # height effect: 45.7 microseconds per day # net gain: 38.5 microseconds per day # ranging error after one day: 11.5 km # one metre higher: 1.09e-16 fractional rate, 3.4 nanoseconds per year # Reading the output: the satellite's speed slows its clock by about 7 microseconds a day, # but being far from Earth's gravity speeds it up by about 46, so the net is about +38 # microseconds a day. Left uncorrected, the position error would grow by roughly 11 km a day, # so the satellites' clocks are deliberately set slightly slow before launch.