- #1
crepincdotcom
- 24
- 0
Hello all,
I've written a very simple nbody solver in c. Basically, I just went through an array of particles and solved F = G(m1)(m2) / r ^2
The output is here: (sorry for the windows format)
http://www.crepinc.com/files/galax.wmv
As you can see, some of the particles don't do what one would expect...
So far the only possible reason I can come up for is that I'm solving the equations at a set dT. Thus if the dT is too large, "stuff happens" between the two different solves. But if dT is too small, the whole thing basically blows up.
Am I overlooking something, or is my math ok and my code is just bad?
Thanks a lot,
-Jack Carrozzo
http://www.crepinc.com/
I've written a very simple nbody solver in c. Basically, I just went through an array of particles and solved F = G(m1)(m2) / r ^2
The output is here: (sorry for the windows format)
http://www.crepinc.com/files/galax.wmv
As you can see, some of the particles don't do what one would expect...
So far the only possible reason I can come up for is that I'm solving the equations at a set dT. Thus if the dT is too large, "stuff happens" between the two different solves. But if dT is too small, the whole thing basically blows up.
Am I overlooking something, or is my math ok and my code is just bad?
Thanks a lot,
-Jack Carrozzo
http://www.crepinc.com/
Last edited by a moderator: