File Exchange

image thumbnail

Billiard Simulator

version (118 KB) by Samuel King
An updated GUI to simulate billiard systems on Matlab.


Updated 24 Jul 2016

View License

This is the updated version of a GUI to simulate billiard systems on Matlab. The original release is at, which was written for general research in billiard dynamical systems. The new 2016 release allows the user to create angled mushroom billiards and features new code to compute the Positive Lyapunov Exponent for all billiard domains in the software package except for the limacon domain. The documentation for the original software is located at
Update by Mark Demers, Caitlin Keady and Sam King,
based on original code by Mason Porter and Steven Lansel.

Cite As

Samuel King (2021). Billiard Simulator (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Fabrizio Falasca

Mark Demers

@Ksenia Sosnova. I think the confusion is with Lyapunov exponents for the map versus Lyapunov exponents for the flow. Lyapunov exponents for the map do not change under scaling, while those for the flow do scale by the average time between collisions (which scales essentially like A^{1/2} as you said). The Lyapunov function we wrote computes Lyapunov exponents for the map only. Dividing these by the mean time between collisions should give the Lyapunov exponents for the flow.


Thanks for your work!
I have a difficulty and would greatly appreciate if you could clarify it for me. I'm testing your package for the Lyapunov exponent calculation in the stadium billiard, and it doesn't seem to work correctly. Let's restrict to the case a/R=1. No matter what size of the billiard I set, the average Lyapunov exponent at long time goes to about 0.7, while it's known that the exponent for the billiard with a=R=1 is around 0.43, and it should scale as A^(-1/2), where A=(4+pi)*R^2 is the billiard area. Why do I always get 0.7? Is the velocity of the particle always set to 1?
Thank you in advance!

Mason Porter

This is an excellent update to our original version of the billiard simulator.

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Billiard Simulator

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!