Advertisement

Flight Sim Physics

Started by January 05, 2003 01:11 PM
9 comments, last by ChromaZ28 22 years, 1 month ago
I''m still writing a flight sim. Say a wing''s lift increases with airspeed. So at 100mph there''s enough lift to get off the ground. What keeps the plane (besides weight) from shooting up faster and faster as the airplane speed increases and the angle of attack stays constant. Anyone know anything about coding airplane physics?
Correct me if I''m wrong, but I believe total lift decreases at higher elevations, due to the lower amounts of air. So in the end, anyway, when you get really high, the wings'' lift will slack off a little bit, and should become about even with gravity, so that the plane stays more or less level in that respect.
Advertisement
ChromaZ28,

Your question is actually quite profound. I will try to answer without writing a dissertation. I''ll restate my credentials, for reference. I have both Bachelor''s and Master''s degrees in aerospace engineering with an emphasis on airplane flight dynamics, . If the airplane were able to increase in speed without limits, its lift would continue to increase. At least to a point. Eventually, the fluid flow would likely break down in some way. Or the airplane would break up due to the loads. But there are limits to how fast an airplane actually can fly. In addition to lift, the wing (and fuselage, etc.) generates drag that pulls the airplane back. Drag is a function of airspeed, and increases as the airspeed increases. The airplane uses its propulsion system to counteract the drag, and the airplane can only go faster if it is able to generate more thrust than drag. The airplane flies at constant speed when thrust = drag. The airplane''s maximum speed is limited by that, since to fly faster would mean increasing the drag beyond the engine''s ability to balance it out with thrust. So, given the maximum possible thrust from a given engine, the airplane''s speed is limited and with lift being a function of speed the lift is also limited.

Any flight simulator that needs to be somewhat realistic, even for games, needs to model drag in addition to lift. Keep in mind that with the airplane pointed downwards, gravity itself can act as a thrust, so gravity can be used to model thrust for glider simulation. Also, drag and lift are determined from the airplane''s speed relative to the wind. So if there is a wind, the airplane''s motion relative to the ground can be non-intuitive. With a strong enough wind, an airplane can appear to hover in midair, not moving forward or back, if there is a wind that pushes the airplane backward relative to the ground. In fact, if the wind is strong enough, the airplane can fly backward relative to the ground in a perfectly stable manner. Weird, wild stuff.

CmndrM,

You are right that lift at the same speed and angle of attack decreases at higher elevations. This is due to the fact that lift at given angle of attack and speed is proportional to air density, which decreases when altitude goes up. At the same time, two other interesting things happen. First, air-breathing propulsions systems (jet engine or propellor) have a reduced ability to generate thrust also due to the loss of air density. An engine cannot produce as much thrust high in the air. Since thrust is required to counteract aerodynamic drag, less thrust means a lower drag force can be balanced and this actually limits the airplane''s maximum speed at altitude. The other thing that happens is that, again due to air density changes, the wing becomes less efficient at generating any lift that it does generate. A wing will stall at a lower angle of attack, meaning there is a practical limit to the amount of lift that can be generated. Eventually, when altitude is high enough, a wing will stall out before it is even able to generate enough lift to counteract gravity. The airplane cannot fly any higher than this point, which is the ceiling . Thus, airplanes that rely on wing lift to hold them in the air all have flight envelopes that define both the maximum altitude below which they can fly, but also the range of possible speeds at each altitude. The flight envelope might look something like this.

    ^   a|           ceiling   l|       /-------------/   t|      /             /   i|     /             /   t|    /             /   u|   /             /   d|  /             /   e| /             /    |/             /    ------------------------------->              speed 


Altitude increases up, and speed increases to the right. But the ceiling will not really be flat. It''d be more like a smooth curve touching the ceiling at a point. The airplane can fly at any altitude below the ceiling and between the left curve (stall speed) and right curve (maximum speed at altitude). Now, notice that the range of speeds increases with altitude (for some aircraft). This makes sense for the stall line. The stall speed increases with altitude since the wing is less efficient and must move faster to generate the same amount of lift (remember that the lift at the same speed goes down with altitude). But it doesn''t necessarily make sense that the maximum speed goes up with altitude. Actually, I just can''t draw the curve very well here. The maximum speed does increase to a point, for some types of engines. For example, jet engines are poor at sea level, but work quite well at altitude, so for jet engines the maximum speed would increase. But really, as the altitude approaches the ceiling, all air breathing engines become less efficient and the maximum speed curve would begin to reduce. I just can''t draw that well with ASCII text graphics.

The following link has a better diagram of a set of flight envelopes, though the page does mention technical details beyond what I''ve said above and without any real description.

http://aerodyn.org/Atm-flight/flimit.html#envelope

Notice that the supersonic flight envelope is rather weird. The "M = 1" line indicates the sonic line. Anything to the right of that line is supersonic. The maximum speed curve for this one is very bizarre because of the supersonic engine characteristics.


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
I don''t know much about flight, but from what I do know all you have to do is use variables to represent each law or part of flight, and to work together in a cause and effect type of way. This would be eas to do with C or C++. This would make your code much shorter and efficiant.
)))P(((
Yes, its very much cause and effect, and there are key "laws" such as equations to estimate lift and drag, that must be used at some level of approximation to get any degree of realism. The estimated values don''t have to be perfect, though. There''s plenty of room to use quick-and-dirty equations or tricks.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
quote:
Original post by grhodes_at_work
...In fact, if the wind is strong enough, the airplane can fly backward relative to the ground in a perfectly stable manner. Weird, wild stuff.


It''s not uncommon to see a hawk hovering in the wind and even being pushed backwards by strong gusts. Pretty neat... Good explanation of all these points, btw.

Jason Doucette
www.jasondoucette.com
Jason Doucette / Xona.comDuality: ZF — Xbox 360 classic arcade shmup featuring Dual Play
Advertisement
Hello,

check out this page --> http://www.web-discovery.net/ . The person doign this has a reference page with some articles, including one about the flight model of some miltary sim.
grhodes,
Thanks for the clarification. I''ve been in the books and learned quite a bit about flight physics. The drag vector is opposite the velocity vector and lift is perpendicular to drag. And at times, since the velocity vector can point up that means the drag vector is pointing down pulling the aircraft down also. This means lift is sometimes pointing towards the rear of the aircraft and not straight up. And of course you have gravity pulling downwards also. So the combination drag and gravity (and sometimes lift too if the AOA is past 90 into the negatives) keep the aircraft in check and flying along on a somewhat straight path. I am in the process of implementing the lift coefficient into the lift equation and getting the basic flight controls working.

My prior problems were due to my not calculating the drag and lift vector properly. Now that I have that sorted out, my plane lifts off very nicely. I am having a little trouble with how to deal with the airplane sitting on the ground without the velocity keep indicating it''s still falling and winding into the negative. I know that an object sitting on the ground is constantly colliding with the ground and the ground is pushing back to the object. I just need to model this state and also add in the rolling friction.

Thanks for taking the time to post. I have a B.S. in Management of Technical Operations from Embry-Riddle Aeronautical University. It''s no aerospace engineering degree but I have a keen interest in aircraft and I''m also an F-15 mechanic. So I would like to collaborate further with you if I run into problems...I have a sound vision on where I want this flight sim to go.


>>I''m also an F-15 mechanic

Screw programming - that''s what I call a REALLY cool job!
quote:
Original post by Jason Doucette
It''s not uncommon to see a hawk hovering in the wind and even being pushed backwards by strong gusts. Pretty neat... Good explanation of all these points, btw.


And you know they must be loving it!



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement