Skip to content

BUG: Fix hard-coded radius value for parachute added mass calculation#936

Closed
Gui-FernandesBR wants to merge 6 commits intocopilot/remove-hard-coded-radius-valuefrom
claude/kind-hodgkin
Closed

BUG: Fix hard-coded radius value for parachute added mass calculation#936
Gui-FernandesBR wants to merge 6 commits intocopilot/remove-hard-coded-radius-valuefrom
claude/kind-hodgkin

Conversation

@Gui-FernandesBR
Copy link
Member

Summary

  • Removes the hard-coded radius value (0.065 m) used in parachute added-mass calculations and replaces it with a physically meaningful estimate derived from the parachute's cd_s
  • Introduces a new drag_coefficient parameter to Parachute.__init__ (default 1.4 for hemispherical canopies per NASA SP-8066), allowing users to control the radius estimation: radius = sqrt(cd_s / (drag_coefficient * pi))
  • Updates Rocket.add_parachute to pass radius=None by default for consistency
  • Improves docstrings with explicit None defaults and parameter descriptions
  • Extracts noise-signal initialization into _initialize_noise_attributes() to resolve a pylint too-many-statements warning

Test plan

  • Existing parachute unit tests pass (tests/unit/rocket/test_parachute.py)
  • New parachute tests covering drag_coefficient and radius estimation pass
  • Stochastic parachute tests pass (tests/unit/simulation/test_monte_carlo.py)
  • pylint rocketpy/rocket/parachute.py scores 10.00/10

🤖 Generated with Claude Code

Copilot AI and others added 6 commits February 27, 2026 21:37
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>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
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>
…uce drag_coefficient parameter for radius estimation
…n Parachute.__init__

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Gui-FernandesBR Gui-FernandesBR requested a review from a team as a code owner March 9, 2026 01:26
@Gui-FernandesBR Gui-FernandesBR changed the base branch from master to copilot/remove-hard-coded-radius-value March 9, 2026 01:27
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (copilot/remove-hard-coded-radius-value@10457f9). Learn more about missing BASE report.

Additional details and impacted files
@@                            Coverage Diff                            @@
##             copilot/remove-hard-coded-radius-value     #936   +/-   ##
=========================================================================
  Coverage                                          ?   81.12%           
=========================================================================
  Files                                             ?      107           
  Lines                                             ?    13839           
  Branches                                          ?        0           
=========================================================================
  Hits                                              ?    11227           
  Misses                                            ?     2612           
  Partials                                          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants