Arnold-Beltrami-Childress flowΒΆ

Example for the deeptime.data.abc_flow() dataset.

 8 import numpy as np
 9 from matplotlib import animation
10
11 import matplotlib.pyplot as plt
12
13 from deeptime.data import abc_flow
14
15
16 def update(num):
17     data = scatters[num]
18     graph.set_data(data[:, 0], data[:, 1])
19     graph.set_3d_properties(data[:, 2])
20     return graph,
21
22
23 system = abc_flow(n_steps=25)
24 scatters = [np.random.uniform(np.pi-.5, np.pi+.5, size=(500, 3))]
25 for _ in range(50):
26     scatters.append(system(scatters[-1], n_jobs=8))
27
28 scatters = np.array(scatters)
29
30 f = plt.figure(figsize=(18, 18))
31 ax = f.add_subplot(1, 1, 1, projection='3d')
32 ax.set_title('Evolution of test points in the ABC flowfield')
33 graph, = ax.plot(*scatters[0].T, linestyle="", marker="o")
34 ax.set_xlim([0, 2*np.pi])
35 ax.set_ylim([0, 2*np.pi])
36 ax.set_zlim([0, 2*np.pi])
37
38 ani = animation.FuncAnimation(f, update, 50, interval=50, blit=True)

Total running time of the script: ( 0 minutes 17.624 seconds)

Estimated memory usage: 21 MB