Advertisement

2d Aeroplane physics

Started by January 26, 2003 06:01 PM
0 comments, last by Blechx 22 years ago
Hi guys! Im a bit new to physical modelling and i'm trying to make a 2d aeroplane-thingy. I understand that i need to calculate different forces and the ones i thought of was: 1. G Gravity, straight down. 2. L Lifting-force, upwards relative to the planes rotation. 3. A Acceleration, in direction of the plane 4. R air resistance, the opposite direction from the velocity. Correct me if im wrong but isnt R = v^2? I just dont know how to connect all this into changing the velocity of the plane every frame. Thanks! [grhodes_at_work edit: trying to get word wrap working] [edited by - grhodes_at_work on January 27, 2003 1:01:23 AM]
This topic comes up from time to time, and in fact there was another thread last week on the same subject, so you might want to browse the past week or so threads.

You will get more responses, including probably a link or offer for some code from forum members who have written flight simulators, but I'll add a couple of quick comments. This may seem very technical, but it comes from my educational background as an aerospace engineer.

Your item #1 is not quite correct. Gravity is not a force. It is an acceleration constant. It causes a force equal to the weight of the airplane to act towards the center of the Earth.

Your item #2, definition of L is incomplete/slightly wrong. Actually, the lifting force acts in a direction that is perpendicular to the airplane's velocity relative to the wind. When you use the word rotation, you might imply that the airplane is in the process of rotating, e.g., rotation might be interpreted as "rotational velocity", but this is not the case. Hence, I prefer to state the definition differently, just in terms of the angle of motion relative to the wind.

Your item #3 is not a force, and doesn't belong in the list. Acceleration may result if there is an inbalance in the actual forces and moments. See my last paragraph.

You are partially correct about R, but it is not equal to v2. Air resistance, more commonly called drag for airplanes, is a function of the square of velocity. But it is also a function of air density, and a measure of the airplane's size (usually wing area). The way drag is defined for an airplane is:

Drag = 0.5*CD*rho*V2*S  


Here, CD is a drag coefficient---more about this later, rho is air density, V is the airplane's velocity relative to the wind, and S is the wing area. For a quick-and-dirty solution, CD can be written in terms of a lift coefficient, CL, and a few other constants:


CD = CDo + k*CL2
[code

Where CDo is the drag at zero lift (pure skin friction drag for subsonic airplanes) and k is a measure of the spanwise efficiency of the wing. k will typically be less than 1. In fact, it is a function of the wing aspect ratio and wing sweep, as well as fuselage interactions, etc. You might pick a value of 0.5 as a good test case.

Now, a quick an dirty formula for CL is based on angle-of-attack, the angle of the airplane's wing measured relative to its forward velocity. e.g., the wing when generating lift will be oriented slightly higher than the path it is following---this is what defines angle-of-attack, required to generate lift. So,

CL = (dCL/dalpha)*(alpha - zero_lift_alpha)

alpha is angle of attack, zero_lift_alpha is the angle of attack that generates zero lift (never = 0 for real airplanes, but for a game you could let zero_lift_alpha = 0), and dCL/dalpha is the lift curve slope. dCL/dalpha is roughly constant prior to stall, so you can just plug in a number. If you measure alpha in degrees, then dCL/dalpha will typically be on the order of 0.1 (units are "per degree"), and if you measure alpha in radians dCL/dalpha will be on the order of 2*PI (units are "per radian").

Now, just like you can calculate drag from CD and other things, you can calculate lift from CL and the same things:

<br>Lift = 0.5*CL*rho*V<sup>2</sup>*S<br> </pre> <br><br>That 0.5*rho*V<sup>2</sup> that shows up is called the <b>dynamic pressure </b> .<br><br>In addition to lift and drag, for a 2D airplane you need to treat pitching moment, which is a torque measured about the center of gravity of the airplane. In terms of a pitching moment coefficient,<br><br><pre><br>Pitching Moment = Lift = 0.5*Cm*rho*V<sup>2</sup>*S*c<br> </pre> <br><br>Just as drag can be written in terms of lift, so can pitching moment. Here is an approximate formula that works well when the airplane is not near stall:<br><br><pre><br>Cm = Cmo + (dCm/dCL)*CL<br> </pre> <br><br>where Cmo is the zero lift pitching moment. This will be positive for an airplane that is longitudinally stable (which you *want* for a simulator!). dCm/dCL is the slope of the pitching moment curve, which will be negative for a stable airplane, and typically not less than -1/10. Any airplane with a dCm/dCL greater than zero is unstable and if the airplane is too unstable it would need a computer flight stability system to remain under control. For a slightly unstable airplane, a very good pilot might be able to control it in normal flight.<br><br>You need to choose Cmo so that Cm = 0 when CL is a value that will cause a lift that exactly balances the weight of the airplane at a good cruise velocity. This point where Cm is 0 is called the "trim" point, the point where the airplane has no tendency to rotate upwards or downwarsd. You see, ideally, when the airplane is in cruise, you don't want it to be pitching up or down heavily---you want it to be in trim!<br><br>where Cm is the pitching moment coefficient, and I've also added c, which is a reference or average wing chord length. The S and c are used to ensure that the coefficients have no units. They work just as well for English and Metric/SI units.<br><br>The three aerodynamic forces (lift, drag, pitching moment) plus the weight of the airplane and engine thrust make up the complete set of external forces that interact &#111;n an airplane in flight. You also have internal forces generated by the airplane's inertia tensor (mass, moments of inertia). And these forces have to be integrated/updated over time to simulate the flight. This is where sample code from folks here who have written flight simulator games will come in very handy! They may also very likely have more accurate models for lift and drag than I've presented here. The formulas above are decent for an airplane in straight and level flight, but are very approximate in general flight, such as turning, maneuvering, takeoff, landing, etc.<br><br>Hope that helps! <br><br>Graham Rhodes<br>Senior Scientist<br>Applied Research Associates, Inc.<br><br><SPAN CLASS=editedby>[edited by - grhodes_at_work &#111;n January 27, 2003 1:02:25 AM]</SPAN>
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

This topic is closed to new replies.

Advertisement