Using AI to Design a Wing Part One


If it is possible to transform a blob into a beautifully streamlined fuselage using AI, it is possible to design a wing too. That does not mean it is easier however; wings are a lot more delicate to design than a fuselage. We cannot just run our drag minimizing scripts on the wings and expect them to not mess anything up.

What We Need To Worry About

There are two sets of things we need to worry about. There are issues that translate into boundary conditions (i.e. don’t do that and we’re fine), and issues that translate into a heuristic (i.e. I can afford a little of this, to get a little of that). In other words, there are tings we can simply avoid altogether, and other things we will have to juggle with, to find the best solution. Let’s begin with the boundary conditions of our problem:

  • Center of lift’s position in relation to the center of mass. We need the center of lift constantly behind the center of mass at full load and minimum load

  • Wing loading needs to remain within legal and safety standards. Gliders have a maximum wing loading in the 40kg/m² to 50kg/m²

And now the things to juggle with when designing a heuristic:

  • The lift generated by the wings at the expected flight speeds. We need to make sure we have a speed range wide enough.

  • The drag induced. Changes in the wing profile greatly change drag as a function of speed.

  • Wing area distribution contributes to wing resistance. A wing with a long chord is more resistant than a wing with a small chord.

  • Wing height affects lift coefficient and drag

  • Flutter effects caused by the resonant frequencies of the wing

  • Wing tip stalls can happen more often on some types of wings

Let’s explore these in more detail before translating them into terms our AI can understand.

Finding Perfect Lift

If you’ve ever taken an instruction flight, you’ve heard about the “glide speed”. This is the speed at which you have to fly, to ensure you can glide the furthest distance possible. On a Cessna 172 it is something like 65kt. On a paraglider you reach this speed when you let the weight of your arms pull the break lines. But what does it mean in physics terms?

The best glide speed is defined by the speed that yields the furthest distance travelled by height lost. The reason gliders lose altitude constantly, is that they lose energy to air resistance. Wind resistance has a strange relationship with speed; it begins as a linear relationship (for every speed you gain, you gain a drag), and progresses to an exponential relationship (you have 4 speeds, you get 16 drags). Then it changes again when you break the sound barrier, but that’s something for another day. The effect of drag in a glide, is easy enough to understand. It steals some of the kinetic energy generated by your descent. If you want to go faster, you need to descend faster (and thus get even more energy stolen).

Meanwhile, what defines how fast you will descend is the lift generated by your wings. And to generate lift, the wings need air flowing around them. The relationship between lift and speed is linear, thankfully. The faster the better.

Now you see: you cannot minimize drag, otherwise you get no lift. Likewise, you cannot optimize speed, otherwise drag becomes too high. There is a sweet spot we can find somewhere between going fast with a lot of lift and going slow with little drag, where the ratio of speed generated to rate of descent is at a maximum. Different wing shapes will have a different sweet spot; small wings generate less drag, so they can afford to fly faster. Large wings generate more drag, so the best glide ratio happens at lower speeds. Unfortunately, we cannot determine the wing shape solely based on these facts, there are several other aspects that need to be considered:

Flutter Effect

The flutter effect is a scary thing that can happen to any wing in very specific conditions. It is a manifestation of a phenomenon resulting from resonant frequencies of coupled oscillators. Let me explain using simple examples.

Imagine we have an unbalanced wheel spinning on an axle. Having it’s center of mass not aligned with the axle will cause the wheel to oscillate about the axle. Its oscillation frequency will directly translate to the wheel’s angular velocity (a.k.a. how fast it’s spinning). Now imagine a simple spring that can travel in one of two directions; it can be compressed and it can be pulled. When we compress it and let it lose, it will oscillate at a specific frequency, which is directly proportional to the spring constant, and inversely proportional to its mass. This frequency does not change, regardless of distance travelled.

Now imagine we attach this wheel’s axle to the end of the spring. They will oscillate together in an awkward way. For the most part, both oscillations will cancel each other out, resulting in odd spikes of movement. It will mostly not make anything interesting to look at. Here is what two oscillators with different natural frequencies look like when coupled together. But the wheel’s frequency can change if we spin the wheel faster or slower. What happens when the wheel’s frequency matches the natural frequency of the spring? Magic. The movement of both oscillators suddenly matches, as they seem to enter in harmony. You have likely noticed this exact scenario if you’ve ever driven a car with grossly unbalanced wheels. After a snow storm, snow always gets in my car’s wheels. When driving at slow speeds, the snow doesn’t really have an effect on the drive; the frequency of the wheel’s oscillation does not match the suspension’s natural frequency. But when I get to somewhere between 90km/h and 110km/h, the vibration becomes unbearable and dangerous. If I speed up to above this “danger zone”, the vibration goes away.

The same happens almost everywhere we look, in different mediums and frequencies. A guitar’s string for example, will also vibrate at a natural frequency. This is why if you pluck a guitar string, it will always play the same note. Vibration in the string can be induced by air, by playing the same exact note; this can be noticed if you play the 6th string of a guitar on the 12th tab. The 1st string will also begin vibrating, because they both share the same natural frequency, which musicians call ‘E’ or ‘mi’ (I’m assuming your guitar is tuned). Anyway, here’s another blog post explaining more of the physics behind this.

There is another thing to note about this effect. coupled oscillations can enter harmony at different frequencies. On a guitar, the 1st and 6th string play the same note, but they are an octave apart. Any frequencies that are separated by octaves will also resonate. These are called harmonics, and they will make our lives more difficult.

How does this apply to airplanes? Wings can move, so they have a natural frequency. As the air moves around a wing, it exerts forces on the wing. These forces induce movement on the wing, and movement on the wing induce other forces in exchange. The magnitude of these forces is directly proportional to the velocity of the air. In order to oscillate like our car wheel or guitar strings do when we reach the right speed or right note, our wing needs the right pressures. What we get then is an oscillation with an amplitude that either remains constant, or increases. Very beautiful to watch, but also very scary. Our airplane’s wing will have a natural frequency, every airplane’s wing does (nay, everything has a natural frequency). The question now becomes: how do we make it not dangerous?

There are two ways to make something scary less scary:

  1. Face it, and show yourself you can beat it

  2. Guarantee you never have to see it

By this I mean: either make the glider wings and prove that they are resistant to flutter, or make sure we will never reach the magical flutter speed. Let’s see what each implies

Nope, No Flutter, Thank You Kindly

The most sensible way to completely avoid flutter would be to maximize the natural frequency of the wings. In other words, we want really really fast oscillations induced by really really high pressures. This can be done it two ways. Observe the natural frequency function of a cantilever beam (the closest model to a wing):

equation

Here, alpha is a constant defined by the natural frequency number, E is the modulus of rigidity, I the moment of inertia, m the mass, and L the length of the wing (not the wingspan). It seems we have three things to play with: the mass distribution across the wing, the size of the wing, and the elasticity of the wing. Specifically, the wing length needs to be minimized, the mass of the wing needs to concentrate towards the fuselage, and the “stiffness” of the wings needs to be maximized.

Yes, Flutter Please

The biggest issue with this effect is the toll it has on the structure of the whole airplane. Naturally, the airframe will need to survive being bent drastically to ensure it won’t just explode during flight. But this is not the only worry; control surfaces will also have a harder time to do their job. If we do get flutter with a large amplitude, lift and roll will be affected. This means we cannot afford having large amplitude vibrations on an airplane, which is very hard to achieve with large wings. To simplify things, this is what we have to do:

  1. create a design that is very resistant and test it

  2. minimize the wing coupled oscillation amplitude range

The first point is outside of the scope of this post, so we won’t talk about this for now. For the second, we have a few options. The amplitude of an oscillation is generally defined by the initial potential energy of the system (or how far you pull the swing, how hard you compress the spring, how hard you pluck a string, etc). In most oscillatory systems the total energy slowly dissipates as a function of time and the amplitude decreases. This does not necessarily apply to systems that have an inflow of energy, which we do (the propeller). It is possible that once at harmonious velocity (I’m coining this term referring to the indicated airspeed(s) at which flutter occurs assuming ideal temperature, pressure and humidity) the amplitude will increase gradually. This can lead to obscene energy loss (and thus slowing the aircraft down), or simply the destruction of the wings.

