# Time 7, Exercise 1: the pendulum period formula, the seconds pendulum and a length error import math g = 9.81 SECONDS_PER_DAY = 86400 def period(length, gravity=g): # T = 2 * pi * sqrt(L / g), good for small swings return 2 * math.pi * math.sqrt(length / gravity) def length_for(T, gravity=g): # rearranged: L = g * (T / (2 * pi))^2 return gravity * (T / (2 * math.pi)) ** 2 for L in (0.25, 1.0, 4.0): print("length", L, "m -> period", round(period(L), 4), "s") print("length for a 2 s period (tick + tock):", round(length_for(2.0), 4), "m") print("length for a 1 s period:", round(length_for(1.0), 4), "m") # The seconds pendulum on the Moon (g = 1.62 m/s^2) print("same 0.994 m pendulum on the Moon: period", round(period(0.994, 1.62), 3), "s") # A pendulum 1 mm too long. Period goes as sqrt(L), so the fractional error is half the length error. L = length_for(2.0) longer = period(L + 0.001) print("period with 1 mm extra:", round(longer, 5), "s") fraction = longer / 2.0 - 1 print("clock loses", round(fraction * SECONDS_PER_DAY, 1), "s per day") print("half the fractional length error:", round(0.5 * 0.001 / L * SECONDS_PER_DAY, 1), "s per day") # Output when run: # length 0.25 m -> period 1.003 s # length 1.0 m -> period 2.0061 s # length 4.0 m -> period 4.0121 s # length for a 2 s period (tick + tock): 0.994 m # length for a 1 s period: 0.2485 m # same 0.994 m pendulum on the Moon: period 4.922 s # period with 1 mm extra: 2.00101 s # clock loses 43.5 s per day # half the fractional length error: 43.5 s per day # Reading the output: T = 2 pi sqrt(L/g) shows why the length is everything. A 1 m # pendulum swings in about 2.006 s, so a clock with a 2 s period needs 0.994 m. # A single millimetre too long loses about 43 and a half seconds a day, which is why # pendulum bobs carry an adjusting nut.