To run the code below:
SHIFT+ENTER
on your keyboard or press the play button () in the toolbar above.For an overview of the notebook interface click on Help > User Interface Tour in the menu on the top.
See also:
Ulitsky, A., & Elber, R. (1990). A new technique to calculate steepest descent paths in flexible polyatomic systems. The Journal of Chemical Physics, 92(2), 1510. doi:10.1063/1.458112
Müller, K. (1980). Reaction paths on multidimensional energy hypersurfaces. Angewandte Chemie International Edition in English, 19(1), 1–13. doi:10.1002/anie.198000013
%matplotlib inline
from potential import Potential
from path import Path
import numpy as np
import matplotlib.pyplot as plt
potential = Potential()
potential.plot()
The variable threshold
determines the convergence criterion for the method. The smaller its value, the longer the method will take to converge.
reactant = np.array([0.623499, 0.028038])
product = np.array([-0.558233, 1.441716])
num_nodes = 10
threshold = 1e-4
path = Path(reactant, product, num_nodes, potential, threshold)
path.plot()
for p in iter(path):
path.plot()
plt.show()
We add some random perturbation to the initial linear interpolation between the endpoints.
reactant = np.array([0.623499, 0.028038])
product = np.array([0.0, 0.5])
num_nodes = 10
threshold = 5e-4
path = Path(reactant, product, num_nodes, potential, threshold)
# Add random noise to the initial, linear interpolant.
perturbation = 1e-1 * (2.0 * np.random.rand(num_nodes - 2, 2) - 1.0)
path.points[1:-1, :] += perturbation
path.plot()
plt.show()
for p in iter(path):
path.plot()
plt.show()