diff --git a/CHANGELOG.md b/CHANGELOG.md index dce368bc8..ab6672802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,14 +31,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/). Attention: The newest changes should be on top --> ### Added - + - ENH: adds axial_acceleration attribute to the Flight class.- issue #529 [#834] (https://github.com/RocketPy-Team/RocketPy/pull/834) ### Changed + + - ENH: _MotorPrints inheritance - issue #460 [#828](https://github.com/RocketPy-Team/RocketPy/pull/828) - MNT: fix deprecations and warnings [#829](https://github.com/RocketPy-Team/RocketPy/pull/829) + ### Fixed diff --git a/README.md b/README.md index 15127e966..3eb63c9a6 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ [![Instagram](https://img.shields.io/badge/Instagram-E4405F?style=flat&logo=instagram&logoColor=white)](https://www.instagram.com/rocketpyteam) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=flat&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/rocketpy) [![DOI](https://img.shields.io/badge/DOI-10.1061%2F%28ASCE%29AS.1943--5525.0001331-blue.svg)](http://dx.doi.org/10.1061/%28ASCE%29AS.1943-5525.0001331) +[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/RocketPy-Team/RocketPy) # RocketPy diff --git a/rocketpy/simulation/flight.py b/rocketpy/simulation/flight.py index 7d2693a0a..fe11c81be 100644 --- a/rocketpy/simulation/flight.py +++ b/rocketpy/simulation/flight.py @@ -2773,7 +2773,25 @@ def direction_cosine_matrixes(self): Kt = np.array([Matrix.transformation(row).transpose for row in stacked_arrays]) return Kt - + + @cached_property + def acceleration_earth_to_body_frame(self): + """Acceleration in body frame obtained using inertial frame acceleration + at each time step.""" + Kt = self.direction_cosine_matrixes + + acceleration_earth = np.array( + [ + self.ax.y_array, + self.ay.y_array, + self.az.y_array, + ] + ).transpose() + acceleration_body = np.squeeze( + np.matmul(Kt, acceleration_earth[:, :, np.newaxis]) + ) + return acceleration_body + @cached_property def stream_velocity_body_frame(self): """Stream velocity array at the center of dry mass in the body frame at @@ -2790,7 +2808,7 @@ def stream_velocity_body_frame(self): np.matmul(Kt, stream_velocity[:, :, np.newaxis]) ) return stream_velocity_body - + @funcify_method("Time (s)", "Angle of Attack (°)", "spline", "constant") def angle_of_attack(self): """Angle of attack of the rocket with respect to the freestream