Computational Physics - Guide

Using the simulator is pretty straight forward. After running the program the user is presented with a menu. The first thing that must be done is setting the simulation parameters. Without setting the parameters, no simulation can be run. Setting the parameters is done by choosing option (1). You will then be presented with a sub menu allowing editing of various parameters. Choosing "Finish" without setting anything, and confirming the change, results in the default simulation parameters, which are:

Left table:
  Length: 7
  Squared Ratio: 3
Right Table:
  Length: 15
  Width: 10
Step size: 1 milli
Simulation length: 1000 steps
Output path: Local directory

Note that Length always refers to the vertical axis, while Width refers to the horizotal. The squared ratio is defined as the square of Width/Length. Also note that choosing the default settings places a single pre-generated particle positioned in (1, 1) and moving with the velocity (12, -9).
Any (or all) parameters may be changed at all times, however this will result in a reset to the system, thus continuing a previous simulation after a change of parameters is not possible. It is important to choose a proper step size. Too large a step might lead to wrong results and unpredictable behaviour. In this sense, the step size should be chosen such that when the velocity of the particles is taken into account, the displacement per step is small compared to the particle radius. In case a full path is supplied for output, instead of the SCREEN string, the simulator creates a series of .xyz files describing the particles locations at different steps of the simulation. The .xyz files also include particles located on the boundaries. These were added out of an aesthetic consideration, to allow a rendering of the boundaries.

After setting the simulation parameters, adding particles to the system is required. A simulation might run without particles, but it will obviously result in no dynamics and empty files. Please remember that default settings include a pre-generated particle. Removing the particle is possible with the appropriate option in the menu. As this is a 2D billiard, particles are 2D discs. The discs may have different radii, however to keep the simulation simple, all are assumed to have the same mass. Naturally discs cannot overlap, nor can they overlap with the boundaries. It is possible to add discs outside the billiard table, but that may result in an infinite movement on a straight line, since the potential in this simulator is taken to be infinite only on the boundaries. Unlike simulation parameters, particles can be added and removed from the simulation without incurring a system reset.

The third step is simulating the system. Output is displayed on screen or written to .xyz files, depending on the path provided in the simulation parameters. The output coordinates are relative to a right-handed coordinate system, with the X axis parallel to the horizontal borders, the Y axis parallel to the vertical borders and the origin is the lower-left vertex of the left table.

It is also possible to create a filelist.dat file, containing the names of the .xyz files in proper order. This is done to allow an animated visualization using packages like AVIZ. For a guide on using AVIZ to create animations. please refer here.