import numpy as np, matplotlib.pyplot as plt, matplotlib.cm as cm,\
    mpl_toolkits.mplot3d.axes3d as ax, matplotlib.animation as animation

def oppg5():
    points = 1000

    x_start = 0
    x_stop = 24

    y_start = 0
    y_stop = 24

    x_points = np.linspace(x_start,x_stop,points)
    y_points = np.linspace(y_start,y_stop,points)

    x_points,y_points = np.meshgrid(x_points,y_points)

    z_points = (np.sinh( (np.pi * y_points)/6) / np.sinh(4 * np.pi)) * np.cos((np.pi*x_points)/6)

    fig = plt.figure()

    ax = fig.gca(projection = '3d')
    surf = ax.plot_surface(x_points,y_points,z_points, cmap='OrRd')

    plt.show()


def varme(x, t):
    return np.exp(-((np.pi/2)**2 )* t) * np.sin((np.pi * x)/2)


fig, ax = plt.subplots()

x_list = np.linspace(0, 2, 100)
t_list = np.linspace(0, 10, 1000)

y_list = [varme(x_list, t) for t in t_list]

k = 0
def animate(i):
    global k
    y = y_list[k]

    k += 1

    ax.clear()
    plt.plot(x_list, y)

    plt.ylim(0, 1)
    plt.xlim(0, 2)

def oppg3():
    ani = animation.FuncAnimation(fig, animate, frames=360, interval=20)
    plt.show()

oppg3()
oppg5()