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