N-Body simulation Excel

N-Body simulation Excel

Following this Youtube video from s0lly, and the related project on GitHub, downloaded it and started some modifications:
  • simplyfied formulation (easy to follow)
  • collision detection (bigger body increases mass, although does not varies radius…). From this point there is some room for tool improvements I may explore in future: angular velocities, radius and gravity variations (density), particle creation from collision, accretion,…
  • system for trajectory tracking, would be nice for a well curated initial data, although a bit chaotic if random data is provided, specially on “Planetary system” setting on TRUE…
  • chart exporting to JPG on each step (so it can easily turn to GIF)
  • final but not least, rearranged old VBA and new code for better performance/new capabilities
I could not get good results on the Planetary configuration, which I should investigate further, but the file continues working for the chaotic data, so the maths should be OK there.
I did also wanted the GIF frames automated, but the Chart refuses to export if played on a Do-Loop (the DoEvents would not make it work if used), problem is related to Excel chart not refreshing at the pace the values are computed. So there is a chance to use SendKeys to get this thing automated. Running on Excel 2003 is OK for main bodies (even if there is no place for more than 85 trajectories… could transpose array to solve this issue), but the track paths do no show… maybe is the bubble size but did not dig enough to narrow down the causes for this behaviour.

You can grab my modified file here: N-Body Simulator_revisited

Leave a Reply

Your email address will not be published. Required fields are marked *