Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 20 additions & 2 deletions rocketpy/simulation/flight.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of coding, it is quite fine to me already.
I would just say that we need to implement unit tests for this method before merging.

@MateusStano, what do you think in terms of physics/dynamics? Anything to comment on?

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down