Skip to content

perf(solver)!: keep negative thrust in the RPM search - #26

Merged
karakayahuseyin merged 2 commits into
mainfrom
perf/rpm-search-validity
Nov 19, 2026
Merged

karakayahuseyin merged 2 commits into
mainfrom
perf/rpm-search-validity

Conversation

@karakayahuseyin

Copy link
Copy Markdown
Contributor

Summary

  • Propeller models return NaN where they have no result. The solver's residual rejects only non-finite values, so negative thrust or torque stays in the RPM search; a root with negative thrust is still marked invalid_coefficients.
  • TablePropeller.thrust_torque returns NaN exactly where the solver used to reject a table point (Cp ≤ 0 or Ct < 0), so tabulated results are unchanged.
  • BladeElementPropeller returns NaN for an unconverged station instead of zero.
  • Docs: propeller, table, blade-element and solver reference pages; AGENTS.md points docs updates to docs/reference/.

Blade-element model, 10x5 test case:

Airspeed Before After Propeller calls
0 m/s 25 ms 24 ms 11 → 11
8 m/s 112 ms 27 ms 56 → 13
15 m/s 113 ms 28 ms 57 → 13

Solved RPMs are unchanged.

Breaking change

TablePropeller.thrust_torque returns (nan, nan) instead of (0, 0) outside its data.

Test plan

  • pytest: 230 passed, golden and QPROP tests unchanged
  • New tests (call count, negative torque in the search, negative-thrust root, rate-map battery with negative current) fail on the old solver
  • mkdocs build --strict
  • Both examples run

🤖 Generated with Claude Code

karakayahuseyin and others added 2 commits November 19, 2026 10:41
The solver treated negative thrust or non-positive torque as "no data" and
spent most of a forward-flight solve narrowing the lower RPM bound. Models
now return NaN where they have no result; the solver rejects only non-finite
values, and a root with negative thrust is still marked
invalid_coefficients. Blade-element forward flight drops from about 56 to
13 propeller calls (112 ms to 27 ms) with the same solved RPM.

BREAKING CHANGE: TablePropeller.thrust_torque returns (nan, nan) instead of
(0, 0) outside its data (Cp <= 0 or Ct < 0). BladeElementPropeller returns
(nan, nan) where a station does not converge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@karakayahuseyin
karakayahuseyin merged commit 054a5b3 into main Nov 19, 2026
4 checks passed
@karakayahuseyin
karakayahuseyin deleted the perf/rpm-search-validity branch November 19, 2026 07:49
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