Skip to content

Commit

Permalink
Typo in trojan calculation (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlend authored Sep 27, 2024
1 parent ba639cc commit fada65b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/examples/earth_trojan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fada65b

Please sign in to comment.