1
0

minor changes

This commit is contained in:
Alex_Hubert
2021-11-05 16:18:15 +01:00
parent 6987baaf3a
commit d5f948f4a1
4 changed files with 1 additions and 35 deletions

View File

@@ -85,37 +85,3 @@ class System:
def __str__(self): # Called upon "str(system)" def __str__(self): # Called upon "str(system)"
return str([str(body) for body in self.bodylist]) return str([str(body) for body in self.bodylist])
if __name__ == "__main__":
# initialisation mass
m1 = 10
m2 = 1
m3 = 1
# initialisation position
q1 = np.array([0, 0, 0])
q2 = np.array([1, 0, 0])
q3 = np.array([2, 0, 0])
# initialisation velocity
v1 = np.array([0, 0, 0])
v2 = np.array([1, 1, 0])
v3 = np.array([2, 0, 0])
star1 = Body(m1,q1,v1)
star2 = Body(m2,q2,v2)
star3 = Body(m3,q3,v3)
Lbodylist = [star1,star2]
array = np.zeros((len(Lbodylist),3))
array[0]=star3.q
tribody = System([star1,star2,star3])
print("list=",Lbodylist)
print(tribody.Lval(Lbodylist))

View File

@@ -27,7 +27,7 @@ def main():
v = np.array([v1, v2, v3]) v = np.array([v1, v2, v3])
bodylist = [] bodylist = []
for i in range(2): # For a system of 2 objects for i in range(m.shape[0]):
bodylist.append(Body(m[i], q[i], v[i])) bodylist.append(Body(m[i], q[i], v[i]))
dyn_syst = System(bodylist) dyn_syst = System(bodylist)
dyn_syst.COMShift() dyn_syst.COMShift()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 57 KiB