|
![](/i/fill.gif) |
Ben Birdsey wrote:
> Are you certain that your model is conserving energy?
I'm just doing a tug, move, tug, move.
1. The position is moved along a few percent of the velocity.
#declare actorp[n]=actorp[n]+.05*actorv[n];
2. The velocity is modified by the acceleration, which is a made-up gravitational
constant times a vector which is the sum of the inverse square of all forces acting
on it.
#declare actorv[n]=actorv[n] + Grav*(actoravoid[n]);
In other words, actoravoid[n] is computed by:
#declare i=0 ;
#while (i<num)
#declare j=i+1 ;
#while (j<num)
#local dji=vlength(actorp[j]-actorp[i]);
#local vij=vnormalize(actorp[i]-actorp[j]);
#declare actoravoid[j]=actoravoid[j]+mass[i]*vij/(dji^2);
#declare actoravoid[i]=actoravoid[i]-mass[j]*vij/(dji^2);
//note negative here because dirn of vji reversed
#declare j=j+1;
#end
#declare i=i+1;
#end
Now you've pointed me to some very interesting links, by searching for those terms.
A) Some uses of these algorithms are irrelevant to my scenario, as they apply to
ONE particle condemned to orbit only ONE object. I wanted every particle to be
instantaneously affected by every other one. I wanted Shumaker-Levy (sp?) to be
caught by Jupiter, not merely orbit the sun.
B) Some use my algorithm verboten,
C) Some uses of this algorithm suggest using, in my terminology:
#declare actorv[n]=Grav*(actoravoid[n]),
which I don't see how this computes an "orbit".
D) Some are just plain over my head.
> Besides this, I'm sure that there are a variety of special algorithms
> for planetary motion.
Can they do the "Jupiter catches S-L" thing?
Links?
Post a reply to this message
|
![](/i/fill.gif) |