diff --git a/README.md b/README.md index 6991455..b0ac601 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # NBODYX: Simulating N-Body Systems with Jax This repository derives ODEs for N-Body systems and simulates them using Jax. The main goal is to provide a simple and efficient way to simulate N-Body systems using Jax. +It is heavily inspired by the amazing [ThreeBodyBot](https://github.com/kirklong/ThreeBodyBot) and specifically the [NumericsTutorial](https://github.com/kirklong/ThreeBodyBot/blob/master/NumericsTutorial/NumericalDynamicsTutorial.ipynb). + +![3-body problem](assets/three_body.gif) ## Installation @@ -25,7 +28,7 @@ conda install -c conda-forge ffmpeg ## Usage -The following example simulates a 3-Body system: +The following example simulates a 3-body system: ```python from diffrax import diffeqsolve, Dopri5, ODETerm, SaveAt diff --git a/assets/three_body.gif b/assets/three_body.gif new file mode 100644 index 0000000..3e4da72 Binary files /dev/null and b/assets/three_body.gif differ diff --git a/examples/outputs/three_body.mp4 b/examples/outputs/three_body.mp4 index 8ed11c3..cec37dc 100644 Binary files a/examples/outputs/three_body.mp4 and b/examples/outputs/three_body.mp4 differ diff --git a/examples/simulate_three_body_problem.py b/examples/simulate_three_body_problem.py index 301f7fa..8030db1 100644 --- a/examples/simulate_three_body_problem.py +++ b/examples/simulate_three_body_problem.py @@ -77,7 +77,8 @@ 500, 500, video_path="examples/outputs/three_body.mp4", - speed_up=ts[-1] / 10, + speed_up=1.0, + skip_step=5, x_min=x_min, x_max=x_max, timestamp_unit="s",