Show HN: 2D Coulomb Gas Simulator
https://simonhalvdansson.github.io/2D-Coulomb-Gas-Tools/index_gpu.html
A pretty simple but fun to play with simulator for a concept from mathematical physics called the "2D Coulomb gas". I originally made this for my Bachelor's thesis to create pretty pictures and build intuition but have recently gotten it a fresh coat of paint and better performance curtesy of WebGPU acceleration (ported with liberal help from Codex to get through all of the boilerplate).Play around with it - hopefully read up more on the 2D Coulomb gas because it is an incredibly deep topic research wise.
(
9 comments
| 16 points
| on HN
)
You have to painfully force quit Safari by going through the motions of the gestures, wait for the phone to respond, and then quit Safari from the card task switcher.
Note 2: In this case, 2D means that the force is proportional to distance^-1 instead of the usual distance^-2. It's not a 3D word projected into a plane, it's a real 2D word that lives inside a plane. It would be nice to have an option to switch and compare. I have no intuition about the difference.
Note 3: Somewhere in the middle, it's possible to switch the external potencial from z^2 to z^4 to z^20, where z is the distance from the center.
z^2 "Ginibre" is a nice round surface, like a wok. Electrons get evenly distributed.
z^20 "Mittag-Leffler lambda=10" is flat in the center and then goes up quickly, like a saucepan. Electrons escape from each other, a few of them remain in the center but most get squashed against the circular wall.
z^4 "Mittag-Leffler lambda=2" Something in between
Thanks for playing around with the tool!
With z^20, the problem is that when you change the number of particles, the ones are distributed randomly and the ones near the corners have a huge gradient and probably overflow and the inifinites/nans are viral and kill all the other particles. The trick is to switch to z^2, change N wait a moment and then change to z^20. Perhaps you can clip some values or try some trick like in stiff equations.
In 3D, I expected a z^2 potencial with a 1/z^2 force to generate an uniform distribution, for something something Gauss. (It's just bad hand-waving, I didn't have anything close to a proof.) It's interesting that it is so easy.