Skip to content

Take a live polar onto a wing whose table carries a delta axis - #269

Merged
1-Bart-1 merged 1 commit into
mainfrom
fix/live-polar-on-matrix-panels
Aug 31, 2026
Merged

Take a live polar onto a wing whose table carries a delta axis#269
1-Bart-1 merged 1 commit into
mainfrom
fix/live-polar-on-matrix-panels

Conversation

@1-Bart-1

Copy link
Copy Markdown
Member

Release blocker for #268. refresh_live_polars! throws on any wing whose offline polars carry a flap axis — which is most real wings, including the SK100.

The bug

set_polar! wrote a 1D table into whatever interpolation field the panel had. A POLAR_MATRICES panel's field type is 2D, so the assignment could not convert:

MethodError: Cannot `convert` an object of type
  Extrapolation{Float64,1,GriddedInterpolation{Float64,1,...}}

data/sk100/aero_settings.yaml carries both alpha_range and delta_range, so the SK100 resolves to POLAR_MATRICES and was locked out of the live path entirely.

Before #268 this worked, because SAMPLED kept its own storage and never touched the interpolation fields. Folding it into the panel's own table is still the right call, but the table's shape is fixed by the panel's type parameters and the write has to respect it.

Neither test suite caught it. VSM's live-polar fixture builds POLAR_VECTORS panels, and SymbolicAWEModels' test_live_polar.jl uses 2plate_kite, whose polars are also 1D (361 alpha knots, no delta axis). Both go green while the SK100 fails.

The fix

rebuild_polar dispatches on the interpolation's dimensionality, and polar_model reports the model that goes with it:

That is what a regenerated polar means: the deflection is in the shape the network was handed, so the answer no longer depends on the flap angle, and a delta-invariant table says exactly that.

Test

test/airfoil_aero/test_live_polar.jl gains "a rewritten polar lands on a matrix panel too" — the case both suites were missing. It pins that the panel stays POLAR_MATRICES, that the value at a knot is the sampled one, that delta = -40° and delta = +40° read the same polar, and that it is still held flat past the sampled window.

All live-polar tests pass (87 assertions).

🤖 Generated with Claude Code

set_polar! wrote a 1D table into whatever interpolation field the panel had,
which a POLAR_MATRICES panel does not have: its field type is 2D and the write
threw. Every wing whose offline polars carry a flap axis was locked out of the
live path, which is most of them, and neither test suite noticed because both
fixtures build vector panels.

The table now keeps the shape the panel was built with. A matrix panel takes
the sampled curve at every delta it already spans, which is what a regenerated
polar means: the deflection is in the shape the network was given, so the
answer does not depend on the flap angle any more.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@1-Bart-1
1-Bart-1 enabled auto-merge (rebase) August 31, 2026 21:11
@1-Bart-1
1-Bart-1 merged commit fbdbaef into main Aug 31, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant