Henon Map

エノン写像

パラメータa,bを変化させると、ダイナミクスが変化する。

それを体験してみることにした。

 

=================================

import numpy as np
import matplotlib.pyplot as plt
import random
import time
import matplotlib.animation as animation


def main():
    time_start = time.time()
    fig, ax = plt.subplots(figsize=(10,10))

    def f(x,y):
        a = 1.4
        b = 0.01
        return (y, a - b * x - y ** 2)

    ims = []
    x = np.random.random(100)
    y = np.random.random(100)

    N = 1000
    for i in range(N):
        x1, y1 = f(x, y)
        im1 = ax.plot(x1,y1,color = "red",linestyle = "None",marker = "o")
        x, y = x1, y1
        ims.append(im1)

    ani = animation.ArtistAnimation(fig,ims,interval = 100)

    ax.set_aspect("equal")
    time_end = time.time()
    plt.show()
    print(time_end - time_start)


if __name__ == '__main__':
    main()