In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as pl

In [2]:
s=1.0
x=np.linspace(1.03,1.2,100)
Uo=1.0

U=Uo*((s/x)**12-(s/x)**6)

pl.plot(x,U)
pl.grid()



In [3]:
x0=2**(1/6)*s
k=9*2**(2/3)*Uo/s**2

Ut=-Uo/4.0 + 0.5*k*(x-x0)**2
pl.plot(x,Ut,'g-')
pl.plot(x,U,'r-')


Out[3]:
[<matplotlib.lines.Line2D at 0x10ea3bc50>]