I've written a summary of the equations and algorithms used in this simulation.
Merge remote-tracking branch 'origin/master'