Skip to content

ENH: estimate parachute opening shock force (#161)#1072

Open
wuisabel-gif wants to merge 2 commits into
RocketPy-Team:developfrom
wuisabel-gif:enh/parachute-opening-shock-force
Open

ENH: estimate parachute opening shock force (#161)#1072
wuisabel-gif wants to merge 2 commits into
RocketPy-Team:developfrom
wuisabel-gif:enh/parachute-opening-shock-force

Conversation

@wuisabel-gif

Copy link
Copy Markdown

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Tests for the changes have been added
  • Docs have been reviewed and added / updated (new attribute, parameter, and method docstrings)
  • Lint passes locally (ruff check and ruff format --check; pylint 10/10 on the touched files)
  • Affected unit suites pass locally (test_parachute.py, test_stochastic_parachute.py, test_parachute_triggers.py — 20 passing); relying on CI for the full slow suite
  • CHANGELOG.md updated

Current behavior

Parachute models drag (cd_s) and trigger conditions but has no estimate of the opening shock force — the peak transient inflation load on the recovery harness. Users can't size shock cords/bulkheads from a simulation, and the peak load is typically several times the steady-state drag. This is #161.

New behavior

Adds the standard Knacke approximation (Parachute Recovery Systems Design Manual, §5.5) as an opt-in estimate:

  • New optional opening_shock_coefficient (Cx) on Parachute (lumps the opening-force coefficient and the infinite-mass factor X1, per the issue). Defaults to None, so behavior is unchanged unless set.
  • New Parachute.evaluate_opening_shock_force(air_density, velocity)Cx · q · cd_s with q = 0.5·ρ·v². Raises if the coefficient wasn't set.
  • Round-tripped through to_dict/from_dict.

Unit tests cover the formula, that it exceeds steady drag, scaling, the disabled-by-default guard, and dict round-trip.

Breaking change

  • No

opening_shock_coefficient defaults to None (feature off); nothing changes for existing code.

Additional information

This PR intentionally scopes to the Parachute-level estimate. The issue also asks for automatic capture during Flight (criterion 3), which involves a couple of design choices I'd like your input on before wiring:

  1. Where to store the result — mutating the shared Parachute object is unsafe for Monte Carlo reuse; I'd suggest storing on Flight (e.g. a {parachute_name: force} mapping or extending parachute_events). (Note the issue's flight.parachutes[0].opening_shock_force example can't work as-is, since deployed parachutes are removed from flight.parachutes.)
  2. Which velocity — freestream speed at trigger vs. at end of the deployment lag (line-stretch), since the rocket is in free-fall during the lag.

Happy to add the Flight integration in this PR or a follow-up once you confirm the preferred approach.

Addresses #161

@wuisabel-gif
wuisabel-gif requested a review from a team as a code owner July 19, 2026 04:01
wuisabel-gif added a commit to wuisabel-gif/RocketPy that referenced this pull request Jul 19, 2026
@wuisabel-gif
wuisabel-gif force-pushed the enh/parachute-opening-shock-force branch from 83a991a to 9004d00 Compare July 19, 2026 04:20
@Gui-FernandesBR

Copy link
Copy Markdown
Member

duplicated #1050

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.18%. Comparing base (e0ff281) to head (9004d00).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1072   +/-   ##
========================================
  Coverage    82.18%   82.18%           
========================================
  Files          122      122           
  Lines        16355    16361    +6     
========================================
+ Hits         13441    13447    +6     
  Misses        2914     2914           

☔ View full report in Codecov by Harness.
📢 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