matthewholman / assist

ASSIST is a software package for ephemeris-quality integrations of test particles.
https://assist.readthedocs.io/
GNU General Public License v3.0
24 stars 10 forks source link

jd_ref bug? #16

Closed hannorein closed 1 year ago

hannorein commented 1 year ago

I'm looking into the jd_ref thing. But I'm confused. I'm either missing something (most likely) or there is a bug.

In the examples, both jd_ref and tstart are full (not relative) Julian dates. The rebound variable r->t is being set to tstart, so also a full Julian date. But then this line doesn't make sense. Following through the various function calls, I believe the code is just adding jd_ref to r->t here and then comparing it to pl->beg and pl->end. All of these are in full Julian dates so it doesn't work. It would only work if r->t is a relative Julian date.

Maybe this specific line didn't trigger an error because the code was never tested with dates before 11 Jan 17000 CE. But I'm also not sure that the lines below are correct where the record number blk is calculated. But that would have surely shown up on a test, so I assume that part must be correct. So I must be missing something.

matthewholman commented 1 year ago

As far as I know, the variable t in the routines in assist.c and forces.c is a time relative to jd_ref. So tstart and tend are relative to jd_ref. I have been testing the routines with jupyter notebooks, so simplest/problem.c is probably no up to date and doesn't reflect the relatively recent switch to jd_ref and t.

hannorein commented 1 year ago

Ok. If simplest/problem.c is not up-to-date then, that would explain things...