ImperialCollegeLondon / sharpy

Simulation of High Aspect Ratio aeroplanes and wind turbines in Python: a nonlinear aeroelastic code
https://imperial.ac.uk/aeroelastics/sharpy
BSD 3-Clause "New" or "Revised" License
119 stars 58 forks source link

Fixed crv2rotation #281

Closed ben-l-p closed 4 months ago

ben-l-p commented 4 months ago

Found a bug in the conversion from a $\boldsymbol{\Psi}$ vector to a rotation matrix $\mathbf{R}$. This only applies for larger $\Psi$ angles, as the small angle correction (which most "normal" cases will use) is correct.

Intended expression: $$\mathbf{R} = \mathbf{I} + \sin||{\boldsymbol{\Psi}||} \tilde{\boldsymbol{\Psi}} + \frac{1-\cos{||\boldsymbol{\Psi}||}}{||\boldsymbol{\Psi}||^2}\tilde{\boldsymbol{\Psi}} \tilde{\boldsymbol{\Psi}}$$

Used expression: $$\mathbf{R} = \mathbf{I} + \frac{\sin||\boldsymbol{\Psi}||}{||\boldsymbol{\Psi}||} \tilde{\boldsymbol{\Psi}} + (1-\cos{||\boldsymbol{\Psi}||})\tilde{\boldsymbol{\Psi}} \tilde{\boldsymbol{\Psi}}$$

ben-l-p commented 4 months ago

I'm bad at maths, back to the drawing board...