POV-Ray : Newsgroups : povray.advanced-users : Air resistance Server Time
25 Nov 2024 14:52:44 EST (-0500)
  Air resistance (Message 1 to 10 of 22)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Andrew Coppin
Subject: Air resistance
Date: 1 Oct 2002 09:51:46
Message: <3d99a872@news.povray.org>
I now have a working Chaos Pendulum - yay!

But I was wondering... how would I go about modelling air resistance? All I
want is to have a system which doesn't go into a fixed oscilation that lasts
forever; I want air resistance to damp it down.

Let's say I have a vector V which represents the particle's velocity. I
could do something like
  #declare V = 0.9*V;
Or perhaps I could try
  #declare V = pow(V, 0.9);
(if that would actually work - POV-Ray's syntax won't allow it, but you get
the gist. Something like "pow(vlength(V), 0.9) * vnormalize(V)" would work -
or even "pow(vlength(V), -0.1) * V".)

The question is, does air resistence slow something down more at high speed?
Or is it roughly constant? (I know this depends on the shape of the object -
we're talking about a smallish sphere here.) Clearly a high-speed object
will encounter more drag. But it will also have more momentum. So which is
it? Multiply V by a constant 0 < k < 1? Or raise it to the power of a
similar constant? I'm not really interested in making this super-realistic,
I'd just like some opinions.

Thanks.
Andrew.


Post a reply to this message

From: Slime
Subject: Re: Air resistance
Date: 1 Oct 2002 13:54:21
Message: <3d99e14d@news.povray.org>
>   #declare V = 0.9*V;


This is physically accurate.

>   #declare V = pow(V, 0.9);

This is not.

The only difficulty with V=V*.99 is that the constant (.99) changes
depending on the framerate.

> The question is, does air resistence slow something down more at high
speed?

Well, yeah, but only because (1-.9)* a high speed is greater than (1-.9)* a
low speed.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Christoph Hormann
Subject: Re: Air resistance
Date: 1 Oct 2002 14:03:37
Message: <3D99E375.D3F91328@gmx.de>
Slime wrote:
> 
> >   #declare V = 0.9*V;
> 
> This is physically accurate.
> 
> >   #declare V = pow(V, 0.9);
> 
> This is not.
> 

In fact neither of them is.

In the general case the force generated by air resistance is a quite
complicated function of the speed.  At low speeds it can be approximated
by a force proportional to the speed (the first of the cited formulas).

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: David Wallace
Subject: Re: Air resistance
Date: 1 Oct 2002 14:06:04
Message: <3d99e40c@news.povray.org>
I actually modeled air resistance in my TearPool IRTC entry:

    #local spd = vlength(vVel[cShot]); // Speed, m/s
    #local dir = vnormalize(vVel[cShot]); // Direction
    #local rdFlat = 1+pow(spd,0.25)*.2; // Drag stretching factor
    #local Cd = 1.3/rdFlat/rdFlat; // Drag coefficient
    #local sMass = 4/3*pi*rd*rd*rd*rhos; // Mass, kg
    #local sCross = pi*rd*rd/rdFlat; // Cross section, m^2

    #local sAcc = ag - dir*0.5*Cd*rhoa*sCross*spd*spd/sMass;
    #local vo = vVel[cShot];
    #declare vVel[cShot] = vVel[cShot] + deltat*sAcc;
    #declare vPos[cShot] = vPos[cShot] + deltat*(vo+vVel[cShot])/2;

This is the part of the lava creation section which calculates air
resistance.  Basically drag is a force calculated as follows:

    F = 0.5*m*v^2*A/V*Cd, directed against the velocity

The rdFlat variable in my setup was an attempt to take the viscous drag of
the molten lava into account by stretching the particle.

"Andrew Coppin" <orp### [at] btinternetcom> wrote in message
news:3d99a872@news.povray.org...
> I now have a working Chaos Pendulum - yay!
>
> But I was wondering... how would I go about modelling air resistance? All
I
> want is to have a system which doesn't go into a fixed oscilation that
lasts
> forever; I want air resistance to damp it down.
>
> Let's say I have a vector V which represents the particle's velocity. I
> could do something like
>   #declare V = 0.9*V;
> Or perhaps I could try
>   #declare V = pow(V, 0.9);
> (if that would actually work - POV-Ray's syntax won't allow it, but you
get
> the gist. Something like "pow(vlength(V), 0.9) * vnormalize(V)" would
work -
> or even "pow(vlength(V), -0.1) * V".)
>
> The question is, does air resistence slow something down more at high
speed?
> Or is it roughly constant? (I know this depends on the shape of the
object -
> we're talking about a smallish sphere here.) Clearly a high-speed object
> will encounter more drag. But it will also have more momentum. So which is
> it? Multiply V by a constant 0 < k < 1? Or raise it to the power of a
> similar constant? I'm not really interested in making this
super-realistic,
> I'd just like some opinions.
>
> Thanks.
> Andrew.
>
>
>


Post a reply to this message

From: Lutz-Peter Hooge
Subject: Re: Air resistance
Date: 1 Oct 2002 15:12:11
Message: <3d99f38b$1@news.povray.org>
In article <3d99e14d@news.povray.org>, slm### [at] slimelandcom says...
> >   #declare V = 0.9*V;
> 
> 
> This is physically accurate.

Only for relatively slow speeds.

Also "0.9" is not really a constant, but should be a function of the mass 
of the object, its geometry and the time-interval of course.

so "#declare V = V * (1 - delta_t * k/m)" would be better.

Lutz-Peter


Post a reply to this message

From: Slime
Subject: Re: Air resistance
Date: 1 Oct 2002 16:32:21
Message: <3d9a0655$1@news.povray.org>
> Only for relatively slow speeds.


Apparently I was misled in Physics class, or else I forgot about the
details. Sorry =)

> Also "0.9" is not really a constant, but should be a function of the mass
> of the object, its geometry and the time-interval of course.


Well, yeah, but I figured for the purposes of a POV-Ray animation, you could
just fudge the constant so that it looked alright. I rarely worry about the
actual calculation of constants in POV-Ray, I just use the ideas behind the
formulas. (For instance, for gravity, I just pull two objects towards each
other with force as a function of 1/r^2; I don't bother to calculate the
G*m*m to figure out what it should actually be. Rarely, at least.)

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Andrew Coppin
Subject: Re: Air resistance
Date: 1 Oct 2002 17:12:40
Message: <3d9a0fc8@news.povray.org>
Right guys. So if I just want to damp my pendulum a bit, a can just multiply
the velocity vector by a sub-unital constant as a crude approximation. Cool.

Oh, and btw... BIG RESPECT due to Slime for pointing out that the damping
constant is inherently framerate-dependent. That coulda been nasty! [gulp]
Still, a quick flick with good old clock_delta should fix that ;-)

