Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

N-Body Galaxy Simulation

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,478
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 21, 2010

Very simple, OpenGL & CPU based, nbody simulation written in C. 8192 particles, O(n^2) operations.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (rdelcueto)

  • Is it a 2D or 3D simulation ? I'm working too on a cosomoligcal simulator, for now I'm still in the 2D configuration, but I don't get any main rotational behaviour like yours, even with collision handled with SPH. I use the Barnes Hut algorithm to accelerate gravity computation. Could you give some details about your implementation ? Thanks.

  • @VelRyphon It's 3D simulation, based on the model specified @ Nvidia's Nbody Paper (Google for the PDF and source code). It's quite a simple and naive simulation. (Uses no data structures simplifications, nor collision detection). I'll say your simulator is way more complex and interesting, in that sense.

    I initialize my particles inside a two ellipsoid constrained space, and specify a speed vector in such way they all orbit in the same direction, to create the spiral rotation behavior.

  • Is there a black hole in the middle, or are you just doing the n^2 operations? Also, How come there are no wild slingshot particles (when 2 particles get really close together).

  • @TheJesseLenney There's no black hole in the simulation, just the n^2 interactions between the n particles. To prevent the "wild slingshots", a smoothing factor is used, so that particles are never TOO close, and you can control the "slingshot" speed. Without it, you get a very erratic behavior, were most particles fly away from the galaxy center and never come back.

  • Is this video in real-time, or did you speed it up?

  • @SomeHelpNeeded No realtime here (8192 particles). =)

    On my Intel i7 @ 1.6, using 4 threads, it renders @ ~1fps.

see all

All Comments (14)

Sign In or Sign Up now to post a comment!
  • @VelRyphon Have you had any success implementing Barnes & Hut algo?

  • @VelRyphon MASSIVE BUMP but it looks like a good source of inspiration is youtube com/user/Nbodyshop

    they have "big-bang" style starts, along with some SPH stuff to accurately model gasses.

  • how big is the diffrence between the smallest mass and biggest mass?

  • i dig this nice question and nice answer was having problems figuring this out

  • @rdelcueto Ok thank you. I saw this NVidia paper. Indeed it's quiet a simple model. you're swirling rendering comes from your initial conditions, having already an orbiting rotation before you lauch it. I'm trying to get that rotation from scratch, with 0 velocity at beginning, only random positions in a sphere which induce gravitation interaction...

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more