import numpy as np
import matplotlib.pyplot as plt
import monedo as mo


N=2000

VN=np.arange(10,N,30)

def f(t,x):
    return 1/t

def y(t):
    return np.log(t)

err1=mo.erreur(mo.euler_all,f,1,2,0,VN,y)
err2=mo.erreur(mo.ptmilieu_all,f,1,2,0,VN,y)
err3=mo.erreur(mo.heun_all,f,1,2,0,VN,y)
err4=mo.erreur(mo.myrk4_all,f,1,2,0,VN,y)
plt.plot(VN,err1)
plt.plot(VN,err2)
plt.plot(VN,err3)
plt.plot(VN,err4)
plt.plot(VN,1/VN)
plt.plot(VN,1/(VN**2))
plt.plot(VN,1/(VN**4))
plt.xscale('log')
plt.yscale('log')
plt.show()


