```python
from sympy import *
from sympy.plotting import plot
import numpy as np
import matplotlib.pyplot as plt
```


```python
r, A, B = symbols('r A B')
V_LJ_AB, V_LJ_se, V_LJ_re, V = symbols('V_LJ_AB V_LJ_se V_LJ_re V', cls=Function)
```


```python
V_LJ_AB = A/r**12 - B/r**6
```


```python
V_LJ_AB
```




$\displaystyle \frac{A}{r^{12}} - \frac{B}{r^{6}}$




```python
epsilon, sigma, r_min= symbols('epsilon sigma r_min')
V_LJ_se = V_LJ_AB.subs(A,4*epsilon*sigma**12).subs(B,4*epsilon*sigma**6)
simplify(V_LJ_se)
```




$\displaystyle \frac{4 \epsilon \sigma^{6} \left(- r^{6} + \sigma^{6}\right)}{r^{12}}$




```python
V_LJ_re = V_LJ_se.subs(sigma,2**(-1/6)*r_min)
simplify(V_LJ_re)
```




$\displaystyle \frac{\epsilon r_{min}^{6} \left(- 2.0 r^{6} + 1.0 r_{min}^{6}\right)}{r^{12}}$




```python
p1 = plot(V_LJ_re.subs(epsilon,0.5).subs(r_min,2), (r,1.75,4.5), show=False)
p1.show()
```


```python
dat = np.loadtxt('rerun-XXX/rerun-XXX.dat', dtype={'names': ('step', 'Epot', 'dist'), 'formats': ('i4', 'f8', 'f8')})
V = V_LJ_re.subs(epsilon,0.5).subs(r_min,2)
Vy = lambdify(r, V)(dat['dist'])
plt.plot(dat['dist'], dat['Epot'], 'k*')
plt.plot(dat['dist'], Vy)
plt.show()
```


```python

```

243ce1509ecfeda74802eadb1af548576aa3b91d
ipynb
Jupyter Notebook
test/Lennard-Jones.ipynb
sidneypaulymer/probes-for-md
c8bcff52a00e0c3ed5dbe73d38fdd791203915f9
MIT
2021-09-18T17:00:27.000Z
2021-09-18T17:00:27.000Z
test/Lennard-Jones.ipynb
sidneypaulymer/probes-for-md
c8bcff52a00e0c3ed5dbe73d38fdd791203915f9
MIT
test/Lennard-Jones.ipynb
sidneypaulymer/probes-for-md
c8bcff52a00e0c3ed5dbe73d38fdd791203915f9
MIT
Qwen/Qwen-72B
1. YES
2. YES