Repository navigation
refactor!: give the solver a propeller model instead of a coefficient table - #21
Merged
Merged
Conversation
Record the operating points the solver returns for 17 cases and one bus at 489e7ab: static and forward flight, table and diameter limits, current limits, the second-order motor and the rate-map battery. The values pin behavior so the refactor can be shown to leave results unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… table The solver read thrust and power coefficients straight from a PropellerEntry, so a propeller could only be an APC table. It now takes a PropellerModel: a diameter, the advance ratio its RPM search starts at, and thrust and torque at a density, airspeed and RPM. TablePropeller is the model for tabulated coefficients and holds the diameter that PropellerSpec carried, so a propeller is one argument instead of two. The solver derives the advance ratio and the coefficients it reports from the model's thrust and torque. Results match the golden values to rounding error. The package pythrust.propellers is renamed pythrust.propeller. BREAKING CHANGE: solve_operating_point() and PropulsionUnit take propeller=TablePropeller(entry) in place of propeller=PropellerSpec(...) and prop_entry=entry. PropellerSpec is removed; pass a diameter other than the table's as TablePropeller(entry, diameter_m=...). PropulsionSolver._estimate_j_max is now TablePropeller.max_advance_ratio. Import from pythrust.propeller instead of pythrust.propellers. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 18, 2026
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.
Summary
The solver read thrust and power coefficients straight from a
PropellerEntry, so a propeller could only be an APC table. This PR puts an interface between the two, as groundwork for a blade-element propeller model. Solver results do not change.PropellerModel(protocol):diameter_m,max_advance_ratio, andthrust_torque(rho, airspeed_mps, rpm).TablePropeller: the model for tabulated coefficients. It wraps aPropellerEntryand holds the diameter thatPropellerSpeccarried.propellerargument. The solver derives the advance ratio and the reportedct/cpfrom the model's thrust and torque.pythrust.propellers→pythrust.propeller.Breaking changes
solve_operating_point()andPropulsionUnittakepropeller=TablePropeller(entry)in place ofpropeller=PropellerSpec(...)andprop_entry=entry.PropellerSpecis removed. For a diameter other than the table's, useTablePropeller(entry, diameter_m=...).PropulsionSolver._estimate_j_maxis nowTablePropeller.max_advance_ratio.pythrust.propellerinstead ofpythrust.propellers.PropulsionComponentkeeps itsprop_entryoption.Verification
rate_map_battery_mission.pyandselect_motor_from_database.pyprinted byte-identical output before and after the solver change.mkdocs build --strict(mkdocs is not installed in the local environment). The docs changes are edits to code samples and one new section inapi_reference.md.Notes
max_advance_ratioserves the solver's RPM search rather than describing the propeller. It is kept here so that behavior stays unchanged, and should be revisited when the blade-element model is added.pythrust/data/propellers/andtests/test_propellers.pykeep their names.🤖 Generated with Claude Code