From: Randolph Wang <rywang@CS.Princeton.EDU>
Date: Mon, 23 Feb 2004 20:53:06 -0500 (EST)
To: elleny@Princeton.EDU
Cc: chizhang@CS.Princeton.EDU, randy_class@CS.Princeton.EDU
Subject: Re: NBody
> <P>Unfortunately, I still have a problem because when I execute my
> program, the bodies stop when the earth has travelled about 180
> degrees. My preceptor (Chi Zhang) tried helping me debug it --
> and we printed values of force and acceleration to see if they
> reached zero through the calculations, but as far as we could tell,
> they never approached zero. There may be a problem with the
> efficiency of my code, or my own processor, because the CPU
> works really hard when I'm running my program. Anyhow, I'll
> try to execute my program on several other computers.</P> <P>Thanks
> again,</P> <P>Ellen</P>
(1) Even if the force and acceleration did reach zero, good old
Newtonian physics should tell you that the earth shouldn't
*stop*---absent of external forces, the body would cruise off in a
striaght line at constant speed :)
(2) Carefully placed printing should still be able to identify the
cause of stopping. If simple printing generates too much output
before it stops, you should formulate some more selective printing
statements. Like print only if the x-coordinate of the body is
less than a certain threshold.
Good luck,
Randy
Re: NBody / Randolph Wang