Skip to content

A simple gravitational n-body simulation routine written in Julia

License

Notifications You must be signed in to change notification settings

ilovematter/nbody_jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nbody_jl

This is a simple gravitational n-body simulation routine written in Julia. It uses Velocity Verlet integration to compute trajectories of n bodies. It outputs the body positions to a csv file (can be opened in almost all text editors or spreadsheet applications) and saves an svg image file of plotted trajectories. Simulations are set up with a simple text configuration file (an example "input.txt" is provided).

2-body example:

2_body_example

3-body example:

3_body_example