Table of Contents
I built a physics simulation library that models springs, pendulums, epidemics, gravity, and more. The simulations run locally with matplotlib, but you can also explore them interactively through Jupyter notebooks, no install required.
Click any button below to launch a live notebook in your browser via Binder. It takes about 30-60 seconds to spin up the first time (it’s building a fresh Python environment from my GitHub repo), then you’re in a full Jupyter session where you can run cells, tweak parameters, and see the results.
Available Notebooks
Spring Pendulum
A mass on a spring swinging under gravity. Learn Hooke’s Law, derive the equations of motion, implement Euler and RK4 integrators, and explore how spring constant, damping, and gravity affect the trajectory.
N-Body Gravity
Multiple bodies orbiting under gravitational attraction. Set up binary star systems, add test particles, and watch orbits form (or fly apart). Explores the Verlet integrator and energy conservation.
SIR Epidemic Model
The classic Susceptible-Infected-Recovered model. Adjust infection rate, recovery rate, and population size to see how epidemics spread and what “flattening the curve” actually means mathematically.
Riemann Sums
Visualize how rectangles approximate the area under a curve. Adjust the number of subdivisions and switch between left, right, midpoint, and trapezoid methods. Watch the approximation converge to the true integral.
Lissajous Figures
3D curves from combining oscillations at different frequencies. Adjust frequency ratios and phase to generate everything from circles to complex knots. Includes a discussion of when curves close vs. remain open.
How This Works
These notebooks run on mybinder.org, a free service that builds a Docker container from my GitHub repo, installs the physics-modeling package, and gives you a Jupyter session. When I update the notebooks or the simulation code in the repo, Binder picks up the changes automatically on the next launch.
No Python install, no pip, no environment setup. Just click and explore.
Run Locally
If you’d rather run these on your own machine:
git clone https://github.com/professor314/Physics-Modeling.git
cd Physics-Modeling/extensions
pip install -e ".[notebook]"
jupyter lab notebooks/
Or use the GUI launcher:
pip install -e .
py -m physics_modeling