Sitemap
Rhett Allain

Rhett Allain

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

Member-only story

Python Physics: Constant Acceleration in 1 Dimension

21 min readAug 24, 2026
Press enter or click to view image in full size
decorative art showing python code and output graph
Python Code for the motion of two cars.

This is going to be a series of chapters that go over the details of using Python in your physics course. Here is my Intro and Chapter 1.

Introduction

Hello there. This book is all about physics and python. Maybe you already understand physics and you just want to add some python. Cool. Oh, maybe you are a python expert and you want to apply it to some physics problems. That works too. Yes, it’s possible that you want to learn both physics and python. Well, let’s do it.

WHY USE A COMPUTER?

I guess we should get to the most important question — why should we do python with physics? OK, let’s think about physics. This is the process of building models of the real universe. Most of these models could be some type of mathematical formula. Let me just give you an example using the gravitational force (we will look at this in more detail later).

Of course we can use this to calculate the gravitational force between two objects (like with a binary star system). You can use that force to calculate the motion of both of the stars. However, if you have THREE stars it turns out that an algebraic solution is not possible. Yes, this is the famous “three body problem”. Fortunately, if we use numerical calculations we CAN determine the motion of all three…

--

--

Rhett Allain
Rhett Allain

Written by Rhett Allain

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