1
0

modify initialisation parameters and add gif animation saving

This commit is contained in:
Thibault Barnouin
2021-10-30 16:42:12 +02:00
parent 9a16400a89
commit d538dfe7a4
5 changed files with 42 additions and 18 deletions

View File

@@ -77,6 +77,12 @@ class System:
rij = np.linalg.norm(body.q-otherbody.q)
W = W - G*body.m*otherbody.m/rij
return T + W
def __repr__(self): # Called upon "print(system)"
return str([print(body) for body in self.bodylist])
def __str__(self): # Called upon "str(system)"
return str([str(body) for body in self.bodylist])
if __name__ == "__main__":