RocketPy-Team / RocketPy

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

MNT: Refactor flight prints module #579

Closed Gui-FernandesBR closed 3 months ago

Gui-FernandesBR commented 3 months ago

Pull request type

Checklist

Current behavior

The code used within the _FlightPrints class is becoming quite outdated. It is basically the same code since rocketpy was created. There are some quick improvements that we can do, while not changing the behavior of the class.

New behavior

The class still gives the same results, but with some refactoring like:

Breaking change

Additional information

Initial Conditions

Initial time: 0.000 s
Position - x: 0.00 m | y: 0.00 m | z: 1471.47 m
Velocity - Vx: 0.00 m/s | Vy: 0.00 m/s | Vz: 0.00 m/s
Attitude (quaternions) - e0: 0.999 | e1: -0.044 | e2: -0.000 | e3: 0.000
Euler Angles - Spin φ : 0.00° | Nutation θ: -5.00° | Precession ψ: 0.00°
Angular Velocity - ω1: 0.00 rad/s | ω2: 0.00 rad/s | ω3: 0.00 rad/s
Initial Stability Margin: 2.590 c

Surface Wind Conditions

Frontal Surface Wind Speed: 3.61 m/s
Lateral Surface Wind Speed: 1.51 m/s
Wind Direction: 157.33°
Wind heading: 337.33°

Launch Rail

Launch Rail Length: 5.2 m
Launch Rail Inclination: 85.00°
Launch Rail Heading: 0.00°

Rail Departure State

Rail Departure Time: 0.414 s
Rail Departure Velocity: 22.713 m/s
Rail Departure Stability Margin: 2.664 c
Rail Departure Angle of Attack: 9.875°
Rail Departure Thrust-Weight Ratio: 7.952
Rail Departure Reynolds Number: 1.664e+05

Burn out State

Burn out time: 3.900 s
Altitude at burn out: 495.223 m (AGL)
Rocket speed at burn out: 212.057 m/s
Freestream velocity at burn out: 211.868 m/s
Mach Number at burn out: 0.625
Kinetic energy at burn out: 4.905e+05 J

Apogee State

Apogee Time: 22.902 s
Apogee Altitude: 3845.312 m (ASL) | 2373.846 m (AGL)
Apogee Freestream Speed: 4.577 m/s

Parachute Events

Parachute: Drogue
    Ejection time: 22.905 s
    Inflation time: 24.405 s
    Freestream speed at inflation: 15.011 m/s
    Altitude at inflation: 3834.365 m (ASL) | 2373.846 m (AGL)
Parachute: Main
    Ejection time: 99.181 s
    Inflation time: 100.681 s
    Freestream speed at inflation: 20.326 m/s
    Altitude at inflation: 2241.511 m (ASL) | 800.551 m (AGL)

Impact Conditions

Time of impact: 222.191 s
X impact: 479.991 m
Y impact: 1528.874 m
Altitude impact: 1471.466 m (ASL) | -0.000 m (AGL) 
Latitude: 33.0040016°
Longitude: -106.9698514°
Vertical velocity at impact: -6.169 m/s
Number of parachutes triggered until impact: 2

Stability Margin

Initial Stability Margin: 2.590 c at 0.00 s
Out of Rail Stability Margin: 2.664 c at 0.41 s
Maximum Stability Margin: 3.657 c at 3.65 s
Minimum Stability Margin: 2.590 c at 0.00 s

Maximum Values

Maximum Speed: 215.533 m/s at 3.44 s
Maximum Mach Number: 0.635 Mach at 3.44 s
Maximum Reynolds Number: 1.518e+06 at 3.36 s
Maximum Dynamic Pressure: 2.292e+04 Pa at 3.38 s
Maximum Acceleration During Motor Burn: 78.654 m/s² at 0.15 s
Maximum Gs During Motor Burn: 8.020 g at 0.15 s
Maximum Acceleration After Motor Burn: 10.368 m/s² at 15.03 s
Maximum Gs After Motor Burn: 1.057 Gs at 15.03 s
Maximum Stability Margin: 3.657 c at 3.65 s
Maximum Upper Rail Button Normal Force: 0.969 N
Maximum Upper Rail Button Shear Force: 2.366 N
Maximum Lower Rail Button Normal Force: 0.621 N
Maximum Lower Rail Button Shear Force: 1.518 N

Numerical Integration Settings

Maximum Allowed Flight Time: 600.00 s
Maximum Allowed Time Step: inf s
Minimum Allowed Time Step: 0.00e+00 s
Relative Error Tolerance: 1e-06
Absolute Error Tolerance: [0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 1e-06, 1e-06, 1e-06, 1e-06, 0.001, 0.001, 0.001]
Allow Event Overshoot: True
Terminate Simulation on Apogee: False
Number of Time Steps Used: 1043
Number of Derivative Functions Evaluation: 2169
Average Function Evaluations per Time Step: 2.080
Gui-FernandesBR commented 3 months ago

Please merge the #572 first!

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 72.66%. Comparing base (2456b11) to head (2a85ce8). Report is 10 commits behind head on develop.

Files Patch % Lines
rocketpy/prints/flight_prints.py 88.37% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #579 +/- ## =========================================== + Coverage 72.65% 72.66% +0.01% =========================================== Files 59 59 Lines 9614 9603 -11 =========================================== - Hits 6985 6978 -7 + Misses 2629 2625 -4 ```

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