* First, we randomly select a particle index iMove to move, find the old position oldLoc of the particle. Then, we randomly select a new position newLoc. We also use deltaEnergy[ ] to compute the energy change dE if the particle were moved. Last, we use the Metropolis criterion to determine if succeed is true (if the move succeeds).*
attemptMove[] := Module[{newLoc, iMove, dE, succeed},
*If the move succeeds, we should update the total energy eTotal and use deltaPExcess[ ] to update the excess pressure pExcess. Then, we use removeFromCellList[ ] to remove the particle from the cell list, move the particle to its new location, and use addToCellList[ ] to add the particle back to the cell list.*
6) Determine Cv and Z in units of kB and εσ2, respectively
*Ideal heat capacity is NK, which in reduced units is 1. The excess heat capacity is correction to the ideal one. Ideal gas pressure is P = N kT/L2. In reduced units, P/P* is just areaF/bete. The excess pressure is correction to the ideal one.*
댓글 영역