HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Formula for air resistance?

01-23-2010, 02:31 PM#1
Na_Dann_Ma_GoGo
Hi there,
I'm currently searching for a formula regarding air resistance.
I am looking for one that decelerates the velocity depending on the current velocity.
like:
Vnow=Vnow-0.75*Vnow² (here recursive and not explicit)

When I researched I rather found formulas regarding the Force and not the current speed.

Thanks in advance.

Edit: Guess I have to equate the formula for F(air resistance) and F=m*a and then do s.th. with that to get a formula for the speed?^^

Edit2:
Or maybe simply something like:
V -> velocity
c -> entity specific constant

V=V-c*SquareRoot(V) ?
01-23-2010, 04:03 PM#2
Neversleeping
That's complicated fluid dymanics, depending on the shape of the object. Turbulence and such makes it even worse.
But the resistant force is exponentially correlated with the speed. If the speed doubles, air resistance quadruple etc.


Air resistance (AR) is a force, and not directly comparably to speed ïn one equation. The velocity will be when AR is equal to the driving force, or engine of the object, it will hold constant speed:

F=mass*acceleration
-AR + engine = mass * acceleration (this will be 0 at the terminal velocity)

If you shut the driving force down, you will get a negative acceleration due to negative force and eventually come to a stop. If you're gonna use air resistance, you need a driving power as well.


I don't know if I understood the question completely. If you explain with words what kind of project you're going for here, I might be able to answer better :)
01-23-2010, 04:17 PM#3
Na_Dann_Ma_GoGo
Hmm thanks,
well I just want some halfway decent physics for knockbacking for example.
As air resistance hasn't that much impact on heavy objects like a human I guess it'll be okay if I go with a approximation instead of the exact formulas.
And as I probably won't do unit specific shapes I could go with something like this:
(recursive)

V being velocity
C some constant factor (should be pretty low)

And each periodic movement tick I do s.th. like this (also depending on the period frequency of ourse):

V=V-c*V*V

Watcha think of this?^^
01-23-2010, 04:27 PM#4
moyack
eventhough NeverSleeping speaks true, this si a classic differencial equation problem and the solution is an equation.



I hope this formula helps you
01-23-2010, 05:33 PM#5
Na_Dann_Ma_GoGo
Hmm yah that's exactly what I was looking for in the first place.
However this is for the fall velocity and includes gravitation etc.
How would I do it if I just have a start velocity in x,y-direction?
01-23-2010, 06:34 PM#6
Anitarf
Air resistance has very little to do with knockback. In this case, the main factor is the friction force between the object and the terrain, which produces a constant deceleration in the most basic model (and there is no reason to use anything more complex than that).

You can make the deceleration constant across the board or you can make some exceptions for terrain (like lower deceleration on ice) and units (like higher deceleration for units with better traction), also you can make the initial velocity depend on the unit's mass.
01-23-2010, 07:09 PM#7
Na_Dann_Ma_GoGo
Well I don't mean knockback on ground. I mean with x,y and z velocity. But whatever, as the speed reduction is minimal anyways I do some simple maths instead of using a complex algorithm each period, so I can save some peformance ;s
01-23-2010, 07:43 PM#8
Captain Griffen
For the record, a better approximation of air resistance is A.v^k where A and k are constants, with k between 1 and 2.
01-23-2010, 08:08 PM#9
moyack
Quote:
Originally Posted by Na_Dann_Ma_GoGo
Hmm yah that's exactly what I was looking for in the first place.
However this is for the fall velocity and includes gravitation etc.
How would I do it if I just have a start velocity in x,y-direction?
Well, g is an acceleration, so it can be the acceleration in XY coordinates. The model works in the same way.