Skip to content

Conversation

@Monta120
Copy link

@Monta120 Monta120 commented Dec 2, 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

Flight class calculates rail button normal and shear forces during launch phase but does not compute bending moments at attachment points. This data is needed for structural analysis of airframe and fasteners. See #893.

New behavior

Adds bending moment calculation using beam theory:

New Flight attributes:

  • rail_button1_bending_moment (Function): Upper button bending moment (N⋅m)
  • max_rail_button1_bending_moment (float): Max absolute upper moment
  • rail_button2_bending_moment (Function): Lower button bending moment (N⋅m)
  • max_rail_button2_bending_moment (float): Max absolute lower moment

Formula: M = N × d_CM + S × h_button where:

  • N: Normal reaction force, d_CM: distance to center of dry mass
  • S: Shear force, h_button: button height (cantilever moment)

Unit tests verify non-zero moments with off-axis forces and zero otherwise. Updated Flight.rst docs and CHANGELOG.md.

Breaking change

  • No

Additional information

@Monta120
Copy link
Author

Monta120 commented Dec 2, 2025

@Gui-FernandesBR Apologies for PR #900. It accidentally included unrelated commits. I have since closed it.

Regarding your rail button height concern: I've added a button_height attribute to the RailButtons class (default 0.015m) to account for the cantilever moment from shear forces. The bending moment calculation now uses M = N × d_CM + S × h_button. The implementation assumes simple supports (no moment reaction at rail contact) and uses beam theory with the already-calculated normal/shear forces.

Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

Would you mind updataing flight_plots and/or flight_prints too? including these values to the .info() or .all_info() outputs would be key here.

@Gui-FernandesBR
Copy link
Member

The implementation assumes simple supports (no moment reaction at rail contact) and uses beam theory with the already-calculated normal/shear forces.

@Monta120 did you left any comment about this in the code? Ensure users can read about your assumptions or any simplification.

@Monta120
Copy link
Author

Monta120 commented Dec 2, 2025

The implementation assumes simple supports (no moment reaction at rail contact) and uses beam theory with the already-calculated normal/shear forces.

@Monta120 did you left any comment about this in the code? Ensure users can read about your assumptions or any simplification.

Just added detailed comments in the docstring explaining the simple support assumption (no moment reaction at rail contact), beam theory approach, and both moment contributions (normal force × distance + shear force × height). Also documented and explained in Flight.rst.

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 98.63014% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.77%. Comparing base (9cf3dd4) to head (679b63b).
⚠️ Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
rocketpy/simulation/flight.py 97.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #901      +/-   ##
===========================================
+ Coverage    80.27%   80.77%   +0.50%     
===========================================
  Files          104      107       +3     
  Lines        12769    13374     +605     
===========================================
+ Hits         10250    10803     +553     
- Misses        2519     2571      +52     

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

@Monta120
Copy link
Author

Monta120 commented Dec 3, 2025

Would you mind updataing flight_plots and/or flight_prints too? including these values to the .info() or .all_info() outputs would be key here.

This is also taken care of as of the last commit.

@github-project-automation github-project-automation bot moved this from Backlog to Next Version in LibDev Roadmap Dec 3, 2025
@Gui-FernandesBR Gui-FernandesBR merged commit 4ef7e77 into RocketPy-Team:develop Dec 3, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Next Version to Closed in LibDev Roadmap Dec 3, 2025
@Gui-FernandesBR Gui-FernandesBR linked an issue Dec 3, 2025 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Closed

Development

Successfully merging this pull request may close these issues.

ENH: Calculate Bending Moments on Rail Buttons

2 participants