"""Run all six quark masses to one common energy (2-loop QCD), then retest the Koide balance angle. 14 Nov 2026. Inputs PDG 2024: alpha_s(MZ)=0.1180; u,d,s MS-bar at 2 GeV; c(mc)=1.273; b(mb)=4.183; t MS-bar(mt) ~ 162.5 GeV (from pole 172.57). Running: d a/dln mu^2 = -b0 a^2 - b1 a^3 ; d ln m/d ln mu^2 = -g0 a - g1 a^2 ; a = alpha_s/pi (Tarrach; Chetyrkin; Vermaseren).""" import math from scipy.integrate import solve_ivp MZ=91.1876 def b(nf): return (11-2*nf/3)/4, (102-38*nf/3)/16 def g(nf): return 1.0, (202/3-20*nf/9)/16 def nf_at(mu): return 6 if mu>162.5 else 5 if mu>4.183 else 4 if mu>1.273 else 3 def run(a0,mu0,mu1,lnm=0.0): # piecewise across thresholds, continuous matching (adequate at 2 loops for this test) th=[1.273,4.183,162.5]; pts=sorted([mu0,mu1]+[t for t in th if min(mu0,mu1)