# SCRIPT: RS02B_SHARP_EXTRAPOLATION # Diagnosis of the RS-02 K1 kill: is the finite-width error a linear-in-w offset that vanishes # in the sharp limit (formula right, tolerance too tight), or does the w -> 0 limit miss Gamma? import numpy as np, importlib.util, sys spec = importlib.util.spec_from_file_location("rs02", "rs02_interface.py") src = open("rs02_interface.py").read().split("out = {}")[0] ns = {}; exec(src, ns) refl, gamma_pred = ns['refl'], ns['gamma_pred'] for th in [25, 29, 31, 40, 60]: ws = [0.02, 0.01, 0.005, 0.0025] rs = [] for ow in ws: r, C = refl(4.0, 1.0, 1.0, 0.5, ow/10.0, th); rs.append(r) G = gamma_pred(4.0, 1.0, C) rich = 2*rs[-1] - rs[-2] print(f"theta {th}: |r-Gamma| at omega*w=0.02..0.0025: " + ' '.join(f"{abs(x-G):.2e}" for x in rs) + f" Richardson limit error {abs(rich-G):.2e}")