Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
Hi,
I am trying to understand the physics behind flight simulation, possibly to
program my own at some point in the future. I know the formulas and how to
apply them, but the mystery comes when considering in what order to apply
them.
For example:
The lift formula requires the Lift Coefficient for the Angle(AoA) between
the Airframe and the relative wind(Velocity vector). However, it also
requires the distance traveled squared(V).
This is very simple, but in order to calculate the distance traveled, you
need to know the lift, otherwise the distance cannot be measured.
The easy solution is to use the Lift from the previous calculation, meaning
that the simulation will always be basing the current calculation on the
data(CL, distance traveled, CD etc) calculated the previous calculation.
Is this how it's usually done?
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
"Andy" <aaa_2500X@Xhotmail.com> wrote in message
news:42e03177$0$26279$edfadb0f@dread14.news.tele.dk...
> Hi,
>
> I am trying to understand the physics behind flight simulation, possibly
> to
> program my own at some point in the future. I know the formulas and how to
> apply them, but the mystery comes when considering in what order to apply
> them.
>
> For example:
>
> The lift formula requires the Lift Coefficient for the Angle(AoA) between
> the Airframe and the relative wind(Velocity vector). However, it also
> requires the distance traveled squared(V).
>
> This is very simple, but in order to calculate the distance traveled, you
> need to know the lift, otherwise the distance cannot be measured.
>
> The easy solution is to use the Lift from the previous calculation,
> meaning
> that the simulation will always be basing the current calculation on the
> data(CL, distance traveled, CD etc) calculated the previous calculation.
>
> Is this how it's usually done?
>
>
> Andy
>
>
I think you may be simplifying it quite a bit. However, a lot of times
aircraft tables for lift, drag, speed power, wing loading, wing efficiency
are used since aircraft lift depends on temperature, pressure (altitude),
and velocity, and geometry. Every aircraft is different. You might want to
try X-Plane (www.x-plane.com) as it is a good workshop to understanding how
aircraft fly. The author uses a unique algorithm called "blade element
theory" which produces very good approximation to reality.See
http://www.x-plane.com/about.html for some basic description.
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
To move a vehicles trajectory forward in time, you solve "differential
equations" (calculus), using numerical methods such as "integration"
(also calculus). Any numerical methods text would give you suggestions.
The questions you ask below seem to imply that you haven't taken
advantage of over 300 years of research into numerical integration. You
can reinvent it yourself, or take a shortcut
An excellant text for this sort of thing is:
“Modeling and Simulation of Dynamic Systems,” Robert L. Woods, Kent L.
Lawrence, Prentice-Hall, Upper Saddle River, New Jersey, 07458.
ISBN 0-13-337379-7
http://www.amazon.com/exec/obidos/ [...] s&n=507846
But even at this level (undergraduate) it would be very helpful to
understand calculus at a similar level.
Also, anything on your local bookstore's rack in the "Game Design"
section with Physics in the title will probably have simple examples
that you can work from without really studying. (e.g.: "Physics for Game
Developers," "Game Physics," etc. )
BTW, the lift does NOT require the Distance Traveled Squared.
It needs the air speed squared. I'm being a bit picky, but this is a
critical difference to understand, especially if you ever intend to
model wind. (The presence of wind, or the rotation of the Earth if you
are doing a space shuttle reentry, for example, all affect the vehicle's
velocity relative to the air, which is what is needed to estimate
aerodynamic forces.)
The reason I bring this up is that you sound like you are looking to
jump right into the middle of this area without covering the basics
first. You can do that, but are likely to make some major mistakes from
ignorance.
- Matt
Andy wrote:
> Hi,
>
> I am trying to understand the physics behind flight simulation, possibly to
> program my own at some point in the future. I know the formulas and how to
> apply them, but the mystery comes when considering in what order to apply
> them.
>
> For example:
>
> The lift formula requires the Lift Coefficient for the Angle(AoA) between
> the Airframe and the relative wind(Velocity vector). However, it also
> requires the distance traveled squared(V).
>
> This is very simple, but in order to calculate the distance traveled, you
> need to know the lift, otherwise the distance cannot be measured.
>
> The easy solution is to use the Lift from the previous calculation, meaning
> that the simulation will always be basing the current calculation on the
> data(CL, distance traveled, CD etc) calculated the previous calculation.
>
> Is this how it's usually done?
>
>
> Andy
>
>
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
> The questions you ask below seem to imply that you haven't taken
> advantage of over 300 years of research into numerical integration. You
> can reinvent it yourself, or take a shortcut
Thanks for the advice. I am aware that I am not following the usual
procedure.
> BTW, the lift does NOT require the Distance Traveled Squared.
> It needs the air speed squared. I'm being a bit picky, but this is a
> critical difference to understand, especially if you ever intend to
> model wind. (The presence of wind, or the rotation of the Earth if you
> are doing a space shuttle reentry, for example, all affect the vehicle's
> velocity relative to the air, which is what is needed to estimate
> aerodynamic forces.)
I understand, but I'm trying to keep it simple.
In most lift explanations on the web, V stands for velocity. In 'Physics for
game developers', V stands for 'Speed through the air'. In reference
material from 'Digital Image Design', V stands for Aircraft speed and in
material from 'Argonaut software' it also says V for velocity.
I assume that when you write Airspeed squared, you mean the speed along the
velocity vector. Well, the velocity vector changes depending on the Lift
and forward velocity of the airframe, so how can one know the airspeed
squared until the lift and thrust has been applied?
> The reason I bring this up is that you sound like you are looking to
> jump right into the middle of this area without covering the basics
> first. You can do that, but are likely to make some major mistakes from
> ignorance.
I am trying to work with what I've got, instead of always making excuses for
why I can't do this or that.
You didn't really answer my question, so I guess I'll just base the lift and
drag on the results from the frame before.
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
> I think you may be simplifying it quite a bit. However, a lot of times
> aircraft tables for lift, drag, speed power, wing loading, wing efficiency
> are used since aircraft lift depends on temperature, pressure (altitude),
> and velocity, and geometry.
I've already implemented temperature and pressure based on altitude.
> Every aircraft is different. You might want to
> try X-Plane (www.x-plane.com) as it is a good workshop to understanding
how
> aircraft fly. The author uses a unique algorithm called "blade element
> theory" which produces very good approximation to reality.See
> http://www.x-plane.com/about.html for some basic description.
I've been following X-plane for years and I understand how aircraft fly. I
haven't researched blade element theory as I believed that for a very simple
attempt at a flight sim it would be overkill. Anyway, I'll learn more about
it.
thanks,
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
> I assume that when you write Airspeed squared, you mean the speed along
the
> velocity vector. Well, the velocity vector changes depending on the Lift
> and forward velocity of the airframe, so how can one know the airspeed
> squared until the lift and thrust has been applied?
'speed along the velocity vector' includes any winds, but for my simple
purposes I assume that there is no wind.
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
In numerical integration, you move the "states" forward in time. These
states are the minimum number of parameters required to uniquely define
the state of the vehicle.
The derivatives of the states are the rates of change of these states.
You calculate the state derivatives by the equations of motion:
a = F / m (acceleration is equal to force divided by mass)
Acceleration is the derivative of velocity,
velocity is the derivative of position, and so on
To calculate a velocity history from an acceleration history,
you "integrate" the acceleration. The integral of acceleration with
respect to time is velocity. The integral of velocity with respect to
time is position, and so on.
Andy wrote:
>>The questions you ask below seem to imply that you haven't taken
>>advantage of over 300 years of research into numerical integration. You
>>can reinvent it yourself, or take a shortcut
>
> You didn't really answer my question, so I guess I'll just base the lift and
> drag on the results from the frame before.
That just tells you an estimate of the acceleration is (a = F/m) at one
moment in time.
You still have to integrate the acceleration to find the velocity at
some future time. Then you can estimate the forces at that time and
continue moving forward step by step. This is numerical integration.
This is known as solving the "differential equations" of motion
and in simulations is most often done by "numerical integation"
because the solutions with real world forces-as-functions-of-the-states
cause the differential equations to be "non-linear". Non-linear
equations are difficult to solve analytically (you can't find and write
down a straight forward equation as the answer).
Examples of real world forces that cause non-linearities are
aerodynamic forces (they depend on the velocity squared).
Google "numerical integration"
Quote from one of the top results of my search:
http://www.geom.uiuc.edu/apps/integration/
>>>
The fundamental theorem of calculus tells us that if we know the rate of
change of some quantity, then adding up (or integrating) the rate of
change over some interval will give the total change in that quantity
over the same interval. For example, if a car is moving along a straight
line and we know the speed of the car as a function of time, it is
possible to determine the total change in the car's position over some
time interval. But what if we don't know a formula for the car's
velocity, but we only have measured its velocity at certain instants of
time? Is it possible to "integrate" this discrete data in order to
estimate the change in the car's position? If so, how?
<<<
Sound similar to your problem?
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
"Andy" <aaa_2500X@Xhotmail.com> wrote:
>I haven't researched blade element theory as I believed that for a very simple
>attempt at a flight sim it would be overkill.
Depends on how simple
. One good thing about blade element theory is
you can use it for the prop as well.
The physics model of a flight sim consists of quite a few sub-modules:
- Athmosphere
- engine
- Prop (unless of course you have a jet or sailing plane)
- The "main aero model"
- collisions
- damage model
- The roll model (plane taxies)
>thanks,
>
>Andy
Bye bye,
Wolfram.
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
"Andy" <aaa_2500X@Xhotmail.com> wrote:
>The easy solution is to use the Lift from the previous calculation, meaning
>that the simulation will always be basing the current calculation on the
>data(CL, distance traveled, CD etc) calculated the previous calculation.
>
>Is this how it's usually done?
Yes, you need to use some values from previous time step(s).
I don't see CL or CD among them though and "distance traveled"
obviously means velocity. v is indeed one of the values you have to
use from previous step(s).
It might make sense for you to look at an open source flight sim or
physics model, for example FlightGear ( www.flightgear.org )
or Battle of Britain ( www.bob-ma.org ) .
BTW, to any readers knowlegable (sp?) in these things, we (the BDG =
Battle of Britain Development Group) are looking for people that want
to investigate the BoB flight model to enable modding.
>Andy
Bye bye,
Wolfram "Osram" Kuss.
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
> Sound similar to your problem?
Yes, but you make it sound so logical and complex at the same time. I need
to do some research on this.
Thanks for taking the time to reply to my posts!
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
> Yes, you need to use some values from previous time step(s).
> I don't see CL or CD among them though and "distance traveled"
> obviously means velocity. v is indeed one of the values you have to
> use from previous step(s).
You are right, CD and CL are calculated on the fly, whereas Lift and Drag
are based on velocity.
> It might make sense for you to look at an open source flight sim or
> physics model, for example FlightGear ( www.flightgear.org )
> or Battle of Britain ( www.bob-ma.org ) .
I have looked at the code from FlightGear and Vertigo, but not being that
familiar with C and C++, I felt overwhelmed. However, I do understand the
basics, and the amount of theory, detail explanations and design documents I
currently posses should get me on the right path.
Tanks for taking the time to reply to my posts!
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
*Sigh*
Andy
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
Andy wrote:
> Hi,
>
> I am trying to understand the physics behind flight simulation, possibly to
> program my own at some point in the future. I know the formulas and how to
> apply them, but the mystery comes when considering in what order to apply
> them.
>
> For example:
>
> The lift formula requires the Lift Coefficient for the Angle(AoA) between
> the Airframe and the relative wind(Velocity vector). However, it also
> requires the distance traveled squared(V).
>
> This is very simple, but in order to calculate the distance traveled, you
> need to know the lift, otherwise the distance cannot be measured.
>
> The easy solution is to use the Lift from the previous calculation, meaning
> that the simulation will always be basing the current calculation on the
> data(CL, distance traveled, CD etc) calculated the previous calculation.
>
> Is this how it's usually done?
>
>
> Andy
Yes, precisely.
In computer game development most of us do it exactly as you're
suggesting. (Matt may be an exception of course, he was/is an aerospace
engineer and has written very complex automotive vehicle dynamics
models for several years as well, you may have used one of them and not
even realized it
)
So yes, you can take the values from the previous calculation (during
the previous "time step" ) and then update them with your other
calculations. I.e., if you calculate the forces that act on the
airplane (some of which depend on the air velocity as per your
example), you can calculate the acceleration, then add that (multiplied
by your time step) to the velocity you had on the previous step, update
the previous position according to this new velocity, and voila,
instant motion.
Do that and you've just solved a differential equation or two via one
sort of numerical integration (Euler integration) without even knowing
what you did.
I.e., the simplest possible way of doing it:
A few of the "states" or "state variables" of your airplane might be:
Acceleration
Velocity
Position
(Those would be 3D vectors, i.e., Acceleration.x, Acceleration.y,
Acceleration.z, etc..)
To update these "states" one simple numerical integration technique
would be to do it this way:
Force = whatever your aero calculations say.
Acceleration = Force / Mass
Velocity = Previous_Step_Velocity + Acceleration * TimeStep
AverageVelocity = 0.5 * (Velocity + Previous_Step_Velocity)
Position = Previous_Step_Position + AverageVelocity * TimeStep
Voila, you've updated three states via Euler integration. There are
other ways to update object states (other numerical integration
techniques) as Matt pointed out, besides this particular one. But in a
nutshell, yes, in video games this is usually how things are handled
By the way, Matt, it's good to see that you're still around the
newsgroups. Haven't chatted with you since the good old days at ras,
where we had many such discussions on modelling vehicle dynamics, doing
some AI, and so on. Have wondered several times over the past few
years what you were up to. It's funny, I saved a lot of what you wrote
in our discussions and didn't understand quite a bit of it until much
later :-) Feel free to drop me a note some time.
Todd Wasson
Virtual RC Racing developer
http://www.virtualrc.com
http://www.PerformanceSimulations.com
http://www.PerformanceSimulations.com/ToddSim7a.wmv <--My other car sim
on my really old, old, outdated graphics engine
Archived from groups: comp.sys.ibm.pc.games.flight-sim (More info?)
> So yes, you can take the values from the previous calculation (during
> the previous "time step" ) and then update them with your other
> calculations. I.e., if you calculate the forces that act on the
> airplane (some of which depend on the air velocity as per your
> example), you can calculate the acceleration, then add that (multiplied
> by your time step) to the velocity you had on the previous step, update
> the previous position according to this new velocity, and voila,
> instant motion.
>
> Do that and you've just solved a differential equation or two via one
> sort of numerical integration (Euler integration) without even knowing
> what you did.
>
> I.e., the simplest possible way of doing it:
>
> A few of the "states" or "state variables" of your airplane might be:
>
> Acceleration
> Velocity
> Position
>
> (Those would be 3D vectors, i.e., Acceleration.x, Acceleration.y,
> Acceleration.z, etc..)
>
> To update these "states" one simple numerical integration technique
> would be to do it this way:
>
> Force = whatever your aero calculations say.
>
> Acceleration = Force / Mass
> Velocity = Previous_Step_Velocity + Acceleration * TimeStep
> AverageVelocity = 0.5 * (Velocity + Previous_Step_Velocity)
> Position = Previous_Step_Position + AverageVelocity * TimeStep
>
> Voila, you've updated three states via Euler integration. There are
> other ways to update object states (other numerical integration
> techniques) as Matt pointed out, besides this particular one. But in a
> nutshell, yes, in video games this is usually how things are handled
That's pretty much how I plan to do it.
Andy
There are 1419 identified and unidentified users. To see the list of identified users, Click here.
You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

