import numpy as np import matplotlib.pyplot as plt def chirikov_standard_map(x, y, K): """Compute one iteration of the Chirikov standard map.""" x_next = (x + y + K * np.sin(x)) % (2 * np.pi) y_next = (y + K * np.sin(x)) % (2 * np.pi) return x_next, y_next def generate_points(N, K, iterations): """Generate points for the Chirikov standard map.""" x = np.random.uniform(0, 2 * np.pi, N) y = np.random.uniform(0, 2 * np.pi, N) points = np.zeros((iterations, N, 2)) for i in range(iterations): x, y = chirikov_standard_map(x, y, K) points[i, :, 0] = x points[i, :, 1] = y return points def plot_chirikov_map(points, iterations): """Plot the Chirikov standard map points.""" plt.figure(figsize=(8, 8)) for i in range(iterations): plt.scatter(points[i, :, 0], points[i, :, 1], s=0.1, color='blue') plt.title('Chirikov Standard Map; K = 1.5, 90 seeds') plt.show() # Parameters N = 90 # Number of initial points K = 1.5 # Chirikov standard map parameter iterations = 100 # Number of iterations of map # Generate and plot points points = generate_points(N, K, iterations) plot_chirikov_map(points, iterations)