File:Painleve I with asymptotics.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 960 × 576 pixels, file size: 70 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: Painleve I with asymptotics

    Matplotlib code

    import numpy as np
    import matplotlib.pyplot as plt
    from scipy.integrate import solve_ivp
    
    # Define the Painlevé I equation as a system of first-order ODEs
    def painleve_I(t, y):
        # y[0] is y, y[1] is y'
        return [y[1], 6 * y[0]**2 + t]
    
    # Set up the plotting range
    x_min, x_max = -12, 3
    
    # Values of k to plot
    k_values = [-0.45143, -0.45142, 0, 1, 1.8518, 1.8519]
    
    # Create the figure
    plt.figure(figsize=(10, 6))
    
    for i, k in enumerate(k_values):
        # Initial conditions at x=0
        y0 = [0, k]
        
        t_span_forward = [0, x_max]
        sol_forward = solve_ivp(painleve_I, t_span_forward, y0, method='DOP853', 
                              dense_output=True, rtol=1e-10, atol=1e-10)
        
        t_forward = np.linspace(0, x_max, 1000)
        y_forward = sol_forward.sol(t_forward)[0]
        
        t_span_backward = [0, x_min]
        sol_backward = solve_ivp(painleve_I, t_span_backward, y0, method='DOP853', 
                               dense_output=True, rtol=1e-10, atol=1e-10)
        
        t_backward = np.linspace(0, x_min, 1000)
        y_backward = sol_backward.sol(t_backward)[0]
        
        t = np.concatenate([t_backward[::-1], t_forward[1:]])
        y = np.concatenate([y_backward[::-1], y_forward[1:]])
        plt.plot(t, y, label=f"$w'(0) = {k}$")
    
    y_parabola = np.linspace(-1.5, 1.5, 1000)
    x_parabola = -6 * y_parabola**2
    
    plt.plot(x_parabola, y_parabola, 'k-', linewidth=2, label='$6y^2 + x = 0$')
    
    plt.axhline(y=0, color='gray', linestyle='-', alpha=0.3)
    plt.axvline(x=0, color='gray', linestyle='-', alpha=0.3)
    plt.grid(True, alpha=0.3)
    plt.title("Painlevé I: $y'' = 6y^2 + x$")
    plt.xlabel('$x$')
    plt.ylabel('$y$')
    plt.legend()
    plt.xlim(x_min, x_max)
    plt.ylim(-2, 2)
    
    # Show the plot
    plt.tight_layout()
    plt.savefig('painleve_I.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

    29 March 2025

    image/svg+xml

    File history

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

    Date/TimeThumbnailDimensionsUserComment
    current08:00, 30 March 2025Thumbnail for version as of 08:00, 30 March 2025960 × 576 (70 KB)wikimediacommons>Cosmia NebulaUploaded while editing "Painlevé transcendents" on en.wikipedia.org

    There are no pages that use this file.