Lannard-Jones


In [1]:
%matplotlib inline

In [2]:
from pylab import *

In [3]:
e = 1
s = 1
r = linspace(0.96, 3, 1000)
u = 4*e*((s/r)**(12)-(s/r)**(6))
rd = linspace(3, 4, 1000)
ud = 4*e*((s/rd)**(12)-(s/rd)**(6))

fig = plt.figure(figsize=(6,4), dpi=300)

axes = fig.add_axes([0.15,0.15, 0.8, 0.8]) # main axes

axes.plot(r, u, 'r')
axes.plot(rd, ud, 'b--')
axes.grid(True)
axes.set_xlim(0, 4)
axes.set_ylim(-1.3, 1)

annotate('cut-off',
         xy=(3, 0), xycoords='data',
         xytext=(+10, +30), textcoords='offset points', fontsize=16,
         arrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))

axes.set_xlabel(r'$r^*_{ij}$', fontsize=18)
axes.set_ylabel(r'$\mathcal{U}^*_{LJ}$', fontsize=18)


Out[3]:
<matplotlib.text.Text at 0x7f78f0109650>

In [5]:
fig.savefig("lj.pdf",bbox_inches='tight')

In [ ]: