Skip to content

Conversation

Copy link

Copilot AI commented Nov 28, 2025

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

Hard-coded radius=1.5 in Parachute.__init__ causes incorrect added mass calculations for smaller parachutes. For drogue chutes (cd_s ≈ 1.0), the added mass was overestimated by ~31x, resulting in excessive drift distances.

Ref: #860

New behavior

Radius is now computed from cd_s when not explicitly provided:

R = sqrt(cd_s / (Cd * π))

Using HEMISPHERICAL_CD = 1.4 (typical hemispherical parachute drag coefficient).

Changes:

  • Default radius parameter changed from 1.5 to None
  • Added HEMISPHERICAL_CD class constant
  • Auto-calculate radius from cd_s when not provided
  • Updated docstrings with formula documentation
  • Updated from_dict to handle new default

Example results:

Parachute cd_s Old radius New radius
Main 10.0 1.5 m 1.51 m
Drogue 1.0 1.5 m 0.48 m

Users can still explicitly set radius to override auto-calculation.

Breaking change

  • Yes
  • No

Existing code providing explicit radius values is unaffected. Code relying on the implicit default will now get physically appropriate values based on cd_s.

Original prompt

This section details on the original issue you should resolve

<issue_title>Remove Hard coded radius value for lateral acceleration in descent under parachute</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

Lateral acceleration for descent under parachute (in the function u_dot_parachute) depends on the air trapped beneath a parachute to determine the mass to divide drag force by. This added mass value depends on the radius R which is hard coded to 1.5
This causes issues with drift distance for smaller rockets and drogue parachutes leading to much higher drift distances than expected

Describe the solution you'd like

Either remove the hard coded value or determine radius based on a hard coded value for the coefficient of drag for a parachute, which is a much more reasonable thing to be hard coded.

Additional context

N/A
</issue_description>

<agent_instructions>Remove Hard coded radius value for lateral acceleration in descent under parachute #860
Open
Task
@RyanSamF
Description
RyanSamF
opened on Oct 24
Is your feature request related to a problem? Please describe.

Lateral acceleration for descent under parachute (in the function u_dot_parachute) depends on the air trapped beneath a parachute to determine the mass to divide drag force by. This added mass value depends on the radius R which is hard coded to 1.5
This causes issues with drift distance for smaller rockets and drogue parachutes leading to much higher drift distances than expected

Describe the solution you'd like

Either remove the hard coded value or determine radius based on a hard coded value for the coefficient of drag for a parachute, which is a much more reasonable thing to be hard coded.

Additional context

N/A

Activity

github-project-automation
added this to LibDev Roadmapon Oct 24

github-project-automation
moved this to Backlog in LibDev Roadmapon Oct 24
Gui-FernandesBR
Gui-FernandesBR commented on Oct 25
Gui-FernandesBR
on Oct 25
Member
Could you help us providing references?

RyanSamF
RyanSamF commented on Oct 25
RyanSamF
on Oct 25
Author
RocketPy/rocketpy/simulation/flight.py

Lines 1969 to 1995 in 2655a4f

ka = 1 # Added mass coefficient (depends on parachute's porosity)
R = 1.5 # Parachute radius

to = 1.2

eta = 1

Rdot = (6 * R * (1 - eta) / (1.2**6)) * (

(1 - eta) * t5 + eta * (to3) * (t**2)

)

Rdot = 0

Calculate added mass

ma = ka * rho * (4 / 3) * np.pi * R**3

Calculate freestream speed

freestream_x = vx - wind_velocity_x
freestream_y = vy - wind_velocity_y
freestream_z = vz
free_stream_speed = (freestream_x2 + freestream_y2 + freestream_z**2) ** 0.5

Determine drag force

pseudo_drag = -0.5 * rho * cd_s * free_stream_speed

pseudo_drag = pseudo_drag - ka * rho * 4 * np.pi * (R**2) * Rdot

Dx = pseudo_drag * freestream_x
Dy = pseudo_drag * freestream_y
Dz = pseudo_drag * freestream_z
ax = Dx / (mp + ma)
ay = Dy / (mp + ma)
az = (Dz - 9.8 * mp) / (mp + ma)

Gui-FernandesBR
added the
Task
issue type 8 hours ago

Gui-FernandesBR
added
Parachute
Related to parachutes methods and usage
8 hours ago
Gui-FernandesBR
Gui-FernandesBR commented 8 hours ago
Gui-FernandesBR
8 hours ago
Member
@RyanSamF when I say "reference", I was actually meaning "bibliometric references". I'm going to search about it.

I have to investigate it better, but I think @ArthurJWH has already solved this one with his recent modifications to the parachute class

Gui-FernandesBR
Gui-FernandesBR commented now
Gui-FernandesBR
now
Member
The main reference for parachute modeling is: https://apps.dtic.mil/sti/tr/pdf/ADA247666.pdf

Also, don't forget to run make format, make lint e make pytest antes de marcar o PR como concluido.

</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@Gui-FernandesBR Could you help us providing references? @Gui-FernandesBR @RyanSamF when I say "reference", I was actually meaning "bibliometric references". I'm going to search about it.

I have to investigate it better, but I think @ArthurJWH has already solved this one with his recent modifications to the parachute class</comment_new>
<comment_new>@Gui-FernandesBR
The main reference for parachute modeling is: https://apps.dtic.mil/sti/tr/pdf/ADA247666.pdf</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 28, 2025 00:43
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>
Copilot AI changed the title [WIP] Remove hard coded radius value for lateral acceleration Fix hard-coded radius value for parachute added mass calculation Nov 28, 2025
Copilot finished work on behalf of Gui-FernandesBR November 28, 2025 00:47
@Gui-FernandesBR
Copy link
Member

@copilot remind to add the PR to the CHANGELOG file

Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 28, 2025

@copilot remind to add the PR to the CHANGELOG file

Added the CHANGELOG entry in commit 314ca47.

Copilot finished work on behalf of Gui-FernandesBR November 28, 2025 01:02
@Gui-FernandesBR Gui-FernandesBR marked this pull request as ready for review November 28, 2025 02:57
@Gui-FernandesBR Gui-FernandesBR requested a review from a team as a code owner November 28, 2025 02:57
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.35%. Comparing base (9cf3dd4) to head (314ca47).
⚠️ Report is 12 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #889      +/-   ##
===========================================
+ Coverage    80.27%   80.35%   +0.08%     
===========================================
  Files          104      106       +2     
  Lines        12769    13013     +244     
===========================================
+ Hits         10250    10457     +207     
- Misses        2519     2556      +37     

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

Copy link
Contributor

@ArthurJWH ArthurJWH left a comment

Choose a reason for hiding this comment

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

The PR seems reasonable and correct, although it will introduce breaking changes to current simulations that relies on the previously hard coded radius. If this PR proceeds, I would suggest first changing the add_parachute default radius value for consistency in rocket class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Remove Hard coded radius value for lateral acceleration in descent under parachute

3 participants