RocketPy icon indicating copy to clipboard operation
RocketPy copied to clipboard

ENH: implementation of quasi static attitude variation to improve lateral motion of 3 DOF

Open aZira371 opened this issue 1 month ago • 0 comments

Is your feature request related to a problem? Please describe.

The 3-DOF flight simulation keeps a fixed attitude throughout the flight. The quaternion derivatives are always zero, meaning the body axis direction never evolves despite changes in the relative wind direction.

Describe the solution you'd like

Introduces an evolving unit direction vector for the body axis using a quasi-static weathercocking model. The rocket's attitude gradually aligns toward the relative wind direction.

Changes:

  • New weathercock_coeff parameter in Flight.init (default: 1.0)
  • Updated u_dot_generalized_3dof to compute quaternion derivatives proportional to misalignment with relative wind
  • Angular velocity = weathercock_coeff * sin(misalignment_angle)
  • Added example notebook docs/examples/bella_lui_3dof_vs_6dof_comparison.ipynb comparing 6-DOF and 3-DOF simulations

How the Weathercocking Model Works:

  • Calculate the current body z-axis direction from quaternions (attitude vector)
  • Calculate the desired direction as the opposite of the freestream velocity (normalized)
  • Compute the rotation axis as the cross product of current and desired directions
  • Apply angular velocity proportional to sin(misalignment_angle) (for quasi-static alignment)
  • Compute quaternion derivatives from this angular velocity

Additional context

Comparison of expected results with and w/o weathercocking:

Image Image

aZira371 avatar Nov 27 '25 12:11 aZira371