The attached file contains a script contributed by Ed O'Brien to calculate the excess chemical potential using the Widom particle insertion method.
The code is based on the algorithm described by Frenkel in his book 'Understanding Molecular Simulation.' Please look there for details.

In the script, the chemical potential is printed out using the variable @chempot.

L Nilsson made some changes for increased file reading efficiency.

Attached Images
widom_insertion.txt (6.02 KB, 743 downloads)

Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden