N-body simulation of the gravitational collapse of Spongebob Squarepants

Pere Rosselló, an astrophysics student at Universidad de La Laguna in Tenerife, Spain, posted an animation depicting the gravitational collapse of Spongebob. "You can see how virial equilibrium is eventually reached," he explained, helpfully.

N-body simulation made with Python, parallelized with numba, and animated with matplotlib. N=100.000. Computation time around 5h for 2.000 steps. Around 1s of compute time per step. Collisions are handled with a softening length. Code will be on my github, eventually

Just imagine being part of a civilization on the cusp of attaining a decent model of the universe's origins—somewhere between Halley and Lemaître, and you start plotting backwards from where we are and where the Big Bang should be you find Spongebob instead. Running the numbers again and again. Such a universe has no need of Lovecraft, cosmic horror would be right there in the maths.

Rosselló solved a three-body problem: the one of animating three bodies to look really cool.

Previous: Listen to the early voices of SpongeBob and Squidward before they were ready for prime time