-
Notifications
You must be signed in to change notification settings - Fork 0
/
bosons4A.py
36 lines (29 loc) · 979 Bytes
/
bosons4A.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import numpy as np
import numfor as nf
from time import time
import datetime
r = np.array(np.load(r'initial_states/Triangle_Hexag_30k.npy'), order='F')
N = len(r)
k = (2*np.pi)**2
dt= 0.0001
t = np.zeros((1))
v = np.zeros((N,2), order='F')
F = np.zeros((N,2), order='F')
th=0.5*np.max(r)
E_inter, E_tramp, E_kin = nf.mesure_th(r=r, v=v, k=k, g=1.0, th=th)
# r = r*(E_inter/E_tramp)**(0.25)
g=E_tramp/E_inter
E_inter, E_tramp, E_kin = nf.mesure_th(r=r, v=v, k=k, g=g, th=th)
print(E_inter, E_tramp, E_kin, g, k)
nf.forces_th(r=r, f=F, k=k, g=g, th=th)
t=np.zeros((1))
print(datetime.datetime.now())
s=0
np.save((r'evolucio10/triangleT_05max_r-'+str(s)), r)
np.save((r'evolucio10/triangleT_05max_v-'+str(s)), v)
for i in range(200):
s+=50
nf.verlet_steps_th(r=r, v=v, f=F, t=t, steps=50, k=k, g=g, dt=dt, th=th)
np.save((r'evolucio10/triangleT_05max_r-'+str(s)), r)
np.save((r'evolucio10/triangleT_05max_v-'+str(s)), v)
print(t, datetime.datetime.now())