Refracted the code responsible for simulation. We plot all figures in one file
by default. No interactive window is launched.

If no filename is given, pop up an interactive window.