Closed rodluger closed 3 years ago
Thanks - all this info is super useful to track down the issue. I bet it has something to do with numerical issues the mod implementation in the kepler solver. I'll get it sorted!
What is the behavior if you do not set the eccentricity? The Kepler solver shouldn't be needed for e=0
, and it looks like the code should work fine for ecc=None
: https://github.com/exoplanet-dev/exoplanet/blob/55d2252c71191044613fabb9c8bd3062aca3bc1b/src/exoplanet/orbits/keplerian.py#L188-L191
Yep, it works fine with ecc=None
.
Describe the bug The radial velocity returned by
exoplanet.orbits.KeplerianOrbit().get_radial_velocity(t)
jumps discontinuously whent
is very close tot0 + period
.A few things I've observed:
omega=0.5*pi
(exactly; changing this by as little as1e-15
fixes the error).ecc=None
also fixes the issue. However, setting it to zero or any nonzero value causes the issue to appear.|t - (t0 + period)| < 1e-13
.365.25
causes the error, by365.24
does not.360.00
causes the error, but100.00
does not. I haven't been able to find a pattern.To Reproduce
The above code produces the following plot, where the discontinuity is evident at
365.25
days. The RV at that time should be zero, but it's equal to-0.06383679
.The sensitivity of
1e-13
can be seen in this figure:Expected behavior For
omega = 0.5 * np.pi
, the RV att = t0 + p
should be exactly zero.Your setup (please complete the following information):
0.4.4
Additional context This issue is unlikely to be encountered in practice because it happens at a pathological point. But that point (
omega=0.5 * np.pi
) is the default instarry
, so I'm getting this discontinuity in several of my tutorial notebooks. If you're swamped I can try to dig into the Kepler solver code and see if I can find anything.