1
$\begingroup$

I'm coding a flight dynamics simulation, but my simulation runs into a problem with negative angles of attack. Once alpha is negative, it is impossible to get back to a state where the plane is generating positive vertical velocity.

At the start of each frame of the simulation we have some forward velocity ($u$) and vertical velocity ($w$), and at the end of each frame we calculate new values for $u$ and $w$. To keep things simple, assume the plane generates 0 lift at 0 alpha, we're always in level flight with no change to pitch or roll, and the pilot only makes changes to $u$ with the throttle.

If $u$ decreases enough that we generate less lift force than gravity, $w$ becomes negative and the plane begins to descend. The usual formula for angle of attack ($𝛼$) is a function of $u$ and $w$:

$𝛼 = arctan(w / u)$

This means a negative $w$ and positive $u$ will always give a negative $𝛼$.

I calculate lift with this equation (simplified. $q$ is dynamic pressure):

$L = 2π * 𝛼 * q$

This means a negative $𝛼$ will always give negative lift.

And finally, the next frame's $w$ is just a function of lift and gravity (in level flight):

$w_{next} = w + L / mass - g$

So it is possible to have positive $𝛼$ and lift but end up with a negative $w$ due to gravity.

If a frame of my simulation ends with negative $w$, the simulation is put in a state where it is impossible to ever return to positive $𝛼$, because negative $w$ always gives negative $𝛼$. Negative $𝛼$ always gives negative $L$. And negative $L$ always gives negative $w_{next}$ Negative $w_{next}$ always gives negative $𝛼$ on the next frame.

Increasing $u$ eventually should return me to positive $L$ and $w$ as $q$ increases, but doesn't - it only generates more negative lift. What factors am I missing to be able to get back to positive $w$ with just an increase in $u$?

$\endgroup$
3
  • 1
    $\begingroup$ I think you simply have one wrong minus sign. Negative w means positive alpha. $\endgroup$
    – Sanchises
    Apr 16 at 5:39
  • $\begingroup$ Also you can only get a constant descent in this situation, you need to pitch up for level flight or climb. But that's a separate issue from correcting your equation. $\endgroup$
    – Sanchises
    Apr 16 at 6:12
  • $\begingroup$ My simulation accounts for a couple more factors like a separate zero-lift AoA so you can achieve level flight in this situation, but I simplified it a bit for the question $\endgroup$
    – Exudes
    Apr 20 at 1:02
2
$\begingroup$

I think your problem is in part, that you assume that $w$ is positive if your aircraft is ascending. The opposite is the case. The aircraft coordinate system is defined as a right-handed system with the z-axis pointing downward. Aircraft coordinate system

This means a positive $w$ indicates that your aircraft is descending.

Therefore, if your plane keeps a constant velocity $u$, the body-fixed downward velocity $w$ will get positive because of the gravity pulling you down. This in turn results in a positive $\alpha$ providing lift. Eventually if you have implemented your simulation correctly, the $\alpha$-angle (and $w$) will oscillate for a bit at the beginning of your simulation, but after finding the steady-state, it will steadily descend with a positive angle-of-attack and a positive value of $w$.

P.S.: For the calculation of $\alpha$ it is very helpful to use the atan2() function, as it correctly discerns the various sign cases.

$\endgroup$
6
  • $\begingroup$ I don't think atan2 is warranted for alpha computations, any flight mechanics book I find has a simple atan and alpha is defined in the +- pi/2 range (consistent with atan) $\endgroup$
    – Federico
    Apr 16 at 9:23
  • $\begingroup$ @Federico atan2 is a broader implementation of atan, and has the same output in the +-pi/2 range as atan, therefore it is just as valid as the atan function. Also alpha is not only defined in this range, for example DIN9300 does not mention any constraints. However if you leave the realms of traditional fixed wing flight (VTOL, Helicopters, Multicopters etc.) with alpha values exceeding +-2pi, I promise you that the atan2() function will save your life safer :D. $\endgroup$
    – U_flow
    Apr 16 at 10:19
  • $\begingroup$ I know very well what atan2 is. I still say that is too much for alpha, since any output outside of the +-pi/2 range given by atan2 are meaningless in my experience, even for rotorcraft (you don't have alpha ~= pi when flying backwards, it is still ~=0 for what concerns the aerodynamic equations) $\endgroup$
    – Federico
    Apr 16 at 10:25
  • $\begingroup$ @Federico no I dont think so. Image a profile in a VTOL application which gets blown at from the back. Or a Helicopter during a CAT-A start which entails flying backwards. In all of these applications you want to capture that the airflow is coming from the back. Dont you think? $\endgroup$
    – U_flow
    Apr 16 at 11:28
  • $\begingroup$ yeah, ok, for craft with significantly asymmetric bodies it might make sense $\endgroup$
    – Federico
    Apr 16 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.