Friday, May 18, 2012

Particles in a Box - Diffusion



Consider a box divided into two equal halves separated by a wall with a hole through which particle exchange can take place. It is assumed that only one particle can pass through the hole per unit time. Let there be total N particles and assume that at t = 0, all the particles are on left side. (ie at t = 0, nl=N and Nr = 0). Once the hole is opened, particle exchange takes place and it continues till the equilibrium is reached. The system can be simulated with a simple statistical model. In order to simulate when N>>1, we assume that, all the particles have equal probability of crossing the wall. So probability of particle moving from left to right is Nl/N and right to left is Nr/N. Once the physical system is represented in probability function, application of Monte – Carlo method is straight forward. In code, it compares Monte – Carlo result with analytic solution, 

References:
1.          Computational physics – An introduction, Verma, R C, Ahluwalia, P K, Sharma, K C, New Age International (P) Limited, Publishers (2005)
2.          Computational Physics, Richard Fitzpatrick Professor of Physics, University of Texas at Austin
3.          Computational Physics, M. Hjorth – Jensen, Department of Physics, University of Oslo (2003)

1 comment: