From 9cfcd8bb96c3d5ccda2724e919e8e236c07c8263 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 30 Oct 2026 11:00:06 +0000 Subject: [PATCH] =?UTF-8?q?research:=20D=C3=BCtsch=20driver=20=E2=80=94=20?= =?UTF-8?q?periodic=20Morison=20bases=20from=20step=20mod=20T?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- research/duetsch_re100_kc5/protocol.py | 2 +- tests/unit/test_duetsch_protocol.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/research/duetsch_re100_kc5/protocol.py b/research/duetsch_re100_kc5/protocol.py index c070535..ecd3ced 100644 --- a/research/duetsch_re100_kc5/protocol.py +++ b/research/duetsch_re100_kc5/protocol.py @@ -53,7 +53,7 @@ def interval_bases(n, T, points=16): """Single-step interval averages over [n, n + 1] of cos phi |cos phi| and sin phi (phi in radians = 2 pi s / T - pi / 2), Gauss-Legendre quadrature.""" x, w = np.polynomial.legendre.leggauss(points) - s = n + 0.5 * (x + 1.0) + s = int(n) % T + 0.5 * (x + 1.0) # periodic: identical bases in every cycle phi = 2.0 * np.pi * s / T - 0.5 * np.pi c = np.cos(phi) return 0.5 * float(np.sum(w * c * np.abs(c))), 0.5 * float(np.sum(w * np.sin(phi))) diff --git a/tests/unit/test_duetsch_protocol.py b/tests/unit/test_duetsch_protocol.py index 0751be7..9fea3b1 100644 --- a/tests/unit/test_duetsch_protocol.py +++ b/tests/unit/test_duetsch_protocol.py @@ -73,6 +73,7 @@ def test_geometry_repeats_exactly_across_cycles(): v0 = p.position(m + 1, T, A) - p.position(m, T, A) assert p.position(m + 1 + c * T, T, A) - p.position(m + c * T, T, A) == v0 assert p.cycle(T // 4 + 5 * T, T) == 6 # unwrapped index stays separate + assert p.interval_bases(123 + 7 * T, T) == p.interval_bases(123, T) def test_exact_point_inside_body_is_missing_even_with_fluid_corners():