N-Body Simulator Extreme | CS 61B Project 0 Gold Points | UC Berkeley
Channel: Sagnik Bhattacharya
Date: 03/02/2019

I am Sagnik Bhattacharya and this is my submission for Gold Points for Project 0 of CS 61B Spring 2019, University of California, Berkeley.

This is a basic n-body simulator in two dimensions. I have added elastic collisions for gold points. In the video, I briefly explain how I implemented the collisions (without showing any code, as per course policy), and then discussed an interesting phenomenon that I observed, which manifests itself with collisions enabled, but is not apparent without collisions: clumping of bodies!

Bodies clump together when they collide at relatively slow speeds, because even though the collision itself pushes bodies apart, when they get close enough to collide, their mutual gravitational attraction also becomes very high, causing them to clump together. This mostly happens when objects of similar masses collide, because if one of the colliding objects is very heavy compared to the other, then the lighter object speeds away too fast to clump with the bigger body (since the center of mass of the two objects must keep moving at the same velocity before and after collision). This is also seen in the video, especially when objects collide with the sun. If they have have similar masses, however, they do not speed away too fast, and tend to stick together.

In three dimensions, another interesting phenomenon happens, which we cannot observe in 2 (or 4) dimensions: the formation of disks, as explained in this minutephysics video: https://www.youtube.com/watch?v=tmNXKqeUtJM