PyData Seattle 2023

A Perfect, Infinite-Precision, Game Physics in Python
04-27, 10:15–11:00 (America/Los_Angeles), Kodiak Theatre

This fun and visual talk shows how to create a perfect (but impractical) physics engine in Python. The key is Python’s SymPy, a free package for computer algebra.

The physics engine turns parts of physics, mathematics, and even philosophy into Python programming. We’ll learn about:

  • Simulating 2-D Newtonian physics such as Newton’s Cradle and the two-ball drop
  • Having the computer solve math problems too hard for us to personally solve
  • The surprising (even to physicists) non-determinism of a billiards break
  • Thoughts on making the simulator more practical

If you are an enthusiast interested in what Python can do in other fields, or an expert interested in the limits of simulation and programming, this talk is for you!


  • The top-level of a perfect physics engine -- simulating Newton's Cradle and Tennis Ball & Basketball Drop
  • Simulating a billiards break -- the surprising incompleteness of Newtonian collisions uncovered by Python
  • Using the SymPy Python package to create the low-level Python functions needed by the perfect simulator.
  • Problems with the simulator and how to speed it up (a bit)

Prior Knowledge Expected

No previous knowledge expected

Ph.D. in CS and Machine Learning. Retired Microsoft & Microsoft Research. Volunteer, open-source projects related to ML, Genomics, Python, and Rust.

This speaker also appears in: