validate_rar.py — src/21-gravity

The script src/21-gravity/validate_rar.py of the validation package of the paper 21-grav, rendered with an anchor per line. ▶ run the predicates on Google Colab.

21-gravity ledgersrc/21-gravity/validate_rar.py · 1.0 KBvalidate_rar.pyColab
1"""Weak-acceleration floor: a0 = c H0 / (2 pi) against the radial acceleration relation.23Validates: Prop (floor acceleration) -- the derived scale against the SPARC fit4a0 = 1.20 +/- 0.02 (stat) +/- 0.24 (syst) x 10^-10 m/s^2 (McGaugh-Lelli-Schombert 2016);5and the turnaround radius corollary for the Local Group.6"""7import math89ok = True10c = 2.998e811a0_fit, syst = 1.20e-10, 0.24e-1012print("  a0 = c H0 / (2 pi):")13for H0 in (67.4, 70.0, 73.0):14    H = H0*1000/3.0857e2215    a0 = c*H/(2*math.pi)16    dev = (a0 - a0_fit)/syst17    print(f"    H0={H0:5.1f}: a0 = {a0:.3e} m/s^2   ({dev:+.2f} syst-sigma from fit)")18    if abs(a0 - a0_fit) > 1.5*syst: ok = False1920# turnaround radius for the Local Group (m ~ 5e12 Msun): r_ta = (Gm/H^2)^(1/3) ~ 1 Mpc scale21G, Msun, Mpc = 6.674e-11, 1.989e30, 3.0857e2222H = 70*1000/Mpc23r_ta = (G*5e12*Msun/H**2)**(1/3)/Mpc24print(f"  Local Group turnaround (Gm/H^2)^(1/3) = {r_ta:.2f} Mpc  (observed zero-velocity ~ 1 Mpc)")25if not 0.5 < r_ta < 3: ok = False26print("PASS" if ok else "FAIL", "- weak-acceleration floor")27