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:11:19 EDT (-0400)
  Re: RK4 is harder than it seems  
From: scott
Date: 31 Jul 2008 09:37:04
Message: <4891c000$1@news.povray.org>
> But what do you do if the forces acting on a particle depend on the 
> positions of the other particles? o_O

The fact that you are even asking that question makes me think you are 
implementing RK4 incorrectly.  The whole point of RK4 is that it gives more 
accurate results when the forces depend on positions of other particles (eg 
springs, collisions etc).

I suspect you are trying to apply the whole RK4 algorithm to one particle, 
then the next, etc.  This is wrong.

You need to store the positions and velocities of all the particles together 
in one "state" object.  Then you apply each step of RK4 on the whole state 
at once.  If you need the positions of other particles when calculating the 
force, then of course you have all the position and velocity information 
available in the state local to the current RK4 step.


Post a reply to this message

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