No thank you is what I’m thinking. In this case it is better to guarantee that we will never encounter flutter, than to prepare for it (not that we shouldn’t build wings that can resist heavy bending). Now, how do we translate this into terms our algorithm can understand? Glad you asked.

  • Wing length: this is self explanatory, the algorithm can increase/reduce the wing length as it progresses. The wing length will need to remain within set bounds states at the beginning of the article

  • Wing mass distribution: the initial design that we are optimizing has no control over what exists inside the wing. It can however mess with the volume distribution of the wing, which in turn affects the mass distribution of the wing. Even with no components inside, a larger wing cross-section will happen to relate to a heavier wing section. Thus, by moving the wing’s center of mass closer to the fuselage, we can push the bounds of flutter away

  • Wing elasticity: this step of the design does not touch on the building materials of the airplane. These were loosely outlined in the previous post. This stage of the design has no power to determine the amount of layers of fiberglass or internal structure of the wings. It can dictate the shape of the wings, which also has an effect on elasticity. Thicker wings will generally be stiffer than thinner wings.

Wing Tip Stalls

This effect is a little more common than flutter, but it is equally scary. I remember a particular flight training session, where I was doing stalls. As I approached the stall speed I felt a gust of wind, and instinctively corrected it by rolling (big mistake, I should’ve used the rudder). This caused my left wing to roll up as I was expecting, then suddenly it simply dipped down, and I went on a dagger stall (like a fighter jet, but scary). This was done in a controlled environment, and I was able to regain speed to climb back to a safe altitude. But I learned my lesson and now I take it easy on the ailerons when doing slow approaches.

This effect is rather easy to understand: wings require a minimum pressure caused by the air moving around them to generate lift. It can happen that low air speeds or disturbances in the air cause turbulence around the wing, which turns it useless. That is what we call a stall. A wing tip stall is a stall that happens on one wing only, generally caused by the combination of low speeds and turns. When an airplane is turning, the wing in the inside of the turn has a slower flow of air and is more prone to stalling than the wing on the outside of the turn. Likewise, if you roll, the wing that is going up will require more lift than the one going down. This will cause the wing going up to be more prone to stalling if the air pressure around it is lower than expected. This is what happened to me on that particular day.

Some types of wings are more prone to stalling than others, and some have more dangerous stall effects than others. Aircraft with straight wings (where the ribs at the root are identical to the ribs at the tips) are more prone to wing tip stalls. Aircraft with tapered wings (where the ribs at the tips are smaller than the ribs at the root) tend to stall at the root first. Aircraft with swept back wings (such as a MIG-21) have a variation of center of lift as they stall; if they stall at the wing tips, the center of lift moves forward. This is dangerous.

There are two main ways to avoid wing tip stalls:

  • Smaller ribs at the tips require less pressure to remain afloat

  • Reducing the angle of attack on the tips of the wings (washout)

In the context of this project, this means that the wing ribs must decrease in size as they travel outward from the fuselage, and the angle of incidence must decrease to 0 at the tip of the wing.

This Amount Of Thinking Demands A Proper Ambiance

Doesn’t it? This is why I decided to create the perfect spotify playlist for this kind of analysis. It’s called “Super Fun Phyisics Time”, and it helped me pass Quantum Mechanics when I was in university. I find the mix of neo-classical with instrumental electronic music does a good job of keeping you focused and motivated. You can find it here. For the next post (when the writing of the heuristic function will happen) I will require a more “hacker-y” soundtrack. So I also have one for that, it’s called Programming Soundtrack, and features more rhythmic electronic music meant to entice you to type like a hacker.

The Heuristic Function

Now we need to put all of what we outlined above (or whatever we can) into a heuristic. Let’s go over the points outlined in the beginning of the article, but with some more refined information:

  • The tests will be run at three different speeds (to be determined)

  • Wing shape must have decreasing ribs, where each rib must be smaller than or equal to its neighbor rib closest to the fuselage

  • Ribs’ angle of attack must decrease from an initial point determined by the AI to 0° for the last rib, where each rib’s angle of attack must be smaller than or equal to its neighbor closest to the fuselage

  • Wings center line must be perpendicular to the fuselage (no funky swept back/forward wings)

  • An expected glide ratio will be calculated based on the drag coefficient, the lift coefficient, and the speed of the test. Let us call this glide ratio r

  • An approximation of the natural frequency of the wing will be calculated using the wing’s shape (assuming constant wing density), fiberglass elasticity data provided by manufacturers, length, and the equation of the natural frequency of a freely oscillating beam outlined above. Let us call the natural frequency fn

  • The factor of fn x r will be returned as the heuristic value and it must be maximized by the AI, thus yielding the highest glide ratio at the highest harmonious velocity

That’s it for this post, I spent way too much time overthinking this.

Thanks!

See my previous post 🙂

-by Eduardo”