Skip to content

Conversation

@hannorein
Copy link
Collaborator

(I've built this upon #49, so you might want to look at this one later)

  1. I've added a new enum ASSIST_BODY. The idea is to use this consistently throughout the code so that we don't need to refer to the sun as 0 or to the earth as 3, which is a bit hard to read. For example, the order in which direct forces are calculated is much easier to understand now (see here). These constants belong to ASSIST and not the ephemeris file. So if the ephemeris file changes, we can update the mapping, but don't need to change any constants in random places in the code.
  2. I've renamed the struct _jpl_s to jpl_s and variables of that type from pl to jpl. They are only used internally, but it was a bit inconsistent compared to the struct spk_s.
  3. The asteroid ephemeris calculation did includ the calculation of the velocity. But the velocity was never used (not even passed out of assist_spk_calc, so I've commented it out. The code is still there if we ever need the asteroid velocities.

@hannorein
Copy link
Collaborator Author

  1. I'm skipping some calculations in the direct force routine which are not needed if not variational particles are present. That gives me an almost 10% speedup.

(We should add a few unit tests and a benchmark for simulations with variational particles)

@hannorein hannorein mentioned this pull request Feb 5, 2023
@matthewholman
Copy link
Owner

Nice job finding another ~10% speedup!

I agree that we should add benchmarks for initial conditions with variational particles. There are undoubtedly speedup opportunities in the sections of code for the variational equations.

@matthewholman matthewholman merged commit 355c199 into matthewholman:main Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants