~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to tools/moltemplate/examples/coarse_grained_examples/vesicle_Brannigan2005+Bellesia2010/moltemplate_files/calc_table/calc_CGLipidTableINTvsINT.py

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# Calculate a table of pairwise energies and forces between "INT" atoms
 
4
# in the lipid membrane model described in 
 
5
#   Brannigan et al, Phys Rev E, 72, 011915 (2005)
 
6
# The energy of this interaction U(r) = eps*(0.4*(sigma/r)^12 - 3.0*(sigma/r)^2)
 
7
# However it is truncated at rc2 = 22.5 (shifted upwards to maintain continuity)
 
8
 
 
9
def U(r, eps, sigma):
 
10
    return eps*   (0.4*pow((sigma/r),12)  -  3.0*sigma*sigma/(r*r))
 
11
def F(r, eps, sigma):
 
12
    return eps*(12*0.4*pow((sigma/r),13)/sigma - 2*3.0*sigma*sigma/(r*r*r))
 
13
 
 
14
epsilon = 2.75/4.184 # kCal/mole
 
15
sigma   = 7.5
 
16
Rmin    = 0.02
 
17
Rmax    = 22.6
 
18
rcut    = 22.5
 
19
N       = 1130
 
20
 
 
21
for i in range(0,N):
 
22
    r = Rmin + i*(Rmax-Rmin)/(N-1)
 
23
    U_r = U(r, epsilon, sigma) - U(rcut, epsilon, sigma)
 
24
    F_r = F(r, epsilon, sigma)
 
25
    if r > rcut:
 
26
        U_r = 0.0
 
27
        F_r = 0.0
 
28
    print(str(i+1)+' '+str(r)+' '+str(U_r)+' '+str(F_r))
 
29