Links zu Dokumentationen/Tutorials für IPython/Python/numpy/matplotlib/git sowie die Sourcodes findet ihr im GitHub Repo.


In [1]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

In [2]:
values = np.loadtxt('ex06_impl_1e-5.out')
time = values[:,0]
alpha = values[:,1]
alpha_dot = values[:,2]

In [3]:
plt.plot(time, alpha)
plt.ylabel(r'$\alpha(t)$')
plt.xlabel(r'$t$')
plt.grid()



In [4]:
plt.plot(time[:200], alpha[:200])
plt.ylabel(r'$\alpha(t)$')
plt.xlabel(r'$t$')
plt.grid()



In [5]:
q = alpha
p = alpha_dot
H = - np.cos(q) + p**2 / 2

$H(q(t), p(t))$ ist konstant, weil die Energieerhaltung gelten muss: $\frac{d}{dt} H(p(t),q(t)) = 0$


In [6]:
plt.plot(H)
plt.ylabel(r'$H(p(t),q(t))$')
plt.xlabel(r'$t$')
plt.axis([0,10000, -1, 0])
plt.grid()



In [7]:
plt.plot(q, p)
plt.ylabel(r'$p(t)$')
plt.xlabel(r'$q(t)$')
plt.grid()



In [ ]: