BUG: Fix incorrect Jacobian in only_radial_burn branch of SolidMotor.evaluate_geometry#944
Merged
MateusStano merged 3 commits intorel/v1.12.0from Mar 20, 2026
Merged
Conversation
Merged
…ometry Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [WIP] Addressing feedback from PR #935 for release v1.12.0
BUG: Fix incorrect Jacobian in Mar 20, 2026
only_radial_burn branch of SolidMotor.evaluate_geometry
| # ∂ṙ/∂h = vdiff/(2π*r*h²) = factor * r | ||
| inner_radius_derivative_wrt_inner_radius = factor * grain_height | ||
| inner_radius_derivative_wrt_height = factor * grain_inner_radius | ||
| # dh/dt = 0, so all partial derivatives of height are zero |
Member
There was a problem hiding this comment.
Suggested change
| # dh/dt = 0, so all partial derivatives of height are zero | |
| # dh/dt = 0 (Height is a constant), so all partial derivatives of height are zero |
Gui-FernandesBR
approved these changes
Mar 20, 2026
Copilot stopped work on behalf of
MateusStano due to an error
March 20, 2026 01:54
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rel/v1.12.0 #944 +/- ##
============================================
Coverage 81.09% 81.09%
============================================
Files 107 107
Lines 13906 13906
============================================
Hits 11277 11277
Misses 2629 2629 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MateusStano
added a commit
that referenced
this pull request
Mar 20, 2026
…or.evaluate_geometry` (#944) * Initial plan * BUG: Fix incorrect Jacobian in only_radial_burn branch of evaluate_geometry Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
MateusStano
added a commit
that referenced
this pull request
Apr 6, 2026
* BUG: Fix hard-coded radius value for parachute added mass calculation (#889) * Fix hard-coded radius value for parachute added mass calculation Calculate radius from cd_s using a typical hemispherical parachute drag coefficient (1.4) when radius is not explicitly provided. This fixes drift distance calculations for smaller parachutes like drogues. Formula: R = sqrt(cd_s / (Cd * π)) Closes #860 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Address code review: improve docstrings and add explicit None defaults Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Add CHANGELOG entry for PR #889 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Update rocket.add_parachute to use radius=None for consistency Changed the default radius from 1.5 to None in the add_parachute method to match the Parachute class behavior. This ensures consistent automatic radius calculation from cd_s across both APIs. Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Refactor Parachute class to remove hard-coded radius value and introduce drag_coefficient parameter for radius estimation Fix hard-coded radius value for parachute added mass calculation Calculate radius from cd_s using a typical hemispherical parachute drag coefficient (1.4) when radius is not explicitly provided. This fixes drift distance calculations for smaller parachutes like drogues. Formula: R = sqrt(cd_s / (Cd * π)) Closes #860 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Add CHANGELOG entry for PR #889 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Refactor Parachute class to remove hard-coded radius value and introduce drag_coefficient parameter for radius estimation MNT: Extract noise initialization to fix pylint too-many-statements in Parachute.__init__ Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * Refactor environment method access in controller test for clarity * fix pylint * fix comments * avoid breaking change with drag_coefficient * reafactors Parachute.__init__ method * fix tests --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <guilherme_fernandes@usp.br> * ENH: get changes from BUG: All NOAA NOMADS Dependent Atmosphere Models Broken Fixes #933 * ENH: Add guidelines for simulation safety, Sphinx documentation, and pytest standards (GitHub Copilot) (#937) * REL: bump version to 1.12 * ENH: Add explicit timeouts to ThrustCurve API requests and update changelog (#940) * Initial plan * ENH: Add explicit timeouts to ThrustCurve API requests Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> * DOC: Add timeout fix PR to changelog Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> * ENH: Restore power_off/on_drag as Function objects; add _input attributes for raw user input and update changelog (#941) * Initial plan * ENH: Restore power_off/on_drag as Function, add _input attributes for raw user input Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> * DOC: Add PR #941 compatibility fix to changelog Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> * Update rocketpy/rocket/rocket.py Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: ruff pylint --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Co-authored-by: MateusStano <mateusstano@usp.br> * MNT: Remove unused imports and deprecated functions from mathutils/function.py * BUG: Readd SourceType enumeration for function source types and clean up imports * BUG: Fix incorrect Jacobian in `only_radial_burn` branch of `SolidMotor.evaluate_geometry` (#944) * Initial plan * BUG: Fix incorrect Jacobian in only_radial_burn branch of evaluate_geometry Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com> * ENH: move weathercocking_coeff to PointMassRockt * MNT: ruff * MNT: fix cyclic import * BUG: Add wraparound logic for wind direction in environment plots (#939) * chore: added personal toolkit files * update branch name in workflow * chore: update toolkit files * Fix: add wraparound logic for wind direction and related tests * style: fix ruff formatting * Remove unused import Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * refactor: move repetitive logic into helper method * fix: update test logic in test_environment * add changelog entry --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: add numpy import to test_environment.py * MNT: rename constant for wraparound threshold in _break_direction_wraparound method * ENH: Adaptive Monte Carlo via Convergence Criteria (#922) * ENH: added a new function (simulate_convergence) * DOC: added a cell to show simulate_convergence function usage * TST: integration test for simulate_convergence * DOC: updated changelog for this PR * ENH: ran black to lint intg test file * new fixes thx to copilot comments * linted rocketpy/simulation/monte_carlo.py --------- Co-authored-by: Malmahrouqi3 <mohdsaid497566@gmail.com> * DOC: add latitude range in docs Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: remove unnecessary pylint warning Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: remove unnecessary pylint warning Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * DOC: correctly link to WeatherModelMapping Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * DOCS: checked todo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ENH: address copilot comments * TST: improve tests * ENH: get changes from BUG: All NOAA NOMADS Dependent Atmosphere Models Broken Fixes #933 * BUG: Fix hard-coded radius value for parachute added mass calculation (#889) * Fix hard-coded radius value for parachute added mass calculation Calculate radius from cd_s using a typical hemispherical parachute drag coefficient (1.4) when radius is not explicitly provided. This fixes drift distance calculations for smaller parachutes like drogues. Formula: R = sqrt(cd_s / (Cd * π)) Closes #860 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Address code review: improve docstrings and add explicit None defaults Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Add CHANGELOG entry for PR #889 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Update rocket.add_parachute to use radius=None for consistency Changed the default radius from 1.5 to None in the add_parachute method to match the Parachute class behavior. This ensures consistent automatic radius calculation from cd_s across both APIs. Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Refactor Parachute class to remove hard-coded radius value and introduce drag_coefficient parameter for radius estimation Fix hard-coded radius value for parachute added mass calculation Calculate radius from cd_s using a typical hemispherical parachute drag coefficient (1.4) when radius is not explicitly provided. This fixes drift distance calculations for smaller parachutes like drogues. Formula: R = sqrt(cd_s / (Cd * π)) Closes #860 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Add CHANGELOG entry for PR #889 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Refactor Parachute class to remove hard-coded radius value and introduce drag_coefficient parameter for radius estimation MNT: Extract noise initialization to fix pylint too-many-statements in Parachute.__init__ Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * Refactor environment method access in controller test for clarity * fix pylint * fix comments * avoid breaking change with drag_coefficient * reafactors Parachute.__init__ method * fix tests --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <guilherme_fernandes@usp.br> * ENH: Add guidelines for simulation safety, Sphinx documentation, and pytest standards (GitHub Copilot) (#937) * REL: bump version to 1.12 * BUG: Add wraparound logic for wind direction in environment plots (#939) * chore: added personal toolkit files * update branch name in workflow * chore: update toolkit files * Fix: add wraparound logic for wind direction and related tests * style: fix ruff formatting * Remove unused import Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * refactor: move repetitive logic into helper method * fix: update test logic in test_environment * add changelog entry --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: add numpy import to test_environment.py * MNT: rename constant for wraparound threshold in _break_direction_wraparound method * DOC: add latitude range in docs Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: remove unnecessary pylint warning Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * MNT: remove unnecessary pylint warning Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> * ENH: address copilot comments * TST: improve tests * DOC: correctly link to WeatherModelMapping Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * DOCS: checked todo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * ENH: Adaptive Monte Carlo via Convergence Criteria (#922) * ENH: added a new function (simulate_convergence) * DOC: added a cell to show simulate_convergence function usage * TST: integration test for simulate_convergence * DOC: updated changelog for this PR * ENH: ran black to lint intg test file * new fixes thx to copilot comments * linted rocketpy/simulation/monte_carlo.py --------- Co-authored-by: Malmahrouqi3 <mohdsaid497566@gmail.com> * DEV: remove unwanted changes from develop * DEV: Update for hotfix * TST: add tests * MNT: remove changes from develop again * MNT: Refactor longitude and latitude index functions * MNT: ruff --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com> Co-authored-by: Gui-FernandesBR <guilherme_fernandes@usp.br> Co-authored-by: Khushal Kottaru <khushal.kottaru@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Mohammed S. Al-Mahrouqi <malmahrouqi3@gatech.edu> Co-authored-by: Malmahrouqi3 <mohdsaid497566@gmail.com>
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.
The
geometry_jacobianfunction inSolidMotor.evaluate_geometryhad copy-paste errors in theonly_radial_burnbranch — the formulas were carried over from the non-radial burn case without adjustment, producing a mathematically wrong Jacobian that can degrade or derail LSODA integration.Pull request type
Checklist
CHANGELOG.mdhas been updated (if relevant)Current behavior
For
only_radial_burn,burn_area = 2π·r·h, soṙ = −vdiff / (2π·r·h).The Jacobian was incorrectly computed as:
∂ṙ/∂r = factor * (h − 2r)— copied from the non-radial case whered(burn_area)/dr = 2π(h−2r)∂ṙ/∂h = 0— wrong; height appears in the denominator so it has a non-zero partialNew behavior
Correct partial derivatives for
burn_area = 2π·r·h:Breaking change
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.