import matplotlib.pyplot as plt
import numpy as np

from Adhesion.Interactions import PowerLaw, Exponential
pot = PowerLaw(0.5, 3 * 0.2, 3)
exp = Exponential(0.5, 0.2) 

fig, (axpot, axf, axcurv) = plt.subplots(3,1)
r = np.linspace(-0.001, 2)

v, dv, ddv = pot.evaluate(r, True, True, True)

axpot.plot(r, v, label="PowerLaw")
axf.plot(r, dv, label="PowerLaw")
axcurv.plot(r, ddv, label="PowerLaw")

v, dv, ddv = exp.evaluate(r, True, True, True)

axpot.plot(r, v, label="exponential")
axf.plot(r, dv, label="exponential")
axcurv.plot(r, ddv, label="exponential")

axpot.set_ylabel("Potential")
axf.set_ylabel("interaction stress")
axcurv.set_ylabel("curvature")

for a in (axpot, axf, axcurv):
    a.grid()

axcurv.set_xlabel("gap")
axpot.legend() 
fig.savefig("PowerLawPotential.png")
../_images/84135170d01484340e61cf02b9fc51cdbcf664dc30cbf0540ea83e6b9e9b8a0c.png