git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11955 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2014-05-09 15:34:57 +00:00
parent 153de89ab3
commit db78f042ef
6 changed files with 185 additions and 0 deletions

23
tools/fep/fep.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python
# fep.py - calculate free energy from compute fep results
import sys, math
if len(sys.argv) < 2:
print "Free Energy Perturbation"
print "usage: fep.py temperature < fep.lmp"
sys.exit()
rt = 0.008314 / 4.184 * float(sys.argv[1])
v = 1.0
sum = 0.0
for line in sys.stdin:
if line.startswith("#"):
continue
tok = line.split()
if len(tok) == 4:
v = float(tok[3])
sum += math.log(float(tok[2]) / v)
print -rt * sum