deep_regime.py โ€” src/32-dark

The file src/32-dark/deep_regime.py of the validation package of the paper 32-dark, rendered with an anchor per line; the file itself is beside this page.

32-dark ledgersrc/32-dark/deep_regime.py ยท 2.2 KBdeep_regime.py
1# Construction 1 deep-regime experiment (LABELLED stochastic/continuum approximation;2# the framed-rational reading is a random walk on the finite phase cycle C_{p-1}).3# Noisy Kuramoto link (Adler eq):  dphi = (T - sin phi) dt + sqrt(2D) dW, kappa=1.4# T = mean phase gradient (the force), <sin phi> = transmitted flux. By the exact Gauss law5# the flux through a shell is the source demand g_N; so the force to carry g_N is the tilt T6# with <sin phi>(T)=g_N. We map (g_N=<sinphi>, g_eff=T) and read the deep-regime slope.7import numpy as np, json8def flux_of_tilt(T,D,K=3000,steps=5000,dt=0.02,seed=1):9    r=np.random.default_rng(seed); nb=steps//310    phi=np.full(K,np.arcsin(min(T,0.999))); sq=np.sqrt(2*D*dt); a=0.0;c=011    for i in range(steps):12        phi+=(T-np.sin(phi))*dt+sq*r.standard_normal(K)13        if i>=nb: a+=np.sin(phi).mean(); c+=114    return a/c15out={}16for D in [0.3,0.6]:17    tilts=np.array([0.01,0.02,0.04,0.08,0.16,0.32])18    flux=np.array([flux_of_tilt(t,D,seed=11) for t in tilts])19    gN=flux; geff=tilts20    slope=np.polyfit(np.log(gN[:3]),np.log(geff[:3]),1)[0]21    boost=geff/gN22    out[D]={'gN':gN.tolist(),'geff':geff.tolist(),'slope':float(slope),'boost':boost.tolist()}23    print(f"D={D}: deep slope d ln g_eff/d ln g_N = {slope:.3f}  (Newtonian 1.0, MOND 0.5)")24    print("   boost g_eff/g_N =", np.round(boost,3), " ~ constant => Newtonian-shaped")25json.dump(out,open('deep.json','w'))2627import matplotlib; matplotlib.use('Agg'); import matplotlib.pyplot as plt28fig,ax=plt.subplots(figsize=(5.4,4.2))29g=np.logspace(-2.4,-0.4,100)30for D,c in zip([0.3,0.6],['#1f77b4','#d62728']):31    d=out[D]; gN=np.array(d['gN']); geff=np.array(d['geff'])32    ax.loglog(gN,geff,'o',color=c,label=f'simulation, floor D={D} (slope {d["slope"]:.2f})')33a0=0.0334ax.loglog(g,g,'k--',lw=1,label='Newtonian  $g_{\\rm eff}=g_N$ (slope 1)')35ax.loglog(g,np.sqrt(g*a0),'g-',lw=1.4,label='deep-MOND  $g_{\\rm eff}=\\sqrt{g_N a_0}$ (slope 1/2)')36ax.set_xlabel('$g_N$  (capacity units)'); ax.set_ylabel('$g_{\\rm eff}$ (force / phase gradient)')37ax.set_title('Construction 1: mean noisy-Kuramoto dynamics is Newtonian-shaped')38ax.legend(fontsize=7,loc='upper left'); ax.grid(True,which='both',alpha=0.25)39fig.tight_layout(); fig.savefig('cons1_deepregime.pdf'); print("figure saved")40