RocketPy-Team / RocketPy

Next generation High-Power Rocketry 6-DOF Trajectory Simulation
https://docs.rocketpy.org/
MIT License
570 stars 137 forks source link

ENH: Pre-calculate attributes in Rocket class #595

Closed Gui-FernandesBR closed 1 month ago

Gui-FernandesBR commented 1 month ago

Pull request type

Checklist

Current behavior

The u_dot_generalized method is quite slow...

New behavior

Some calculations are now being done directly in the Rocket class, so the u_dot_generalized only needs to get it from the Rocket object, instead of calculating it repeatedly.

Breaking change

Additional information

This PR requires #594 to be merged.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 94.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.37%. Comparing base (fc6804c) to head (61ebbc7). Report is 3 commits behind head on develop.

Files Patch % Lines
rocketpy/simulation/flight.py 85.71% 2 Missing :warning:
rocketpy/rocket/aero_surface.py 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #595 +/- ## =========================================== + Coverage 73.31% 73.37% +0.05% =========================================== Files 57 57 Lines 9436 9453 +17 =========================================== + Hits 6918 6936 +18 + Misses 2518 2517 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MateusStano commented 1 month ago

Is there nothing in the other udots that can be changed to something saved in the rocket class or that can use the new derivative?

Might as well go all the way here

MateusStano commented 1 month ago

Is there nothing in the other udots that can be changed to something saved in the rocket class or that can use the new derivative?

Might as well go all the way here

nvm just saw your other PR

Gui-FernandesBR commented 1 month ago

Is there nothing in the other udots that can be changed to something saved in the rocket class or that can use the new derivative?

Might as well go all the way here

This is a good suggestion. I changed a few attributes in the old u_dot that might be helpful.