-
-
Notifications
You must be signed in to change notification settings - Fork 189
ENH: Implementing 3-dof-simulation #745
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
base: develop
Are you sure you want to change the base?
Conversation
ENH: adds 3 DOF simulation capability to rocketpy.Flight. *ENH: added "u_dot_3dof" for "solid_propulsion" mode *ENH: adding "u_dot_generalized_3dof" for "standard" mode (still incomplete) *ENH: new parameter "simulation_mode" for swtiching between 3 dof and 6 dof *ENH: updated conditions for "__init_equations_of_motion" *ENH: 2 new example files have been created to test 3 dof model "test_bella_lui_flight_sim" and "test_camoes_flight_sim"
Thank you for your interest in implementing 3-DOF in RocketPy, @aZira371 . I will try to take a better look into it, but I notice one thing already: use
|
ENH: adds 3 DOF simulation capability to rocketpy.Flight. *ENH: added "u_dot_3dof" for "solid_propulsion" mode *ENH: added "u_dot_generalized_3dof" for "standard" mode *ENH: new parameter "simulation_mode" for swtiching between 3 dof and 6 dof *ENH: updated conditions for "__init_equations_of_motion"
ENH: fixed standard 3 dof *MNT: Cleaned up the "u_dot_3dof" and "u_dot_generalized_3_dof" *MNT: Corrected Typos in "simulation_mode" description *ENH: "u_dot_generalized_3_dof" fixed and tested on examples.
|
2931c30
to
7864590
Compare
…into enh/3-dof-simulation
…otor ENH: added "BaseRocket" and "PointMassRocket" to rocket class ENH: added "PointMassMotor" to motor class with various input cases of thrust values
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #745 +/- ##
===========================================
- Coverage 79.09% 78.73% -0.37%
===========================================
Files 96 98 +2
Lines 11583 12118 +535
===========================================
+ Hits 9162 9541 +379
- Misses 2421 2577 +156 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
DEV: Master to v1.9.0
…tPy-Team#794) * DEP: Add deprecation warnings for outdated methods and functions * DEP: Remove deprecated methods for NOAA RUC soundings and power drag plots * DEV: changelog * MNT: ruff * DEP: Update deprecation warning for post_process method to specify removal in v1.10 * MNT: Remove unused imports
…e tests ENH: Added a new jupyter notebook for a simplified 3 DOF example MNT: PointMassMotor intialization error fixed MNT: PointMassRocket properties enhanced based on the example runs
MNT: Cleaned up the flight class u_dot_generalized_3dof TODO: Add info for 3 dof cases and fix some new issues when parachute is added.
…cketPy into enh/3-dof-simulation
self, | ||
thrust_source, | ||
dry_mass, | ||
thrust_curve=None, |
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.
What is this parameter? It seems not to be used in any of the attributes of the class (besides the validation schema). Have I misunderstood anything?
""" | ||
if isinstance(thrust_source, (Function, np.ndarray, str)): | ||
if thrust_curve is None or propellant_initial_mass is None: | ||
raise ValueError("thrust_curve and propellant_initial_mass are required for csv, Function, or np.array inputs.") |
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.
Of course this is just aesthetics and is not a priority since the PR only came out of draft state, but this string is too long. In order to comply to the 80 chars limit, I would break it into more lines, I believe the linter does not handle it automatically.
The same is valid for the other raises.
mach = free_stream_speed / speed_of_sound | ||
|
||
# Drag computation | ||
if t < self.rocket.motor.burn_out_time: |
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.
Shouldn't the time be in the interval of burn start and burn out? Do you know @MateusStano ?
"""Returns the thrust of the motor as a function of time.""" | ||
return self.thrust_source | ||
|
||
@funcify_method("Time (s)", "Acceleration (m/s^2)") |
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.
The output annotation and units are not correct.
return self._propellant_initial_mass | ||
|
||
@property | ||
def is_point_mass(self): |
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.
This property does not make too much sense to me if it is not shared among all motors (e.g. using solid_motor.is_point_mass -> False
). My recommendation would be using isinstance
, unless it is used in a performance critical scenario (e.g. a long loop).
motor_mass_func = ( | ||
self.motor.total_mass if hasattr(self.motor.total_mass, "get_value_opt") | ||
else Function(lambda t: self.motor.total_mass) | ||
) |
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.
This check seems to be in place in order to convert to a Function
the self.motor.total_mass
if it is not one. However, the attribute from the motor class is annotated with funcify
, so it will always be a Function
.
@funcify_method("Time (s)", "Acceleration (m/s^2)") | ||
def total_mass(self): | ||
"""Returns the constant total mass of the point mass motor.""" | ||
return self.dry_mass |
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.
To me it makes sense to evaluate the mass_flow_rate
of a point mass motor if the user inputs a thrust curve. The schema would be quite similar to what is already done in the Motor
parent class (e.g. Motor.total_mass_flow_rate
). Let me know what you think about it.
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest tests -m slow --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Current behavior
for issue #655
New behavior
(DRAFT)
ENH: adds 3 DOF simulation capability to rocketpy.Flight.
*ENH: added "u_dot_3dof" for "solid_propulsion"
mode
*ENH: adding "u_dot_generalized_3dof" for "standard" mode (still incomplete)
*ENH: new parameter "simulation_mode" for swtiching between 3 dof and 6 dof
*ENH: updated conditions for "__init_equations_of_motion"
*ENH: 2 new example files have been created to test 3 dof model "test_bella_lui_flight_sim" and "test_camoes_flight_sim"
Breaking change
Additional information
This is a draft pull request!
Equations of motion have been modified in such a way that values related to various rotational dofs is set to zero.