Visual Basic program VB VirialTh - Description and operation

Introduction and Purpose

The purpose of the Visual Basic program VBvirialTh is to demonstrate the Virial Theorem by performing a simulation of a cluster consisting of n objects.
To download an executable select: VIRIALTH.ZIP
To see the listing of the program in QB select: VIRIALTH.HTM


The program is based around Newton's Law.
Input to the program are four parameters: N, "Reff at t0", Random and merge Accordingly to Newton's Law when the distance is zero the Force increases to infity. In order to prevent this to happen and to keep the speed reasonable the acceleration is set to set to zero, when the distance between two objects becomes small (<0.3),
When the distance of an object is further away than Reff and when the speed of the object is larger than the escape velocity the object is not used any more in the calculation of Reff and the value n (number of objects) is decreased with 1.

The simulation consists of two parts: Initialisation and Actual.


Operation of the program is done from the Control Display. See below for more information.
The Control Display contains for push buttons: "Start", "Cancel" and "Clear".


Operation of the program involves 4 displays: 1) Control. 2) Matrix Display 3) Mass Display and 4) Cluster Display.




Original 6 December 2005

Back to my home page: Contents of This Document