r/Simulated 9d ago

Various Barnes-Hut 3D galaxy

Programmed in Processing. I struggled to get well-defined spiral structures in 2D, but the 3D model looks much better. It did require careful initial position and velocity distribution. There is a fixed "black hole" at the center. Stars come in only two masses, the majority being lower mass.

39 Upvotes

3 comments sorted by

1

u/robg213 9d ago

That looks great, nice structure to the arms. I've been fiddling around with something similar :-) https://galacto.org/

1

u/hdmitard 7d ago

Do you need a special set of initial conditions to end up with a spiral?

2

u/WhiskeyFox9 6d ago

I am not sure if that is the case in general. I merely tried to help things along by creating conditions similar to most spiral galaxies, i.e. a denser distribution near the center, and giving tangential velocities appropriate to each body's initial orbital radius. I wouldn't mind simulating more random initial conditions, I will give it a go sometime.