just made test.py a little more handy
This commit is contained in:
parent
7cd5e01ad3
commit
dfca38cbb3
43
test.py
43
test.py
|
@ -5,28 +5,29 @@ from copy import copy
|
||||||
import matplotlib.pyplot as plt
|
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)
|
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)
|
#x_coords = np.array([0, 1], dtype=np.float16)
|
||||||
y_coords = np.array([0, 0], dtype=np.float16)
|
#y_coords = np.array([0, 0], dtype=np.float16)
|
||||||
|
#
|
||||||
x_momenta = 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)
|
#y_momenta = np.array([0, 0], dtype=np.float16)
|
||||||
|
#
|
||||||
time = np.arange(0, 5, 1, dtype=np.float16)
|
#time = np.arange(0, 5, 1, dtype=np.float16)
|
||||||
|
#
|
||||||
time_evolution = deque()
|
#time_evolution = deque()
|
||||||
|
#
|
||||||
for t in time:
|
#for t in time:
|
||||||
x_momenta, y_momenta = interaction2D(x_coords, y_coords, x_momenta, y_momenta, c)
|
# x_momenta, y_momenta = interaction2D(x_coords, y_coords, x_momenta, y_momenta, c)
|
||||||
x_coords += x_momenta
|
# x_coords += x_momenta
|
||||||
y_coords += y_momenta
|
# y_coords += y_momenta
|
||||||
|
#
|
||||||
time_evolution.append(copy(x_coords))
|
# time_evolution.append(copy(x_coords))
|
||||||
|
#
|
||||||
time_evolution = np.array(time_evolution)
|
#time_evolution = np.array(time_evolution)
|
||||||
|
#
|
||||||
particle_one_evolution = time_evolution[:, 0]
|
#particle_one_evolution = time_evolution[:, 0]
|
||||||
particle_two_evolution = time_evolution[:, 1]
|
#particle_two_evolution = time_evolution[:, 1]
|
||||||
|
|
||||||
#plt.subplot(2, 1, 1)
|
#plt.subplot(2, 1, 1)
|
||||||
r = np.arange(0, 0.5, 0.01, dtype=np.float16)
|
r = np.arange(0, 0.5, 0.01, dtype=np.float16)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user