File:Logistic scaling limit, r=3.56994567.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 2,700 × 900 pixels, file size: 126 KB)

    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: Logistic scaling limit at r=3.56994567

    Matplotlib

    import numpy as np
    import matplotlib.pyplot as plt
    
    def logistic_map(x, r):
        return r * x * (1 - x)
    
    def function_iter(f, n, x, **kwargs):
        for _ in range(n):
            x = f(x, **kwargs)
        return x
    
    r = 3.56994567
    alpha = 2.502907875
    highest_exponent = 8
    fig, ax = plt.subplots(figsize=(30, 10))
    
    x_values = np.linspace(0, 1, 100000)
    y_values = x_values
    last_n_iter = 0
    
    for n in range(highest_exponent):
        n_iter = 2**n
        y_values = function_iter(logistic_map, n_iter - last_n_iter, y_values, r=r)
        last_n_iter = n_iter
    
        ax.plot(0.5+(x_values-0.5)*(-alpha)**(n), 0.5+(y_values-0.5)*(-alpha)**(n), label=f'iteration = {2**n}', 
                alpha=0.1, color='black', linewidth=4)
    
    ax.hlines(0.5, 0, 1, linewidth=0.3, alpha=0.8, linestyle='--', color='black')
    # ax.legend(
    
    l_x = 5
    ax.set_xlim(0.5-l_x, 0.5+l_x)
    ax.set_ylim(-6, 4)
    
    
    fig.suptitle(f'Up to {2**(highest_exponent-1)} iterates of the Logistic map with r = {r}, each iterate scaled up',y=1.0)
    plt.tight_layout()
    plt.savefig(f"./logistic_scaling_limit_{r}.svg")
    plt.show()

    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

    6 April 2024

    image/svg+xml

    File history

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

    Date/TimeThumbnailDimensionsUserComment
    current01:06, 7 April 2024Thumbnail for version as of 01:06, 7 April 20242,700 × 900 (126 KB)wikimediacommons>Cosmia NebulaUploaded while editing "Feigenbaum function" on en.wikipedia.org

    There are no pages that use this file.