In [3]:
%matplotlib qt
exec(open("simpleq-2nd-RK4.py").read())


N is 10000
x[N] is 2.3690497221754776
y[N] is -1.0408962630983686e-14
error in theta is 3.1086244689504383e-15
log10 of the error in theta is -14.507431738848783
error in theta dot is 4.440892098500626e-15
log10 of the error in theta dot is -14.35252977886304
It took 0.28 seconds for this script to run.

In [64]:
j(y)


<string>:26: RuntimeWarning: divide by zero encountered in true_divide
Out[64]:
array([[          -inf],
       [4.30724671e+02],
       [2.15362336e+02],
       ...,
       [2.15362335e+02],
       [4.30724663e+02],
       [2.21395220e+06]])

In [4]:
plt.plot(y,dy)


Out[4]:
[<matplotlib.lines.Line2D at 0x7f1e09015d90>]

In [5]:
from numpy import diff
diff(y)


Out[5]:
array([], shape=(10001, 0), dtype=float64)

In [54]:
sqrt(2*9.8/1)


Out[54]:
4.427188724235731

In [ ]: