POV-Ray : Newsgroups : povray.binaries.animations : Re: Elastic Grid Simulation [~1,000KB MPEG-1] : Re: Elastic Grid Simulation [~1,000KB MPEG-1] Server Time
19 Jul 2024 00:48:27 EDT (-0400)
  Re: Elastic Grid Simulation [~1,000KB MPEG-1]  
From: Andrew Coppin
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

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