Skip to content

Propulsion Model Improvements: Efficiency & Autotune Alignment#2

Merged
karakayahuseyin merged 3 commits into
mainfrom
fix-efficiency-autotune
Jun 3, 2026
Merged

Propulsion Model Improvements: Efficiency & Autotune Alignment#2
karakayahuseyin merged 3 commits into
mainfrom
fix-efficiency-autotune

Conversation

@karakayahuseyin

Copy link
Copy Markdown
Contributor

What's done in this PR:

  • Added propeller, motor, and system efficiency outputs to OperatingPoint and implemented their calculations in solver.py
  • Aligned motor calibration physics in autotune.py with solver.py by incorporating 2nd-order Drela model math (magnetic lag, speed-dependent no-load current, quadratic winding resistance, and battery discharge efficiency)
  • Added unit tests to verify efficiencies under both static and dynamic flight states
  • Updated .gitignore to prevent tracking .coverage and pytest cache files

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the propulsion modeling outputs by adding propeller/motor/system efficiency to OperatingPoint, aligns the motor calibration math in autotune.py with the solver’s 2nd-order (Drela-style) motor model, and adds tests to validate the new efficiency outputs.

Changes:

  • Added propeller_efficiency, motor_efficiency, and system_efficiency fields to OperatingPoint and computed them in PropulsionSolver.
  • Updated PropulsionCalibrator motor electrical model to match the solver (magnetic lag back-EMF, speed-dependent no-load current, current-dependent winding resistance, battery discharge efficiency).
  • Added/updated unit tests and expanded .gitignore to exclude coverage and pytest cache artifacts.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pythrust/propulsion/solver.py Computes and returns new efficiency outputs on each solved operating point.
pythrust/propulsion/models.py Extends OperatingPoint with three efficiency fields (defaulting to 0.0).
pythrust/propulsion/autotune.py Aligns calibration motor physics with solver (2nd-order model + battery discharge efficiency).
tests/test_solver.py Adds solver efficiency tests for static and dynamic conditions.
tests/test_models.py Updates OperatingPoint construction tests for new fields and defaults.
.gitignore Ignores coverage and pytest cache outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pythrust/propulsion/solver.py
Comment thread pythrust/propulsion/autotune.py
Comment thread tests/test_solver.py Outdated
…alculations

fix(tests): update efficiency assertions to allow equality with 1.0 and add invalid efficiency test
@karakayahuseyin karakayahuseyin merged commit 90f4c76 into main Jun 3, 2026
4 checks passed
@karakayahuseyin karakayahuseyin deleted the fix-efficiency-autotune branch June 3, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants