2D, 3D, 4D gravity simulation

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ย. 2024

ความคิดเห็น • 7

  • @sirynka
    @sirynka 4 หลายเดือนก่อน

    I've just tried to implement gravity simulation in rust (8 cores, simple n**2 algorithm with Euler's integration) and got ~55 ms per step (18 fps) for 10k particles.
    After that re-implemented the sim using pytorch tensors. On 4090 10k ~ 5 ms sim + 3 ms rendering.
    Managed to push it up to 35k, before running out of mem, got 60 ms per frame (16 fps).
    P. S. Measurements were collected for 3D sim.

  • @kristoferkrus
    @kristoferkrus 11 หลายเดือนก่อน +4

    Impressive! It would be cool if you simulated collisions to see if you could get something that resembled disk-shaped galaxies, since discs are essentially the shapes they will take on given enough time when the collisions are plastic.
    Did you implement Barnes-Hut? Not that I have implemented any of these algorithms myself, but there is an algorithm called fast multipole method (FMM) that is supposed to be able to simulate each time step in O(n) time. Maybe it can give you a small performance boost (but I guess n needs to be over a certain threshold for it to start to be faster than Bernes-Hut).

    • @tucan7112
      @tucan7112  11 หลายเดือนก่อน

      i see FFT I run away

    • @kristoferkrus
      @kristoferkrus 11 หลายเดือนก่อน

      @@tucan7112It doesn't use FFT. It's kind of similar to Barnes-Hut.

  • @totoshampoin
    @totoshampoin 11 หลายเดือนก่อน +2

    4E looks more sparse, but probably because of the perspective effect.
    Ever tried to use slicing with ghost shadows? Or mapping the w axis to a color?

    • @tucan7112
      @tucan7112  11 หลายเดือนก่อน

      Here I just clipped near plane for the 4D camera.

  • @NonEuclideanDreamer
    @NonEuclideanDreamer 11 หลายเดือนก่อน

    Sweet!