Repository navigation
feat(planning): non-geodesic VK winding math core (#327) - #350
Merged
Merged
Conversation
Add the friction-assisted (non-geodesic) winding math for the Von Karman nose so a pass can climb past the geodesic turnaround toward the tip. This is the math-core slice (PR1 of 3): the solver + kinematics are unit-tested directly; schema field, validator, dispatch and mu threading follow in PR2/PR3. - VonKarman.radius_curvature_at(z): analytic r'' (cancelled closed form, **0.5/**1.5 not math.sqrt per the Motion IR guard), raising at BOTH the base (r'' ~ -z^-1/2) and the tip. - _integrate_nongeodesic: adaptive RK4-march of the coupled (alpha, theta) ODE from the base to an alpha_max=88 ceiling, the exact crossing pinned by bisection. The step shrinks to bound the per-step fibre-angle advance where dalpha/dz stiffens (the base r'' spike and the near-cap tail where sin(a)r'/r diverges as r->0) so the floored z_cap is CONVERGED and platform-stable; a fixed step was mm-wrong and step-dependent for moderate lambda. lambda=0 recovers the geodesic exactly. - compute_profile_helical_kinematics(..., friction_lambda=0.0): lambda=0 keeps the frozen geodesic path byte-for-byte; lambda>0 routes to the marched path, reporting the alpha table and the cap slip demand |r'(z_cap)|. - profile_local_alpha_deg reads the marched alpha table when present. Tests (independent oracles): lambda=0 == geodesic element-wise; cylinder closed form 1/sin(a)=1/sin(a0)+lambda*z/r pins the k_n coefficient+sign; an independently adaptive RK2 integrator agrees into the steep tail; cap shrinks monotonically as lambda rises (sign-error catch); z_cap converged/step-stable across an adversarial lambda x angle grid; r'' vs central difference + z^-1/2 base scaling.
Closed
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #327 (Stage 3b Phase 2 — non-geodesic VK nosecone winding). PR 1 of 3: math core.
Adds the friction-assisted (non-geodesic) winding math so a pass can climb past the geodesic turnaround toward the tip. The solver + kinematics are unit-tested directly; the
.windfrictionLambdafield, validator, dispatch, and slip-limit (μ) threading are deliberately deferred to PR2/PR3 — this slice is pure math.What's here
VonKarman.radius_curvature_at(z)— analyticr″(cancelled closed form;**0.5/**1.5/math.hypot, nomath.sqrttoken per the Motion IR guard). Raises at both singular ends (baser″ ∝ −z^{-1/2}and tip)._integrate_nongeodesic— adaptive RK4-march of the coupled(α, θ)ODE from the base to anα_max = 88°ceiling (the turnaround is a coordinate singularity,dα/dz ∝ 1/cos α), the exact crossing pinned by bisection. The step adapts — bounded per-step fibre-angle advance — so the flooredz_capis converged and platform-stable.λ = 0recovers the geodesic exactly.compute_profile_helical_kinematics(..., friction_lambda=0.0)—λ=0keeps the Phase-1 geodesic path byte-for-byte frozen (the 22552/32572 move-count pins still hold);λ>0routes to the marched path and reports the α-table + the cap slip demand|r'(z_cap)|.Why adaptive (the interesting part)
A fixed-step march to a fixed
α_maxis not enough: near the cap the geodesic termsin α·r'/rdiverges asr→0(and1/cos αasα→90°), so a 0.05 mm step advances α by degrees, an RK4 stage overshoots 90° and sign-flipsdα/dz, andz_crosscame out mm-wrong and step-dependent for moderate λ (e.g. λ=0.17 → 288.96 mm at dz=0.05 vs 281.3 converged; broad floor-flips across λ∈[0.15,0.5]). This was caught by an adversarial review of the first draft. Bounding the per-step α-advance shrinks the step exactly where the ODE stiffens (the near-cap tail and the baser″spike), giving a converged, deterministic cap — 0 floor-flips across the adversarial λ×angle grid.Tests (independent oracles)
λ=0≡ geodesic element-wise (the correctness anchor)1/sin α = 1/sin α₀ + λz/r— pins thek_ncoefficient and sign independent of the RK4 structurer″vs central difference + thez^{-1/2}base scalingGate
Full backend suite 309 passed; ruff + format clean; mypy clean on the touched files.
λ=0geodesic move-count pins unchanged.