File:Folding animation of a line segment in the Rössler attractor.gif

From testwiki
Jump to navigation Jump to search
    Original file (844 × 655 pixels, file size: 8.48 MB, MIME type: image/gif, looped, 600 frames, 30 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: Stretching and folding of a line segment in the Rössler attractor
    Nederlands: Uitrekken en opvouwen van een lijnsegment in the Rössler attractor
    Date
    Source Own work
    Author MattiesR

    Matlab code

    %% Folding animation
    a = 0.1;
    b = 0.1;
    c = 18;
    f = @(t,y) rossler(t,y,a,b,c);
    
    % Initial line
    M = 1000; % Number of points in line
    x0 = [zeros(M,1), linspace(-26, -12, M)', zeros(M,1)];
    
    dt = 0.05;
    N = 600;
    
    X = x0;
    
    % Create figure
    figure;
    hold on;
    grid on;
    xlabel('r = sqrt(x^2 + y^2)');
    ylabel('log(z)');
    axis([0,30,-10,5]);
    
    % GIF settings
    filename = 'rossler_folding_wiki.gif';
    delay = 0.05;
    
    for i = 1:N
        Xnew = zeros(size(X));
        for j = 1:M
            [~, y] = ode45(f, [0, dt], X(j,:));
            Xnew(j,:) = y(end,:);
        end
        X = Xnew;
    
        r = sqrt(X(:,1).^2 + X(:,2).^2);
        z = log(X(:,3));
        cla;
        plot(r, z, '.-');
        title(sprintf("Folding in Rossler attractor: t = %.2f", dt * i));
        drawnow;
    
        % Capture frame
        frame = getframe(gcf);
        im = frame2im(frame);
        [A,map] = rgb2ind(im,256);
    
        % Write to GIF
        if i == 1
            imwrite(A, map, filename, 'gif', 'LoopCount', Inf, 'DelayTime', delay);
        else
            imwrite(A, map, filename, 'gif', 'WriteMode', 'append', 'DelayTime', delay);
        end
    end
    
    function dydx=rossler(t,y,a,b,c)
    %   Integrate phase point (y(1)=x, y(2)=y, y(3)=z)
    dydx(1,1)=-y(2)-y(3);
    dydx(2,1)=y(1)+a*y(2);
    dydx(3,1)=b+y(3)*(y(1)-c);
    
    

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
    The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

    Captions

    Stretching and folding of a line segment in the Rössler attractor

    Items portrayed in this file

    depicts

    5 July 2025

    8,888,667 byte

    655 pixel

    844 pixel

    image/gif

    fe2bae600fa0bfb047796514f4174a27fd8040a5

    File history

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

    Date/TimeThumbnailDimensionsUserComment
    current16:12, 5 July 2025Thumbnail for version as of 16:12, 5 July 2025844 × 655 (8.48 MB)wikimediacommons>MattiesRUploaded own work with UploadWizard

    There are no pages that use this file.