Skip to content

ENH: Improve parachute geometric parametrization #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

ArthurJWH
Copy link
Contributor

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Parachute radius is assumed to be fixed (=1.5m)

New behavior

Other than adding a radius parameter, there is also additional height and porosity parameters.
The default is still set to the current behavior.

Breaking change

  • Yes
  • No

Sorry, something went wrong.

@ArthurJWH ArthurJWH requested a review from a team as a code owner June 26, 2025 01:04
@ArthurJWH ArthurJWH changed the base branch from master to develop June 26, 2025 01:05
Copy link

@Copilot Copilot AI left a comment

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 improves the parachute geometric parametrization by introducing new parameters (radius, height, and porosity) to provide a more flexible and accurate simulation. Key changes include:

  • Adding lambda callbacks to update parachute_radius, parachute_height, and parachute_porosity in the simulation.
  • Updating the added mass computation in flight dynamics to use parachute_radius and parachute_height.
  • Extending the Parachute class to support the new parameters, with appropriate defaults and serialization.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
rocketpy/simulation/flight.py Updated simulation callbacks and mass computation with new parameters.
rocketpy/rocket/parachute.py Extended the Parachute class to include and serialize new parameters.
Comments suppressed due to low confidence (2)

rocketpy/simulation/flight.py:2002

  • [nitpick] Consider adding a comment to explain the rationale behind the modified added mass formula using parachute_radius squared times parachute_height, clarifying the geometrical model or assumptions used.
        ma = ka * rho * (4 / 3) * np.pi * parachute_radius**2 * parachute_height

rocketpy/simulation/flight.py:2018

  • Ensure that the variable 'z' is defined in this scope (for example, by extracting altitude from the state vector) to avoid potential runtime errors.
        az = (Dz - mp * self.env.gravity.get_value_opt(z)) / (mp + ma)

Copilot

This comment was marked as outdated.

Comment on lines 1511 to 1514
porosity : float, optional
Porosity of the parachute material, which is a measure of how much air can
pass through the parachute material.
Default value is 0.0432 (for consistency with previous versions).
Copy link
Member

Choose a reason for hiding this comment

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

Could you define more precisely what porosity is? Something like: "The ratio of the area of the porous structure to the total area of the canopy" (I don't know if this is the correct definition in our case, just an example)

@github-project-automation github-project-automation bot moved this from Backlog to Next Version in LibDev Roadmap Jul 4, 2025
ArthurJWH and others added 3 commits July 4, 2025 16:57
…zation
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.05%. Comparing base (f17893b) to head (f84459d).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #835      +/-   ##
===========================================
+ Coverage    80.02%   80.05%   +0.03%     
===========================================
  Files           98       98              
  Lines        12004    12026      +22     
===========================================
+ Hits          9606     9628      +22     
  Misses        2398     2398              

☔ 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.

@Gui-FernandesBR Gui-FernandesBR requested a review from Copilot July 16, 2025 01:09
Copy link

@Copilot Copilot AI left a comment

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 enhances the parachute model by introducing geometric parameters (radius, height) and porosity, updating simulation calculations accordingly, and aligning tests and documentation.

  • Added parachute_radius, parachute_height, and porosity to Parachute and add_parachute API
  • Updated u_dot_parachute to compute added mass and gravity using the new parameters
  • Updated tests and user guides to include the new parameters

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rocketpy/rocket/parachute.py Added radius, height, and porosity attributes & serialization
rocketpy/rocket/rocket.py Extended add_parachute signature and docstrings
rocketpy/simulation/flight.py Incorporated geometry and porosity into mass & force calculations
tests/unit/test_utilities.py Updated expected safety_factor for infinite Mach
tests/unit/test_flight.py Updated expected final time in aerodynamic test
docs/user/rocket/rocket_usage.rst Added new parameters to usage examples
docs/user/first_simulation.rst Added new parameters to example
README.md Added new parameters to README example
Comments suppressed due to low confidence (1)

rocketpy/simulation/flight.py:1999

  • The new parachute_radius, parachute_height, and porosity parameters are not explicitly covered by existing tests. Consider adding unit tests that verify how changes in these parameters affect added mass and drag force calculations in u_dot_parachute.
        porosity = self.parachute_porosity

# Calculate added mass
ma = ka * rho * (4 / 3) * np.pi * R**3
ma = ka * rho * (4 / 3) * np.pi * parachute_radius**2 * parachute_height
Copy link
Preview

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

The added mass calculation uses the full ellipsoid volume (4/3·π·a²·c) but the parachute is modeled as a hemispheroid; this should use half the volume (2/3·π·a²·c) to correctly compute added mass.

Suggested change
ma = ka * rho * (4 / 3) * np.pi * parachute_radius**2 * parachute_height
ma = ka * rho * (2 / 3) * np.pi * parachute_radius**2 * parachute_height

Copilot uses AI. Check for mistakes.

@ArthurJWH ArthurJWH self-assigned this Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Next Version
Development

Successfully merging this pull request may close these issues.

None yet

2 participants