File:Rössler attractor reconstructed by Taken's theorem, using different delay lengths..gif

From testwiki
Jump to navigation Jump to search
    Original file (1,000 × 1,000 pixels, file size: 11.74 MB, MIME type: image/gif, 120 frames, 9.6 s)
    Note: Due to technical limitations, thumbnails of high resolution GIF images such as this one will not be animated.

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: ```python

    import numpy as np import matplotlib.pyplot as plt from scipy.integrate import solve_ivp

    def rossler_system(t, xyz, a, b, c):

       x, y, z = xyz
       dx_dt = -y - z
       dy_dt = x + a * y
       dz_dt = b + z * (x - c)
       return [dx_dt, dy_dt, dz_dt]
    
    1. Rossler system parameters

    a = 0.2 b = 0.2 c = 5.7

    1. Initial conditions

    xyz0 = [1.0, 1.0, 1.0] tmin, tmax = 0, 10000 t_span = [tmin, tmax] t_resolution = 100 t_eval = np.linspace(t_span[0], t_span[1], (tmax-tmin) * t_resolution)

    solution = solve_ivp(rossler_system, t_span, xyz0, args=(a, b, c), t_eval=t_eval) x, y, z = solution.y

    %%capture import os

    xmin, xmax = min(x) + (min(x) - max(x))*0.03, max(x) + (max(x) - min(x))*0.03

    for i, delay in enumerate(range(1, 601, 5)):

       fig = plt.figure(figsize=(10, 10))
       ax = fig.add_subplot(111)
       ax.plot(x[:-(delay)], x[(delay):], color='k', linewidth=0.04, alpha=0.8)
       ax.axis("off")
       ax.set_xlim(xmin, xmax)
       ax.set_ylim(xmin, xmax)
    
       title = ax.set_title(f"Rössler attractor reconstructed with delay t={delay/t_resolution:0.2f}", fontsize=20)
       title.set_position((0.1,0))
       title.set_ha('left')
       title.set_va('bottom')
    
       dir_path = f"./rossler"
       if not os.path.exists(dir_path):
           os.makedirs(dir_path)
    
       fig.savefig(f"{dir_path}/{i}.png")
       plt.close()
    

    import imageio.v3 as iio import os from natsort import natsorted import moviepy.editor as mp

    for dir_path in ["./rossler"]:

       file_names = natsorted((fn for fn in os.listdir(dir_path) if fn.endswith('.png')))
    
       # Create a list of image files and set the frame rate
       images = []
       fps = 12
    
       # Iterate over the file names and append the images to the list
       for file_name in file_names:
           file_path = os.path.join(dir_path, file_name)
           images.append(iio.imread(file_path))
    
       filename = dir_path[2:]
       iio.imwrite(f"{filename}.gif", images, duration=1000/fps, rewind=True)
       clip = mp.ImageSequenceClip(images, fps=fps)
       clip.write_videofile(f"{filename}.mp4")
    
    ```
    Date
    Source Own work
    Author Cosmia Nebula

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    w:en:Creative Commons
    attribution share alike
    This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
    You are free:
    • to share – to copy, distribute and transmit the work
    • to remix – to adapt the work
    Under the following conditions:
    • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
    • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    24 April 2023

    image/gif

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current07:48, 25 April 2023Thumbnail for version as of 07:48, 25 April 20231,000 × 1,000 (11.74 MB)wikimediacommons>Cosmia NebulaUploaded while editing "Takens's theorem" on en.wikipedia.org

    There are no pages that use this file.