World with friction

9 views
Skip to first unread message

d.carbonaro

unread,
Jan 30, 2008, 8:02:03 AM1/30/08
to ode-users
Good afternoon,
I'd like to simulate the motion of objects with air friction.
How can I do that?
Can I include all my bodies in a cube and define the friction with the
inner part of the cube?

Daniele

Mark Williams

unread,
Jan 30, 2008, 4:29:10 PM1/30/08
to ode-users

> Good afternoon,
> I'd like to simulate the motion of objects with air friction.
> How can I do that?

For each body, apply a small force which is opposite and proportional
to its velocity before stepping the world. Also apply a small torque
to counter an angular velocity.

> Can I include all my bodies in a cube and define the friction with the
> inner part of the cube?

Just test each body's position against your cube when deciding whether
or not to apply the air friction forces.

Cheers,
Mark

Bram Stolk

unread,
Jan 30, 2008, 9:10:19 PM1/30/08
to ode-users
On Jan 30, 1:29 pm, Mark Williams <mark.imageeng...@gmail.com> wrote:
> > Good afternoon,
> > I'd like to simulate the motion of objects with air friction.
> > How can I do that?
>
> For each body, apply a small force which is opposite and proportional
> to its velocity before stepping the world. Also apply a small torque
> to counter an angular velocity.

Proportional to the square of the velocity.
The v^2 is what keeps race-cars from reaching 400km/h.

bram

Jon Watte

unread,
Jan 31, 2008, 3:01:51 PM1/31/08
to ode-...@googlegroups.com
Bram Stolk wrote:
> Proportional to the square of the velocity.
> The v^2 is what keeps race-cars from reaching 400km/h.
>

The problem with v^2 is that it has very little effect near 0, so the
object will not be properly dampened to a stop. To simulate air
resistance, you want to use a v^2 term, but to simulate damping (and get
a stable simulation) you want to use a v term. Thus, you add a force
proportional to A*v*v + B*v, where B might be in the range of 0.01 for a
timestep of 0.01, and A might be in the range 0.001 (depending on the
maximum velocity you want to achieve).

Cheers,

/ h+

Reply all
Reply to author
Forward
0 new messages