modify output name
This commit is contained in:
@@ -132,13 +132,13 @@ class System:
|
||||
E[j] = self.Eval()
|
||||
L[j] = self.Lval()
|
||||
|
||||
if display and j%100==0:
|
||||
if display and (j+1)%100==0:
|
||||
# display progression
|
||||
q_array = self.get_positions()
|
||||
if len(self.bodylist) == 1:
|
||||
d.on_running(q_array[0], q_array[1], q_array[2], step=j, label="step {0:d}/{1:d}".format(j,N))
|
||||
d.on_running(q_array[0], q_array[1], q_array[2], step=j, label="step {0:d}/{1:d}".format(j+1,N))
|
||||
else:
|
||||
d.on_running(q_array[:,0], q_array[:,1], q_array[:,2], step=j, label="step {0:d}/{1:d}".format(j,N))
|
||||
d.on_running(q_array[:,0], q_array[:,1], q_array[:,2], step=j, label="step {0:d}/{1:d}".format(j+1,N))
|
||||
if display:
|
||||
system("convert -delay 5 -loop 0 tmp/??????.png tmp/temp.gif && rm tmp/??????.png")
|
||||
system("convert tmp/temp.gif -fuzz 30% -layers Optimize plots/dynsyst.gif && rm tmp/temp.gif")
|
||||
@@ -228,13 +228,13 @@ class System:
|
||||
E[j] = self.Eval()
|
||||
L[j] = self.Lval()
|
||||
|
||||
if display and j%100==0:
|
||||
if display and (j+1)%100==0:
|
||||
# display progression
|
||||
q_array = self.get_positions()
|
||||
if len(self.bodylist) == 1:
|
||||
d.on_running(q_array[0], q_array[1], q_array[2], step=j, label="step {0:d}/{1:d}".format(j,N))
|
||||
d.on_running(q_array[0], q_array[1], q_array[2], step=j, label="step {0:d}/{1:d}".format(j+1,N))
|
||||
else:
|
||||
d.on_running(q_array[:,0], q_array[:,1], q_array[:,2], step=j, label="step {0:d}/{1:d}".format(j,N))
|
||||
d.on_running(q_array[:,0], q_array[:,1], q_array[:,2], step=j, label="step {0:d}/{1:d}".format(j+1,N))
|
||||
if display:
|
||||
system("convert -delay 5 -loop 0 tmp/??????.png tmp/temp.gif && rm tmp/??????.png")
|
||||
system("convert tmp/temp.gif -fuzz 30% -layers Optimize plots/dynsyst.gif && rm tmp/temp.gif")
|
||||
|
||||
8
main.py
8
main.py
@@ -16,13 +16,13 @@ def main():
|
||||
e = np.array([0., 0., 1./4.]) # Eccentricity
|
||||
psi = np.array([0., 0., 80.])*np.pi/180. # Inclination of the orbital plane in degrees
|
||||
|
||||
x1 = np.array([-1., 0., 0.])*a[0]
|
||||
x2 = np.array([1., 0., 0.])*a[1]
|
||||
x1 = np.array([0., -1., 0.])*a[0]
|
||||
x2 = np.array([0., 1., 0.])*a[1]
|
||||
x3 = np.array([np.cos(psi[2]), 0., np.sin(psi[2])])*a[2]
|
||||
q = np.array([x1, x2, x3])
|
||||
|
||||
v1 = np.array([0., -np.sqrt(G*m[1]**2/((m[0]+m[1])*np.sqrt(np.sum((q[0]-q[1])**2)))), 0.])
|
||||
v2 = np.array([0., np.sqrt(G*m[0]**2/((m[0]+m[1])*np.sqrt(np.sum((q[0]-q[1])**2)))), 0.])
|
||||
v1 = np.array([-np.sqrt(G*m[1]**2/((m[0]+m[1])*np.sqrt(np.sum((q[0]-q[1])**2)))), 0., 0.])
|
||||
v2 = np.array([np.sqrt(G*m[0]**2/((m[0]+m[1])*np.sqrt(np.sum((q[0]-q[1])**2)))), 0., 0.])
|
||||
v3 = np.array([0., np.sqrt(G*(m[0]+m[1])*(2./np.sqrt(np.sum(q[2]**2))-1./a[2])), 0.])
|
||||
v = np.array([v1, v2, v3])
|
||||
|
||||
|
||||
BIN
plots/Em.png
Normal file
BIN
plots/Em.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 299 KiB |
BIN
plots/L2.png
Normal file
BIN
plots/L2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 324 KiB |
Reference in New Issue
Block a user