POV-Ray : Newsgroups : povray.off-topic : RK4 is harder than it seems : Re: RK4 is harder than it seems Server Time
7 Sep 2024 05:09:32 EDT (-0400)
  Re: RK4 is harder than it seems  
From: John VanSickle
Date: 1 Aug 2008 07:34:03
Message: <4892f4ab@news.povray.org>
Invisible wrote:
> OK, so here's a question.
> 
> I have a particle system that implements RK4 integration. It works 
> great. However... for each step, it involves computing the force acting 
> on a particle several times. That's fine if the force is an invariant 
> function of the particle's position and/or velocity (and possibly time). 
> But what do you do if the forces acting on a particle depend on the 
> positions of the other particles? o_O

If you have a natural fear of O(N^2) problems, then I have some bad news 
for you.

To accurately calculate the current force on each particle in a system, 
you have to match up every possible pair of particles, all (n^2-n)/2 of 
such pairs, and calculate the force that each of the particles in the 
pair exerts on the other (generally equal and opposite, according to Mr. 
Newton, so there is only one force calculation for each pair).

Try to get n as low as possible.

Regards,
John


Post a reply to this message

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