POV-Ray : Newsgroups : povray.binaries.animations : Re: Elastic Grid Simulation [~1,000KB MPEG-1] Server Time
1 Nov 2024 13:19:23 EDT (-0400)
  Re: Elastic Grid Simulation [~1,000KB MPEG-1] (Message 1 to 6 of 6)  
From: Chris Johnson
Subject: Re: Elastic Grid Simulation [~1,000KB MPEG-1]
Date: 19 Oct 2003 22:15:07
Message: <3f93452b@news.povray.org>
-[As I said, there was an extremely strange bug...]-
While this seems strange, it is quite common in this type of simulation,
even without passing the parameters wrongly. Reducing the time-step of the
simulation can delay the onset of this, as can changing the method of
numerical integration used (the position=position+velocity method is called
Euler Integration, and is the simplest method, but one of the least
accurate). The most commonly used method here is called 4th-order
Runge-Kutta - for this simulation, though, it seems not to be necessary to
complicate matters with this.

The reason why I _really_ like this simulation isn't because of the pov-ray
elements - its because of its musical potential. The simulation of the
resonances in gongs and drums can be simulated by linked masses like this.
Usually the links between masses are linear springs - however, from your
description (and from the appearence of the video) it looks like you're
using non-linear springs, which cause lots of internal resonances in the
grid. These could make interesting sounds if the position of the masses is
summed and outputted (speeded up many times) as a waveform.

http://homepage.ntlworld.com/thegablehouse/chris-j/phmms.html is a program
I've written to do this with linear springs - I never had much success with
non-linear springs, but your animation shows that it seems to be possible to
get interesting behaviour.

-Chris


Post a reply to this message

From: Andrew Coppin
Subject: Re: Elastic Grid Simulation [~1,000KB MPEG-1]
Date: 21 Oct 2003 16:26:12
Message: <3f959664@news.povray.org>
> -[As I said, there was an extremely strange bug...]-
> While this seems strange, it is quite common in this type of simulation,
> even without passing the parameters wrongly.

Hmm... That's a shame... *grin*

> Reducing the time-step of the
> simulation can delay the onset of this, as can changing the method of
> numerical integration used

Yeah - this simulation only does one "loop" per frame - I'm thinking perhaps
I should do several per frame, so that the time step is the reciprocol of
some multiple of the frame rate. I did a simulation of a bouncing ball in
Excel today at work (hey, I was bored!), and a time step of 1/25 sec as
wowfully inadaquate. A figure 4 times smaller was required - so if I did 4
loops per frame, it should look good... hehehe

(As I side note... it only recently became clear to me why everyone keeps
talking about "integration". It hadn't really occurred to me on a
mathematical level that speed is the derrivative of position, and
acceleration is the derrivative of speed, and therefore positions is the
second integral of acceleration, so simulating the position of a particle by
computing its acceleration is an example of numerical integration. Seems
perfectly obviouse now I've noticed... lol)

> (the position=position+velocity method is called
> Euler Integration, and is the simplest method, but one of the least
> accurate).

Oh dear. Well that's a pitty - that's the method I'm using! (Simply because
I can't think of any other method.)

> The most commonly used method here is called 4th-order
> Runge-Kutta

Oh. OK, I'll take your word for it!

> for this simulation, though, it seems not to be necessary to
> complicate matters with this.

Well, having not seen the results *with* it for comparism... ;-)

> The reason why I _really_ like this simulation isn't because of the
pov-ray
> elements - its because of its musical potential. The simulation of the
> resonances in gongs and drums can be simulated by linked masses like this.

I was actually thinking along the lines of ripples on water, or maybe a
cloth simulation, but I certainly see your point. Might be interesting...

> Usually the links between masses are linear springs - however, from your
> description (and from the appearence of the video) it looks like you're
> using non-linear springs, which cause lots of internal resonances in the
> grid.

Actually, they *are* linear...

> These could make interesting sounds if the position of the masses is
> summed and outputted (speeded up many times) as a waveform.

Mmm, yes... it's already been suggested that I could write a POV-Ray script
to output binary data BASE-64 encoded, so I could output a WAV file (once I
decode it with another program). Or I could just do the whole thing in
Smalltalk in the first place ;-)

> http://homepage.ntlworld.com/thegablehouse/chris-j/phmms.html is a program
> I've written to do this with linear springs - I never had much success
with
> non-linear springs, but your animation shows that it seems to be possible
to
> get interesting behaviour.

...or maybe my animation just has another unknown bug burried somewhere deep
within... lol

The main point I was intending to work on next (other than a smaller time
step) was to try making it so the particles can't pass through each other -
but I'm rather unsure of the math for that. We'll see how it goes though!

Thanks.
Andrew.


Post a reply to this message

From: Anonymous
Subject: Re: Elastic Grid Simulation [~1,000KB MPEG-1]
Date: 24 Oct 2003 17:21:09
Message: <3f9997c5$1@news.povray.org>
"Andrew Coppin" <orp### [at] btinternetcom> wrote

> Actually, they *are* linear...

"If the length of a link is more than a certain amount, the link exerts a
force on both endpoints equal to the excess length."

That's nonlinear. Linear case would be when F is (always) proportional to
the distance.


Post a reply to this message

From: Apache
Subject: Re: Elastic Grid Simulation [~1,000KB MPEG-1]
Date: 25 Oct 2003 18:26:50
Message: <3f9af8aa$1@news.povray.org>
I don't think so. If you'd plot the force against length and the result
would something else than straight line, in that case it would be nonlinear.
I think "distance" is not the distance between two particles but the
distance of equilibrium: the to particles don't want to get closer or away
from eachother.


Post a reply to this message

From: Chris Johnson
Subject: Re: Elastic Grid Simulation [~1,000KB MPEG-1]
Date: 26 Oct 2003 14:24:52
Message: <3f9c1f84@news.povray.org>
I certainly meant linear w.r.t. the eqm. position rather than to zero
length. However, what Andrew suggests (though its not clear) is that theres
no force pushing out when the distance is smaller than the eqm. distance
(rather like a bungee cord). If this is the case, then it is certainly
non-linear wherever you look at it.

-Chris


Post a reply to this message

From: Andrew Coppin
Subject: Re: Elastic Grid Simulation [~1,000KB MPEG-1]
Date: 26 Oct 2003 14:38:37
Message: <3f9c22bd@news.povray.org>
> I certainly meant linear w.r.t. the eqm. position rather than to zero
> length. However, what Andrew suggests (though its not clear) is that
theres
> no force pushing out when the distance is smaller than the eqm. distance
> (rather like a bungee cord). If this is the case, then it is certainly
> non-linear wherever you look at it.

You are correct; when the link becomes shorter than a certain length, it
goes "slack", and produces no force at all. If it is longer than that
certain length, it pulls both ends towards each other.

Thanks.
Andrew.


Post a reply to this message

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