Thanks as always folks!
Andrew.


Post a reply to this message

From: Lutz-Peter Hooge
Subject: Re: Air resistance
Date: 1 Oct 2002 17:57:31
Message: <3d9a1a4b@news.povray.org>
In article <3d9a0655$1@news.povray.org>, slm### [at] slimelandcom says...

> Well, yeah, but I figured for the purposes of a POV-Ray animation, you could
> just fudge the constant so that it looked alright.

Yes, if you want to "simulate" only one or two bodies.
But if you have more of them with varying masses etc it will probably be 
better to use the more complicated formula.

Lutz-Peter


Post a reply to this message

From: Christopher James Huff
Subject: Re: Air resistance
Date: 1 Oct 2002 20:19:40
Message: <chrishuff-8AC9DA.20165501102002@netplex.aussie.org>
In article <3D99E375.D3F91328@gmx.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> In the general case the force generated by air resistance is a quite
> complicated function of the speed.  At low speeds it can be approximated
> by a force proportional to the speed (the first of the cited formulas).

Air pressure, turbulence, surface material, object geometry, air and 
surface temperature...

A water drop will get a different amount of resistance than an 
equivalently sized hailstone, they have very different surfaces, one 
hard and rigid, the other smooth but deformable, rippling and flowing. A 
square piece of cloth stretched over a frame can fly high into the air, 
the same cloth without the frame will flutter and experience large 
amounts of drag. A golfball will have a very different trajectory than a 
perfectly smooth ball of identical size and weight. I don't want to 
think about a vaporizing meteor.

You just need to figure out how complex your simulation needs to be, how 
good of an approximation you want...a linear function might do the job 
just fine.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Andrew Coppin
Subject: Quick Check...
Date: 2 Oct 2002 11:49:18
Message: <3d9b157e@news.povray.org>
Hi there. Listen, would someone just like to check my maths? ;-)

#declare FPS = 25; // Simple enough...

#declare TotalTime = final_frame / FPS; // = total number of seconds?
#declare TimeStep = clock_delta * TotalTime; // = seconds since prev frame??

Assuming I got that much right, how about this for my air resistance damping
bit:

#declare Velocity = Velocity * (1 - (k * TimeStep));

(where k has already been defined as something like 1e-2 or so).

I just tried my simulation at two different frame rates and got different
results. However, this doesn't mean the formula is wrong (IMHO), since the
orbit I'm calculating is highly unstable; the result is probably different
with the original one too! (i.e., the one without air resistence.) Anyway,
the results _look_ fairly good - will post to the animations group as soon
as POV-Ray finishes drawing it ;-)

Andrew.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.