From fada65b6395a8c982dd3022a3e653feaff508dfb Mon Sep 17 00:00:00 2001 From: Dar Dahlen Date: Fri, 27 Sep 2024 16:16:44 -0700 Subject: [PATCH] Typo in trojan calculation (#127) --- src/examples/earth_trojan.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/examples/earth_trojan.py b/src/examples/earth_trojan.py index c258a9d..de9824c 100644 --- a/src/examples/earth_trojan.py +++ b/src/examples/earth_trojan.py @@ -60,7 +60,10 @@ energy_vals.append(total / m_steps) -cur_energy = 3 * (elem_a.semi_major - 1) ** 2 / (8.0 * mass_planet) + energy_vals[0] +cur_energy = ( + 3 * (elem_a.semi_major - elem_b.semi_major) ** 2 / (8.0 * mass_planet) + + energy_vals[0] +) # energy vals start from the current positions and go a full orbit. # These may be unrolled so that the Earth is in the middle, the following