-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
ENH: Adding Stability Margin with Mach dependency #377
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the Mach dependency is a great addition.
This PR still needs to be updated to follow snake_case
conventions before approval.
I'm waiting for the #395 PR to be merged before solving the conflicts here. |
…y-Team/RocketPy into enh/new-stability-margin
Hey! I changed a few things, mostly structure wise.
Think this is ready for a review |
Good work, @MateusStano , thank you so much for improving the stability margin calculation in RocketPy, this was a huge gap since the beginning. I made some small adjusts to improve plots and prints. You can check them by my last 2 commits. I want to approve this PR by I was the one who created. |
self.static_margin.set_source( | ||
lambda time: (self.center_of_mass(time) - self.cp_position(0)) | ||
/ (2 * self.radius) | ||
* self._csys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problems with this, but out of curiosity why define a lambda
source and discretize right after?
Wouldn't it work using Function
operations directly? (same comment to the stability_margin
evaluation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, static_margin used to break pretty badly with some liquid and hybrid motors. We added this discretization when developing the liquid and hybrid motors, but it might have been done before we started discretizing things in those classes
I just tested it and it seems it can be remover without issues
Co-authored-by: Pedro Henrique Marinho Bressan <[email protected]>
…y-Team/RocketPy into enh/new-stability-margin
Pull request type
Please check the type of change your PR introduces:
Pull request checklist
Please check if your PR fulfills the following requirements, depending on the type of PR:
Code base additions (for bug fixes / features):
black rocketpy
) has passed locally and any fixes were madepytest --runslow
) have passed locallyWhat is the current behavior?
flight.staticMargin
doesn't seem good enough nowadays. It do not consider the variation of the center of pressure position as the mach number varies during the flight.What is the new behavior?
stabilityMargin
attribute, while the trajectory simulation is not being affected.Does this introduce a breaking change?
Other information