Note
Click here to download the full example code
Triple-well 1DΒΆ
Example for the deeptime.data.triple_well_1d()
dataset.
8 import matplotlib.pyplot as plt
9 import numpy as np
10
11 from deeptime.data import triple_well_1d
12
13 system = triple_well_1d(h=1e-3, n_steps=500)
14 xs = np.linspace(0, 6., num=500)
15 ys = system.potential(xs.reshape(-1, 1))
16
17 trajectory = system.trajectory(x0=0.5, length=20000, seed=53)
18
19 f, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=(16, 8))
20 ax1.plot(xs, ys.reshape(-1))
21 ax1.set_xlabel('x')
22 ax1.set_ylabel('V(x)')
23 ax1.set_title('Potential landscape')
24
25 ax2.hist(trajectory.reshape(-1), bins=50, density=True)
26 ax2.set_title('Histogram of trajectory')
27
28 plt.show()
Total running time of the script: ( 0 minutes 1.647 seconds)
Estimated memory usage: 8 MB