Exoplanets!

Simulating planets with REBOUND

The projects make use of the REBOUND code, which can simulate planets orbiting a star using Python. The following describes how to install the relevant software and get started using REBOUND.
  Note 1: You can hopefully learn the necessary Python as you do the tutorials. But if you need more help, there are resources for learning Python [here]; or you can google for help with particular commands.
  Note 2: The core REBOUND code is in C. So if you know how to program in C, you might prefer to ignore the Python wrappers.
Windows users: Download [this] and follow the instructions in the file Installation Instructions.txt

1. Install Python: We recommend using Canopy Python, which is a bundled installation of Python that has hundreds of libraries either preinstalled or easily installed via a package manager. Canopy is free for anyone with an edu email address. To install python: Go to the Canopy website [here], register for an account with your .edu email and download the appropriate installer for your computer. Once installed, you should be able to write and run Python code.

2. Install REBOUND: We will be using the REBOUND [link] code written by Hanno Rein, which simulates planets orbiting a star. It does that by adding up Newton's gravitational force on each planet, and using that force to accelerate the planet. It can also simulate a star orbiting a star (a binary star), planets orbiting multiple stars, etc. To install REBOUND you first need to have a suite of compilers that you may or may not have already (if you've never done any programming chances are you don't).

Note that these are large files and may take a while to download and install.

Once you have your compiler suite installed, you can install REBOUND. To do this we will be using the pip package manager.

Once your terminal is open type the command pip install rebound. You should see output scrolling down as pip installs REBOUND.

REBOUND should now be installed on your machine and ready to use.

3. To get started, download this Jupyter notebook file: [mercury1.ipynb]. To use the file, open a terminal, cd to the directory the file is in, and type: "ipython notebook mercury.ipynb". Follow the instructions in the file.

4. Next, try the exercise in [mercury2.ipynb], in which you show Mercury precessing due to Jupiter. Once you've done that, look at [mercury3.ipynb] to see how fast Mercury precesses.

5. To learn more about REBOUND, explore some of the REBOUND python tutorials and examples here [link].