```python
import sympy as sp
import warnings
warnings.filterwarnings('ignore')
sp.init_printing()
```


```python
N = sp.Symbol("N")
x = sp.IndexedBase("x")
y = sp.IndexedBase("y")
z = sp.IndexedBase("z")
i = sp.Symbol("i")
j = sp.Symbol("j")
k = sp.Symbol("k")
dx = x[i] - x[j]
dy = y[i] - y[j]
dz = z[i] - z[j]
r = sp.sqrt(dx**2 + dy**2 + dz**2)
eps = sp.Symbol("ε")
sig = sp.Symbol("σ")
```


```python
#energy = (1/2)*sp.Sum(sp.Sum(4 * eps * ((sig/r)**12 - (sig/r)**6), (i, 1, N)), (j, 1, N)) 
# It is easier to work with just the summand
energy = 4 * eps * ((sig/r)**12 - (sig/r)**6)
```


```python
energy
```




$\displaystyle 4 ε \left(\frac{σ^{12}}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{6}} - \frac{σ^{6}}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{3}}\right)$




```python
r.diff(x[k])
```




$\displaystyle \frac{\left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({x}_{i} - {x}_{j}\right)}{2 \sqrt{\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}}}$




```python
energy.diff(x[k])
```




$\displaystyle 4 ε \left(- \frac{6 σ^{12} \left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({x}_{i} - {x}_{j}\right)}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{7}} + \frac{3 σ^{6} \left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({x}_{i} - {x}_{j}\right)}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{4}}\right)$




```python
energy.diff(y[k])

```




$\displaystyle 4 ε \left(- \frac{6 σ^{12} \left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({y}_{i} - {y}_{j}\right)}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{7}} + \frac{3 σ^{6} \left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({y}_{i} - {y}_{j}\right)}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{4}}\right)$




```python
energy.diff(z[k])
```




$\displaystyle 4 ε \left(- \frac{6 σ^{12} \left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({z}_{i} - {z}_{j}\right)}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{7}} + \frac{3 σ^{6} \left(2 \delta_{i k} - 2 \delta_{j k}\right) \left({z}_{i} - {z}_{j}\right)}{\left(\left({x}_{i} - {x}_{j}\right)^{2} + \left({y}_{i} - {y}_{j}\right)^{2} + \left({z}_{i} - {z}_{j}\right)^{2}\right)^{4}}\right)$




```python
import sympy as sp
import warnings
warnings.filterwarnings('ignore')
sp.init_printing()
eps = sp.Symbol("ε")
sig = sp.Symbol("σ")
rad = sp.Symbol("r")
energyRad = 4 * eps * ((sig/rad)**12 - (sig/rad)**6)
energyRad.diff(rad)
```




$\displaystyle 4 ε \left(\frac{6 σ^{6}}{r^{7}} - \frac{12 σ^{12}}{r^{13}}\right)$




```python

```


```python

```

9b400d2269634088f0b7876bb91485f1d7f46657
ipynb
Jupyter Notebook
AJupyter/energyDirivative.ipynb
cmoser8892/MoleDymCode
9077289a670c6cb0ed9e1daac5a03b51c83bc6fb
MIT
AJupyter/energyDirivative.ipynb
cmoser8892/MoleDymCode
9077289a670c6cb0ed9e1daac5a03b51c83bc6fb
MIT
AJupyter/energyDirivative.ipynb
cmoser8892/MoleDymCode
9077289a670c6cb0ed9e1daac5a03b51c83bc6fb
MIT
Qwen/Qwen-72B
1. YES
2. YES