|
![](/i/fill.gif) |
Warp wrote:
> triple_r <nomail@nomail> wrote:
>> In all fairness, there are better methods. Think of dividing all the particles
>> up into an octree. A whole group of particles at a distance can be lumped into
>> one mass.
>
> But you have to calculate the center of mass of the whole group, and
> since each element of the group can change independently of the others,
> that would mean you have to re-calculate this center of mass each time
> anything changes.
>
> Also another problem is that groups don't stay the same. If a particle
> not belonging to the group enters the "inside" of the group, it cannot
> be calculated anymore against that group as if it was just one single
> mass located at the center of mass of the group.
The point that accuracy requires the O(n^2) solution was rather blithely
ignored, too.
If the forces involved follow the 1/(d^2) rule (such strange forces as,
oh, gravity), then the non-linearity causes the averaging to yield a
different total force than the sum of the forces exerted by the
different masses. For instance, if particle A is at distance x_a
(relative to the affected point), and particle B is at distance x_b
(likewise relative), then using an average yields a force of:
2/(x_a/2 + x_b/2)^2, whereas the actual force is
1/(x_a^2) + 1/(x_b^2) = (x_b*x_b)+(x_a*x_a))/(x_a^2 * x_b^2)
If x_a = 1 and x_b = 1.01, then the forces are:
2/( 1.005^2) = 2/1.010025 = 1.9801490062127175069924011781887
whereas the other sum is
2.0201/1.0201 = 1.9802960494069208901088128614842
and this is an application where an error of this magnitude most
certainly does make a difference.
Unless you just want to make pretty pictures.
Regards,
John
Post a reply to this message
|
![](/i/fill.gif) |