Last edited 08dec14 by
Math 198 Hypergraphics Project for Sam Stephens
Find this document at

Liouville's Theorem for Hamiltonian Systems


Physical systems can be described in many ways, one of the most significant is by their Hamiltonian function, an equation for the energy of a system. This formulation gave rise to Liouville's theorem, a theorem about reversibility in classical systems. This project will explore the meaning of this theorem through visualizations of phase space, the set of possible states for a system, and numerically validate it for the cases of a pendulum, double pendulum, and a gravitational mass on a fixed track.

Interacting with the program

A video of program interaction. I show the ability to select regions of phase space, toggle the axes and statistics, draw grid lines, selecting the system, and speeding up and slowing down the simulation. More details of how to interact with the program are outlined in the documentation.


Overall, the program shows decent accuracy. The pictures show the accuracy for the different systems; generally errors fell within a few percent. A shorter time frame had to be used for the double pendulum because its motion is chaotic.


Update: 11/03/14
Found an implementation of RK4 in python. Successfully drawing basic shapes in OpenGL; I'll gradually modify this into my project. Presented on Friday. Current plan is to implement the differential equations for a general Hamiltonian, then implement the Hamiltonians.

Update: 11/14/14
Added a working animation for the phase space of the pendulum. My plan for this week is to implement another Hamiltonian, a way to calculuate volume changes (as detailed in my proposal) and improve the apperance by rescaling or shifting. I may add documentation.

Update: 12/08/14
Added 2 more Hamiltonians and the ability to interact with the program via the mouse and keyboard. User can select initial areas as well as pause or change simulation speed. Made slight performance tweaks.


Here is my proposal, seminar, documentation, and final presentation.