TransWikia.com

Simulation of gravity : velocity goes to infinity when distance is zero

Physics Asked by rafoo on March 21, 2021

I tried to implement an N-Body simulation. Everything works, but when particles go very close to each others, the energy (hence the velocity) tends to $∞$, making a very high social distancing and "bounce", making the simulation fairly inaccurate over time. How can I fix that ?

I can’t access to the code right now but it’s a simple iterative solver, calculating the energy at each time, then updating the acceleration, then the velocity, and then the position.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP