Solving the Three Body Problem With Python

Rhett Allain
9 min readMar 10, 2023
Image: Rhett Allain. Stable 3 Body Motion

Yes, it’s time for the famous Three Body Problem. How do you model the motion of three objects interacting gravitational (those are the 3 bodies)? Well, let’s jump back for a second. How do you model just TWO objects with a gravitational interaction?

The Two Body Problem

Here are two planets (or stars — it doesn’t matter, you pick).

--

--

Rhett Allain

Physics faculty, science blogger of all things geek. Technical Consultant for CBS MacGyver and MythBusters. WIRED blogger.