Does light charge the quons? › Files cited on the page › check_trials25-27_fable/

a6b_growth_check.py

In the investigation at sim/m8_engine/check_trials25-27_fable/a6b_growth_check.py · last changed in commit 46c285d, 25 November 2026 · 2,250 bytes · the folder as a zip


"""A6 follow-up (blind): does the gimbal's growth rate tend to a sqrt(18 - w^2/2) as a -> 0? Also: growth measured from the slow
variable u = A beta' - h theta cos(beta) (u' averages to (a^2/2)(h^2/A - A w^2) sin beta cos beta), and with the RK4 step halved."""
import subprocess, time
import numpy as np
print("git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, cwd="/home/doug/aetherscience.org/aspden-investigation").stdout.strip())
print("clock:", time.strftime("%Y-%m-%d %H:%M:%S %Z"))
h, A = 1 / 6, 1 / 36


def run(a, w, nps=400, seed=1e-7, tmax=None):
    def rhs(y, t):
        beta, bd = y
        thd = -a * w * np.sin(w * t)
        return np.array([bd, (h * thd * np.cos(beta) - A * thd**2 * np.sin(beta) * np.cos(beta)) / A])
    lam_h = a * np.sqrt(18 - w * w / 2)
    per = 2 * np.pi / w; dt = per / nps
    y = np.array([seed, h / A * a]); t = 0.0
    out = []
    nper = int((tmax or min(12 / lam_h, 3000)) / per) + 1
    for n in range(nper):
        for _ in range(nps):
            k1 = rhs(y, t); k2 = rhs(y + dt / 2 * k1, t + dt / 2); k3 = rhs(y + dt / 2 * k2, t + dt / 2); k4 = rhs(y + dt * k3, t + dt)
            y = y + dt / 6 * (k1 + 2 * k2 + 2 * k3 + k4); t += dt
        out.append((t, y[0], A * y[1] - h * a * np.cos(w * t) * np.cos(y[0])))
    out = np.array(out)
    ok = (np.abs(out[:, 1]) > 1e-6) & (np.abs(out[:, 1]) < 0.02)
    lam_b = np.polyfit(out[ok, 0], np.log(np.abs(out[ok, 1])), 1)[0] if ok.sum() > 3 else float("nan")
    oku = (np.abs(out[:, 2]) > 1e-9) & (np.abs(out[:, 1]) < 0.02) & (out[:, 0] > 5 / lam_h)
    lam_u = np.polyfit(out[oku, 0], np.log(np.abs(out[oku, 2])), 1)[0] if oku.sum() > 3 else float("nan")
    return lam_h, lam_b, lam_u


print(f"{'a':>7} {'w':>4} {'B':>6} {'lambda hand':>12} {'from beta0':>11} {'ratio':>6} {'from u':>9} {'ratio':>6}")
for a, w, nps in ((0.02, 1.0, 400), (0.01, 1.0, 400), (0.005, 1.0, 400), (0.0025, 1.0, 400), (0.00125, 1.0, 400), (0.005, 1.0, 1600), (0.005, 3.0, 400), (0.0025, 3.0, 400)):
    lh, lb, lu = run(a, w, nps)
    print(f"{a:>7} {w:>4} {6 * a / w:>6.3f} {lh:>12.6f} {lb:>11.6f} {lb / lh:>6.3f} {lu:>9.6f} {lu / lh:>6.3f}   (steps per period {nps})")
print("clock:", time.strftime("%Y-%m-%d %H:%M:%S %Z"))