Python in Space - The N Body Problem
summary
Shows an actual Python implementation of Barnes-Hut and compares it to brute force: naive O(n^2) loops versus an O(n log n) quadtree/octree, with concrete timings (brute force ~65 s/frame at 1,000 bodies versus ~1 s/frame for Barnes‑Hut; Barnes‑Hut handles ~1,000,000 bodies in the time brute force does ~10,000). Includes code on GitHub, renders (matplotlib) and edits with Blender, Avidemux & Sonic Pi, and demonstrates the algorithm working and its visual/accuracy tradeoffs.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 0:42Welcome
- 1:14Geocentric Model
- 2:34Seamus
- 3:03Hypatia
- 3:23Nicholas Copernicus
- 3:58The Sun
- 4:22Copernicus Criticism
- 5:31Extended Copernicus Model
- 6:18Kerbal Space Program
- 7:15Isaac Newton
- 8:29Newtons formula
- 9:15Undiscovered Planet 9
- 10:00The N Body Problem
- 10:46Big O notation
- 11:27Example
- 12:17Solution
- 13:00Josh Barnes
- 13:23Pete Hurt
- 14:34How it works
- 16:35Brute Force
- 17:15Burn Hot Algorithm
- 21:55Tree
- 23:41Python
- 24:10Body
- 24:37Helper methods
- 25:31Quadrant
- 26:02Burn Subtree
- 26:58System
- 27:26BruteForce
- 28:35Examples
- 29:11Results
- 29:46Results with 10 bodies
- 31:16Orbits
- 36:36Questions
related talks
33mWhy is Python slow?
28mNot a long time ago, in a galaxy not very far away, an astronomer and a computer scientist walk into
37mAccelerating Scientific Computing in Python with Numba: A Real-World Example
01h 00mIntroduction to Python
30mMultibody Simulation Using sympy, scipy and vpython
36mHow to Optimize your Python Program for Slowness
49mPython for High Performance and Scientific Computing
26mHarvest the power of the GPU for awesome special effects
