Question: Write an MC code for a fluid of (N) hard spheres in a two-dimensional (L times L) square box and include a one-body gravity term
Write an MC code for a fluid of \(N\) hard spheres in a two-dimensional \(L \times L\) square box and include a one-body gravity term \(\sum_{i=1}^{N} m g y_{i}\) in the algorithm, that is, accept otherwise legal configurations with probability \(\exp (-\beta m g \Delta y)\). You will need to use hard-wall boundary conditions on the top and bottom walls. Determine the average number density as a function of the vertical position in the box.
Step by Step Solution
3.47 Rating (167 Votes )
There are 3 Steps involved in it
Below is a Python code implementing a Monte Carlo simulation for a fluid of N hard spheres in a twodimensional L times L square box with a onebody gra... View full answer
Get step-by-step solutions from verified subject matter experts
