1
0

get results with right Energy formula

This commit is contained in:
Thibault Barnouin
2022-01-17 12:27:26 +01:00
parent 21cbfa0afe
commit cc29689ac5
44 changed files with 5 additions and 5 deletions

View File

@@ -150,7 +150,7 @@ class System(Body):
for otherbody in self.bodylist:
if body != otherbody:
rij = np.linalg.norm(body.q-otherbody.q)
W = W - Ga*otherbody.m/(body.m+otherbody.m)*body.m**2/rij
W = W - Ga*otherbody.m*body.m/(2.*rij)
E = T + W
return E
@@ -171,7 +171,7 @@ class System(Body):
for otherbody in self.bodylist:
if body != otherbody:
rij = np.linalg.norm(body.q-otherbody.q)
W = W - Ga*otherbody.m/(body.m+otherbody.m)*body.m**2/rij
W = W - Ga*otherbody.m*body.m/(2.*rij)
E = T + W
return E