Sample source code of Monte Carlo simulation for a random walk in a potential, which simulates the nucleation of a droplet in supersaturated vapor. The potential function is
where
$ make clean
$ make
-
nucleation.rb
A source file
-
nucleation.dat
Nucleation Time vs. Inverse temperature
-
nucleation.plt
Plot file for gnuplot
-
nucleation.png
Plot image by gnuplot