Programs written or used in laboratory hours

 The programs were written in C and are made for a simple C compiler under DOS. Some of them uses graphics, so in the present form are not working under Linux operating systems.

  1. simple random walk in 1D download rwd1.c
  2. solving by MC method the “rats” problem download rats2.c
  3. the histogram test for the simple float random number generator on the [0,1) interval. download r1.c
  4. the return-map test for the simple float random number generator on the [0,1) interval. download r2.c
  5. the exponential variation of the uncovered area in the return-map test. download r3.c
  6. generating float random numbers distributed according to the g(x)=3x2 distribution function on the [0,1) interval. download r4.c
  7. calculating the value of PI by a Monte-Carlo type method. download pi.c
  8. visualizing the convergence of the method for the calculation of PI. download pi_graf.c
  9. normal and Monte Carlo integration of the function (1-x^2) on the [-1,1] interval. download integ1.c
  10. normal and Monte Carlo integration of the (1-x^2)*exp(-x^2) function on the [-1,1] interval. download integ2.c
  11. normal, straightforward Monte Carlo and important sampling Monte Carlo (with p(x)=3/4(1-x^2)) integration of the function f(x)=(1-x^2)*exp(-x^2) on the [-1,1] interval. download integ3.c
  12. Metropolis Monte Carlo method (with p(x)=3/4(1-x^2)) for the integration of the function f(x)=(1-x^2)*exp(-x^2) on the [-1,1] interval. download integ4.c
  13. Metropolis Monte Carlo method for generating Brownian motion in 1D with a fixed heat-bath temperature and friction constant download brown1.c
  14. a basic Glauber MC algorithm for the 2D Ising model. download isinga.c
  15. a basic Metropolis MC algorithm for the 2D Ising model. download isingb.c
  16. calculating <m(T)> , <Cv(T)> and <Chi(T)> for the 2D Ising model by the Metropolis algorithm. download isingc.c
  17.  calculating the fluctuation in the magnetization as a function of temperature by the Swendsen and Wang algorithm. download sw.c
  18.  a basic code for the 2D Ising system by using the Wolf algorithm. download wolf.c