- #1
JRPB
- 22
- 0
EDIT: I'm not in my sharpest moment. I just found a bunch of posts that discuss this. I'll read them and update this post if I find an answer.
I'm working on a hard-sphere MC simulation (for a class). I want to compute the radial distribution function [itex]g(r)[/itex]. To put you in context, as to my non-expertise in statistical mechanics, I'm a physics senior undergrad taking the last couple of courses.
My program generates valid states for a non-periodic square box. States are computed with a restricted random walker: particles stay inside the box and do not overlap each other. I want to compute thermodynamic quantities. My ignorance led me to believe (taking equiprobability of micro-states for granted) that sampling such states is equivalent to working with an NVE ensemble. I asked one of my professors about this connection and realized that it's not that simple.
I learned that you can use the RDF to compute some of these quantities. This leads me to my current predicament. How do I compute this function? I tried the literature and couldn't make heads or tails of the definition. As a stab-in-the-dark I tried my own method to see if I could reproduce some of the good looking RDFs around. I came up with an RDFesque function. Far from smooth.
My algorithm:
1) Surround the box with 8 replicas (same particle state, just displaced)
2) Pick a random particle from the original set
3) Compute the maximum circumference (centered at the particle) that fits inside the 9 boxes.
4) Create a circular shell of radii: r, r+dr and count all the particles' centers that lie within this shell.
5) Divide this number by the shell's area
6) Repeat from step 2 and average over N calculations
Attached is an image of my result. The labels are in spanish (it's still pretty clear what is what). The top right chart is a time series of the accept-rate of my random walker. Ignore the x-scale on the g(r). I'm plotting distance from particle v.s. g(r). I tested different shell widths [itex]dr[/itex]. [itex]\frac{\sigma}{10}[/itex] seems ok. Anything smaller gets noisy very fast.
Any suggestions or pointers to references on how to correctly implement this will be greatly appreciated.
I'm working on a hard-sphere MC simulation (for a class). I want to compute the radial distribution function [itex]g(r)[/itex]. To put you in context, as to my non-expertise in statistical mechanics, I'm a physics senior undergrad taking the last couple of courses.
My program generates valid states for a non-periodic square box. States are computed with a restricted random walker: particles stay inside the box and do not overlap each other. I want to compute thermodynamic quantities. My ignorance led me to believe (taking equiprobability of micro-states for granted) that sampling such states is equivalent to working with an NVE ensemble. I asked one of my professors about this connection and realized that it's not that simple.
I learned that you can use the RDF to compute some of these quantities. This leads me to my current predicament. How do I compute this function? I tried the literature and couldn't make heads or tails of the definition. As a stab-in-the-dark I tried my own method to see if I could reproduce some of the good looking RDFs around. I came up with an RDFesque function. Far from smooth.
My algorithm:
1) Surround the box with 8 replicas (same particle state, just displaced)
2) Pick a random particle from the original set
3) Compute the maximum circumference (centered at the particle) that fits inside the 9 boxes.
4) Create a circular shell of radii: r, r+dr and count all the particles' centers that lie within this shell.
5) Divide this number by the shell's area
6) Repeat from step 2 and average over N calculations
Attached is an image of my result. The labels are in spanish (it's still pretty clear what is what). The top right chart is a time series of the accept-rate of my random walker. Ignore the x-scale on the g(r). I'm plotting distance from particle v.s. g(r). I tested different shell widths [itex]dr[/itex]. [itex]\frac{\sigma}{10}[/itex] seems ok. Anything smaller gets noisy very fast.
Any suggestions or pointers to references on how to correctly implement this will be greatly appreciated.