just made test.py a little more handy

This commit is contained in:
Daniel Knüttel 2019-07-08 15:52:57 +02:00
parent 7cd5e01ad3
commit dfca38cbb3
1 changed files with 22 additions and 21 deletions

43
test.py
View File

@ -5,28 +5,29 @@ from copy import copy
import matplotlib.pyplot as plt
c = np.array([5, 10, 20, 0, 0, 0, 0, 1, -2, 0, -2, -0.1, 2, 0, 0, 0, 0, 0, 0], dtype=np.float16)
print(c)
x_coords = np.array([0, 1], dtype=np.float16)
y_coords = np.array([0, 0], dtype=np.float16)
x_momenta = np.array([0, 0], dtype=np.float16)
y_momenta = np.array([0, 0], dtype=np.float16)
time = np.arange(0, 5, 1, dtype=np.float16)
time_evolution = deque()
for t in time:
x_momenta, y_momenta = interaction2D(x_coords, y_coords, x_momenta, y_momenta, c)
x_coords += x_momenta
y_coords += y_momenta
time_evolution.append(copy(x_coords))
time_evolution = np.array(time_evolution)
particle_one_evolution = time_evolution[:, 0]
particle_two_evolution = time_evolution[:, 1]
#x_coords = np.array([0, 1], dtype=np.float16)
#y_coords = np.array([0, 0], dtype=np.float16)
#
#x_momenta = np.array([0, 0], dtype=np.float16)
#y_momenta = np.array([0, 0], dtype=np.float16)
#
#time = np.arange(0, 5, 1, dtype=np.float16)
#
#time_evolution = deque()
#
#for t in time:
# x_momenta, y_momenta = interaction2D(x_coords, y_coords, x_momenta, y_momenta, c)
# x_coords += x_momenta
# y_coords += y_momenta
#
# time_evolution.append(copy(x_coords))
#
#time_evolution = np.array(time_evolution)
#
#particle_one_evolution = time_evolution[:, 0]
#particle_two_evolution = time_evolution[:, 1]
#plt.subplot(2, 1, 1)
r = np.arange(0, 0.5, 0.01, dtype=np.float16)