7 ms·
Gravitational Collapse of Spongebob
- hakdbha 3y ago[dead]
- raattgift 3y agoThat x/twitter account has some beautiful physics (especially gravitation-related) animations on it. Worth scrolling through it.
- omoikane 3y agoAlso, an interesting visualization of Bach's Cancrizans: https://twitter.com/PeRossello/status/1763909652025078009 https://twitter.com/PeRossello/status/1763909652025078009
- nozzlegear 3y agoYou have to have an X account to do that now right? Whenever I try to scroll through an account’s tweets lately, I just get a list of their tweets from random dates in no apparent order.
- pfdietz 3y agoIt would be interesting to view the evolution over long periods of time. This simulation is 2D, but it's similar to what happens in globular star clusters. In these, there's a phenomenon called the "gravothermal catastrophe". The particles (stars, sponge bits) relax to thermal equilibrium, where the kinetic energy of a particle has a distribution where probability declines exponentially in energy/temperature. Some of the particles will have energy high enough to escape to infinity (to "evaporate"). When they leave, the remaining particles are more tightly bound, so the cluster shrinks. The particles then move faster (by the virial theorem, total kinetic energy is always 1/2 the negative of the gravitational potential energy). Evaporation accelerates until the cluster basically explodes. Why this doesn't happen to actual star clusters was eventually determined to be due to three body collisions that cause binary stars to form, and these stars then inject energy into passing stars (causing the binary star orbits to shrink). This energy injection reheats the cluster, inflating it again and preventing runaway evaporation. I'm not clear that the simulation here can handle formation of such binaries.
- scotty79 3y agoThis looks cool: https://twitter.com/PeRossello/status/1754253187731599760 https://twitter.com/PeRossello/status/1754253187731599760
- pfdietz 3y ago>The only force at play is newtonian gravity, which we modify by adding a softening length, ε. > This way we avoid numerical instabilities due to divergent forces when two particles get to close together. So it appears he doesn't handle close encounters that form binaries. Probably reasonable if he's using heavier discrete particles as a proxy for dark matter.
- hermitcrab 3y agoI wrote my own toy gravity simulation. 2 stars that come very close together at a clock tick will experience a massive force that throws them both right out of the system. This is an artefact of artificially dividing time into clock ticks to make the calculation tractable. As I understand it, 'softening length' is a fudge to stop that happening.
- pfdietz 3y agoYou'd have to use a more sophisticated algorithm with variable time steps for closely interacting particles, I think. And then some way to deal with particles that become bound.
- hermitcrab 3y agoThat sounds like a bit of a nightmare. Especially when you have a large number of bodies.
- andbberger 3y agoyup. molecular dynamics simulations are hard-core. and the parallelization is highly non-trivial so you need fast fabrics and complex message passing to scale. one of the raisons d'être for supercomputers
- throw5323446 3y agoAnybody can post the text for those without an account?
- bagels 3y agoPrimary content is an animation.
- Izmaki 3y agoImagine a pencil drawing of Spongebob, but using tiny dots rather than strokes, collapsing onto itself, forming what looks like two separate masses (of sponge particles?) which then collapse together in the end.
- admissionsguy 3y ago[flagged]
- emmanueloga_ 3y agohttps://www.youtube.com/watch?v=C6eY6HMBa2Q https://www.youtube.com/watch?v=C6eY6HMBa2Q
- deleted 3y ago[deleted]
- noobcoder 3y agoCorrect me if i am not wrong they probably defining initial conditions for the particles (such as positions (to create the spongebob (althought I wish there was a way to convert an image to these n bodies), velocities, and masses) Then you set up the gravitational interactions between them and futher iteratively update their positions and velocities over time using some numerical integration method (Euler's method/Runge-Kutta method?) to simulate their motion
- buescher 3y agoLooks like it. A.K. Dewdney did a computer recreations column in Scientific American back in the eighties with a nice exposition of how to do a basic star cluster simulation. Only practical with a lot fewer “stars” on the gear I had available then. It used Euler’s method iirc.
- jhbadger 3y agoSpeaking of which, Dewdney recently passed away on March 9th but I haven't seen any notice of it on HN or other CS-related sites. I know he alienated a lot of people with his unfortunate turn to conspiracy theory after 9/11, but he really contributed a lot to popular interest in CS and recreational mathematics in the 1980s and 1990s through his Scientific American articles and his books.
- buescher 3y agoI'm sorry to hear that. His columns and books were a big influence.
- epiccoleman 3y agoOh man, what a trip to see Dewdney mentioned. I have a copy of The Magic Machine on my shelf which I (unintentionally) stole from my university library at the end of my senior year. His work was pretty influential on me, inspiring me to keep exploring programming at a time when my day to day work in the subject was often painfully boring.
- 3y ago
- vorticalbox 3y agoDoes anyone know what software was used?
- jpendry 3y agoFrom his reply tweet: 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.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- ShitHNsays 3y ago[flagged]
- HankB99 3y agoI guess not. I'm just a bit too old to be a fan of Spongebob but I'm still a little sad to see how he ended. :-/
- thih9 3y agoI'd prefer if the larger areas like eyes consisted of a single large circle with greater gravitational pull, as opposed to multiple small dots.
- dudeinjapan 3y agoCheck out the album “The Mollusk” by Ween—supposedly the musical inspiration for Spongebob.
- amelius 3y agoNo collisions?
- hermitcrab 3y agoIIRC two galaxies can pass through each other with no collisions, because the space between the stars is so large compared to the size of the stars. Quite how well that applies to Spongebob is an open question.
- amelius 3y agoSpace between atoms is also very large compared to the size of atoms. Yet, making two everyday objects pass through each other is not that easy ...
- 4gotunameagain 3y agoTo the size of their core, sure. But a collision happens way before the atom cores are close to eachother, as you already mentioned. Therefore it does not compare as an analogue. Additionally, the densities of the systems are also very different (not in absolute terms of course)
- hermitcrab 3y agoElectromagnetism is some 40 orders of magnitude stronger than gravity. Also gravity only attracts, it doesn't repel like 2 atoms approaching each other. So it is really quite different.
- butlike 3y agoAre we assuming the objects retain form? If I smash two iron cubes together and apply enough gravity, eventually I'll get fusion of the atom cores. As the highly-compressed charged particles start to collide more-and-more, some will repel, some will fuse. As long as the 2nd law is in play, I could see the two objects as being passed through each other. One side you have particlesA[cub1_particles, new_fusion_particles] and on the other side you have particlesB[cube2_particles, new_fusion_particles]. Both of these would sum to the same thermodynamic energy of [cube1, cube2]. Right?
- mort96 3y agoThis is cool! ...but 1 second per time step is a lot. I wonder how fast it would've been if it wasn't in Python. I think we as a society are doing a whole lot of people (especially physicists) a disservice by mainly teaching them Python rather than languages which are literally hundreds of times faster in some cases. Python works well when you just want to glue together existing fast C or Fortran libraries with Python APIs, but it quickly proves limiting. I've personally been caught by the Python trap, where the easiest way to do something was to write a Python script to do it, and it worked, but then I wanted to try to process more data or whatever, and suddenly Python is a huge limiting factor. I then spend more time parallelizing the Python code to make it run faster, and it becomes a beast that's hard to debug and which maxes out 32 CPU cores and is still 10x slower than what a single threaded Rust program would've been and I regret my choice of language. EDIT: Also, this is in no way anti-Python, I think it's a nice language and there are many uses where it is wholly appropriate.
- Jabrov 3y agoYour Python program maxing out 32 cores was x10 slower than a single threaded Rust program? Are you exaggerating? If not, can you share a bit more?
- mort96 3y agoIt's slightly exaggerated; the Python program might not have been able to fully utilize all cores, it's really just 16 cores with hyperthreading. But it's not unreasonable: 150x speed-up isn't unexpected when going from Python to C/Rust/C++ in number crunching code, 150/16=9.3 (16 is based on the assumption that the gains from hyperthreading and the losses from imperfect parallelism more or less cancel out) I don't think I have the code for these large-ish data processing experiments I did any more, but it would be fun to make some toy problems with large amounts of data and create comparable Python and C implementations and create a blog post with the results.
- pulvinar 3y agoCan we assume that you weren't able to use Numpy here, or at least that your inner loops weren't using it? It can be faster than C++ when you don't happen to know all the optimizations the Numpy library writers knew.